Thanks for your help.
Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
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 AttiM, 02-14-2024, 05:20 PM
|
9 responses
174 views
0 likes
|
Last Post Today, 08:14 AM | ||
Started by funk10101, Today, 08:14 AM
|
0 responses
1 view
0 likes
|
Last Post
by funk10101
Today, 08:14 AM
|
||
Started by adeelshahzad, Today, 03:54 AM
|
1 response
13 views
0 likes
|
Last Post Today, 08:12 AM | ||
Started by RookieTrader, Today, 07:41 AM
|
1 response
5 views
0 likes
|
Last Post Today, 07:59 AM | ||
Started by kujista, Today, 05:44 AM
|
1 response
9 views
0 likes
|
Last Post Today, 07:58 AM |
Comment