![]() |
This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com
|
|||||||
| General Programming General NinjaScript programming questions. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 | ||
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
|
In a NinjaScriptindicator or strategy, you add plots via the Add() method:
For example: Quote:
The example code belowswitches the entire "Plot1" color betweengreen and red depending on the SMA values: Quote:
Ray
NinjaTrader Customer Service |
||
|
|
|
|
|
#2 |
|
Certified NinjaScript Consultant
|
Does this approach work? I was under the impression that you had to "set" different plots of different colors to dynamically change colors.
Regards, Whitmark |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Feb 2007
Location: , ,
Posts: 14
Thanks: 0
Thanked 0 times in 0 posts
|
I tried this method and couldn't get it to work. What else needs to be done to make it work?
OUFan |
|
|
|
|
|
#4 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
|
Yes, this works for changing the "entire" plot color. This is not a solution for a multi-colored plot.
Ray
Ray
NinjaTrader Customer Service |
|
|
|
|
|
#5 |
|
Certified NinjaScript Consultant
|
Okay, for the record then, the initial example works and is useful to understand how plots work but is not a practical example. The typical application of this type of example ismulti-color plot. . . NinjaScipt newbies take heed.
|
|
|
|
|
|
#6 |
|
Certified NinjaScript Consultant
|
For the sake of clarification, there is a comment earlier in this thread that implies that the Add() method can be used within a NinjaScript strategy to add a Plot. This is not the case. The Add() method, when used with a strategy, can be used add an indicator (that may have its own plot) or another bars object (that will not display), but the Add(Plot) or Add(Line) is currently only reserved for NinjaScript indicators.
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|