When calling an indicator from a strategy, if I need to access the indicator value for all bars on the chart, do I need to do anything special? I am asking on reference to lookback 256 vs. Infinite setting.
I am doing this for the ZigZag indicator. So I basically have a strategy that calls my custom indicator and my indicator makes use of the zigzag indicator.
Within my indicator I have the following:
int z = 1;
ZigZag zig = ZigZag(DeviationType.Percent, z, false);
int zzLowBar = zig.LowBar(0, 1, CurrentBar);
this returns -1 when a low bar can't be found. Looking at the chart visually, I can see that there is a zigzag low only it is many bars back.
Also, it appears that when I load my study on the chart, the LowBar returns correct values.
Any ideas what I could be doing wrong?
Onn

Comment