If not, is there a way to set the painting sequence so one that is most important will paint over others.
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
PaintPriceMarkers Questions
Collapse
X
-
PaintPriceMarkers Questions
Is there a way to selectively enable or disable individual price markers ("PaintValueMarkers" would be better terminology) in multiple-plot indicator code?
If not, is there a way to set the painting sequence so one that is most important will paint over others.
Tags: None
-
Hello caveat_lector,
Thanks for your note.
There currently isn't a property that would allow users to disable individual price markers. The property PaintPriceMarkers applies to all price markers from the indicator.
To set the painting sequence or ZOrder, you can use SetZOrder(). SetZOrder() is used to assign a unique identifier representing the index in which chart objects are drawn on the chart's Z-axis (front to back ordering). Objects with a higher ZOrder are drawn first.
Here is the SetZOrder() Help Guide to assist you further.
-
-
Well, I thought that was a good solution, but I haven't been able to make it work. One of my indicator plots is named "Bandpass". Can you provide example code that will set SetZOrder(int.MaxValue) for that plot to make its ending value print on top?
Comment
-
Hello caveat_lector,
Thanks for your reply.
My apologies, after further testing, I can confirm that SetZOrder() does not provide the option to change the ZOrder of individual price markers or plots. However, this could be controlled by the order the plots are added. For example, adding the plot or price marker last in the list of plots that you want on top. In the example below, the MAL2 plot would display on top of the other two plots by default as it is listed last.
Code:if (State == State.SetDefaults) { AddPlot(Brushes.SeaShell, "MAL1"); AddPlot(Brushes.Red, "MAL3"); AddPlot(Brushes.Goldenrod, "MAL2") }
Comment
-
I tried that without success before starting this thread, but my code is a bit complicated and I may not have made the change that I thought I had made. I will try that again.
Comment
-
I tried that again and it didn't fix the painting sequence in my code, although it might in cases where brush colors are not being changed dynamically within OnBarUpdate(). The following changes fixed the problem:
1) I re-ordered the AddPlot sequence like you suggested;
2) Changed Values[n] numbering in "#region Properties" for each plot to match; and
3) Moved the following code after similar code that dynamically changes the colors of other plots during run-time:
Code:if (PlotBandpass) { if (IsRising(BPF)) PlotBrushes[2][0] = Brushes.Green; else if (IsFalling(BPF)) PlotBrushes[2][0] = Brushes.Red; else PlotBrushes[2][0] = Brushes.Yellow; } else { PlotBrushes[2][0] = Brushes.Transparent; }Last edited by caveat_lector; 11-14-2019, 06:26 PM.
- Likes 1
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
566 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
330 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
101 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
547 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
548 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment