Thanks!
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Changing Price Marker Y-Value
Collapse
X
-
Changing Price Marker Y-Value
I have an indicator which i must run on COBC = false, however, I would like the Price Marker to be plotted at the value of the last completed bar, not the current bar in progress. Is there any way to add code to the FormatPriceMarker() method that would allow me to set the y-value of the Price Marker directly?
Thanks!Tags: None
-
You should be able to format it this way by reference the Plot value one bar ago, rather than the current bar.
You may also be able to use FirstTickOfBar to filter the logic being used when updating the value you're plotting as per the following reference sample:Code:Plot0.Set(Close[1]);
MatthewNinjaTrader Product Management
-
You could add the indicator twice, once in COBC = true and once in COBC = false. Then disable the price markers for the instance that runs in COBC = false.Originally posted by Srgtroy View PostI have an indicator which i must run on COBC = false, however, I would like the Price Marker to be plotted at the value of the last completed bar, not the current bar in progress. Is there any way to add code to the FormatPriceMarker() method that would allow me to set the y-value of the Price Marker directly?
Thanks!
Comment
-
That would result in the price marker reflecting the value of the last completed bar; however, it would also offset the whole plot by one bar, which i don't want.Originally posted by NinjaTrader_Matthew View PostYou should be able to format it this way by reference the Plot value one bar ago, rather than the current bar.
Code:Plot0.Set(Close[1]);
I did try the following:
Now, the value of the price marker reflects the value of the plot at the last completed bar; however, the actual price marker itself still shifts up and down along the y-scale at each tick and is painted at the current value of the plot, not the last completed bar value, so this only works halfway. I'm still looking for a complete solution if anyone has one.Code:public override string FormatPriceMarker(double price) { return Plot0[1].ToString("N2"); }
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
110 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
59 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
37 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
41 views
0 likes
|
Last Post
|
||
|
Started by Mindset, 02-28-2026, 06:16 AM
|
0 responses
78 views
0 likes
|
Last Post
by Mindset
02-28-2026, 06:16 AM
|

Comment