ref: http://www.ninjatrader.com/support/h...rslookback.htm
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Accessing indicator plot data within a strategy
Collapse
X
-
By default, a DataSeries holds only 256 values: a Plot holds all values. You can make a DataSeries hold all values, either when you initialize it specifically, or you can make all the DataSeries in the indicator hold all values by using a directive (in reality, just setting an enum property of the class) in the Initialize() method.Originally posted by dynoweb View Post
ref: http://www.ninjatrader.com/support/h...rslookback.htm
Last edited by koganam; 01-18-2015, 03:00 PM.
-
Thanks koganam, adding MaximumBarsLookBack.Infinite to the strategy fixed the overwrite issue.
The second part of this still exists, which is if I only use the Plot, I have to access [0] plot instance before I can use [2] instance.
// Doesn't work when these next two lines are commented out
// if (FiveBarPattern().Plot1.ContainsValue(0))
// Print(Time + " 0 - FiveBarLower: " + FiveBarPattern().Plot1[0]);
if (FiveBarPattern().Plot1.ContainsValue(2))
Print(Time + " 2 - FiveBarLower: " + FiveBarPattern().Plot1[2]);
Why do I need to access element [0], is there a refresh that happens to element[2] when I try to read element[0]?
I have attached the sample strategy and the sample indicator which illustrates this problem. Look at the console out to see what I'm talking about with and without comments on those lines above.Attached Files
Comment
-
You will have to investigate your indicator. It is highly restricted, setting values only on a highly restrictive circumstance.Originally posted by dynoweb View PostThanks koganam, adding MaximumBarsLookBack.Infinite to the strategy fixed the overwrite issue.
The second part of this still exists, which is if I only use the Plot, I have to access [0] plot instance before I can use [2] instance.
// Doesn't work when these next two lines are commented out
// if (FiveBarPattern().Plot1.ContainsValue(0))
// Print(Time + " 0 - FiveBarLower: " + FiveBarPattern().Plot1[0]);
if (FiveBarPattern().Plot1.ContainsValue(2))
Print(Time + " 2 - FiveBarLower: " + FiveBarPattern().Plot1[2]);
Why do I need to access element [0], is there a refresh that happens to element[2] when I try to read element[0]?
I have attached the sample strategy and the sample indicator which illustrates this problem. Look at the console out to see what I'm talking about with and without comments on those lines above.
Are there any errors in your log?
Comment
-
Please try:Originally posted by dynoweb View PostThanks koganam, adding MaximumBarsLookBack.Infinite to the strategy fixed the overwrite issue.
The second part of this still exists, which is if I only use the Plot, I have to access [0] plot instance before I can use [2] instance.
// Doesn't work when these next two lines are commented out
// if (FiveBarPattern().Plot1.ContainsValue(0))
// Print(Time + " 0 - FiveBarLower: " + FiveBarPattern().Plot1[0]);
if (FiveBarPattern().Plot1.ContainsValue(2))
Print(Time + " 2 - FiveBarLower: " + FiveBarPattern().Plot1[2]);
Why do I need to access element [0], is there a refresh that happens to element[2] when I try to read element[0]?
I have attached the sample strategy and the sample indicator which illustrates this problem. Look at the console out to see what I'm talking about with and without comments on those lines above.
if (FiveBarPattern().Plot1.ContainsValue(2) && CurrentBar >= 2)
Print(Time + " 2 - FiveBarLower: " + FiveBarPattern().Plot1[2]);
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
672 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
379 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
111 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
575 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
582 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment