Thanks for your help.
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
How can I access plot values
Collapse
X
-
How can I access plot values
For example, the MACD indicator has a plot called "Diff". When it draws on the chart, it shows the differences bars. When the bar value is, for example, 3.45, how do I get that value? I have tried several incantations but have not found the correct syntax.
Thanks for your help.Tags: None
-
MatthewNinjaTrader Product Management
-
OK, but I'm doing this inside the MACD indicator. Won't this recursion cause some trouble? I just want to get the value that is plotted on the screen.
Diff[0] gives me a strange value, not the actual value plotted.
Comment
-
Hmmmmm.... I guess it is getting the correct value, however, now my MACD is not working correctly as compared to a straight, unaltered one in a similar chart. I will need to look into that first.
Comment
-
Hello,
Thanks for the update - I would suggest first checking the Calculate On Bar Close property on the indicators you're using as this can change the way Diff[0] will be plotted.
When COBC = True, Diff[0] will be the most recent closed bar, when set to False, Diff[0] will be the current bar.MatthewNinjaTrader Product Management
Comment
-
OK the trouble comes in when I add other Bar objects:
Add(PeriodType.Minute, 15);
Add(PeriodType.Minute, 30);
Adding those lines in or commenting them out makes it work or not work. Why?
Comment
-
Hello,
Do you receive any errors on the Log tab of the Control Center?
Are you checking for the BarsInProgress? Please see our Help Guide artcile on 'Accessing the Price Data in a Multi-Bars NinjaScript' & 'Accessing the Price Data in a Multi-Bars NinjaScript' for more information:
MatthewNinjaTrader Product Management
Comment
-
OK I added :
// Ignore bar update events for the supplementary Bars object added above
if (BarsInProgress == 1)
return;
But to no avail. The MACD plot looks screwy and it's Diff value doesn't match an unadulterated one.
Comment
-
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
579 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
334 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
554 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
551 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment