DaveN
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Strategy and Indicator Labeling Issue
Collapse
X
-
Strategy and Indicator Labeling Issue
I have a custom indicator which plots three values. Each of the values are labeled separately in the indicator plot statement and when I place the indicator on a chart, the plots are labeled with my custom plot labels. When I try to use the indicator in a custom strategy, and I select which plot I wish to use in the strategy, instead of seeing the indicator names I see "Plot0, Plot1, and Plot2". Why are the plot names correct and showing when placed on the chart, but not visible when using the very same indicator in a strategy? Do I need to name the plots somewhere else beside in the plot statement?
DaveN -
Indicator-Strategy naming problem.
This is what is in there now. In the initialize section I have these plot statements:
In the properties region I have:Code:Add(new Plot(Color.FromKnownColor(KnownColor.Black), PlotStyle.Bar, "Shrt_VR")); Add(new Plot(Color.FromKnownColor(KnownColor.Blue), PlotStyle.Line, "Long_VR")); Add(new Plot(new Pen(Color.DarkGoldenrod, 2), PlotStyle.Line, "Diff"));
Can I simply give the name to the corresponding properties area from the plot in the plot statement? In other words rename plot0 to "Short_VR" and so on?Code:#region Properties [Browsable(false)] // this line prevents the data series from being displayed in the indicator properties dialog, do not remove [XmlIgnore()] // this line ensures that the indicator can be saved/recovered as part of a chart template, do not remove public DataSeries Plot0 { get { return Values[0]; } } [Browsable(false)] // this line prevents the data series from being displayed in the indicator properties dialog, do not remove [XmlIgnore()] // this line ensures that the indicator can be saved/recovered as part of a chart template, do not remove public DataSeries Plot1 { get { return Values[1]; } } [Browsable(false)] // this line prevents the data series from being displayed in the indicator properties dialog, do not remove [XmlIgnore()] // this line ensures that the indicator can be saved/recovered as part of a chart template, do not remove public DataSeries Plot2 { get { return Values[2]; } }
Thanks
DaveN
Comment
-
Indicator-Strategy Name Problem
That didn't work at all. Now I'm getting error messages for Plot0 to Plot2 not existing in the current context, and when I rename everything to the Shrt_VR or Long_VR, I get error messages indicating NinjaTrader.Indicator.PT_VolRatio does not contain a definition for Plot0.
Somehow I have to tie the Plot0 through Plot2 plot statements to a dataseries that is named Long_VR, Short_VR, and Diff. Do I create a dataseries with that name first, then define it, then plot it using a plot statement? As near as I can tell, the data series or plot statement values come from the Value0, Value1 etc. statements in the Properties section and I can't see how to tie one to the other.
Have you got an example of how this is done in a piece of sample code?
Thanks
DaveN
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
633 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
364 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
105 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
567 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
568 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment