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 argusthome, Yesterday, 10:06 AM
|
0 responses
14 views
0 likes
|
Last Post
by argusthome
Yesterday, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
11 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
9 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
4 views
0 likes
|
Last Post
|
||
|
Started by Mindset, 02-28-2026, 06:16 AM
|
0 responses
31 views
0 likes
|
Last Post
by Mindset
02-28-2026, 06:16 AM
|

Comment