In the strategy i have in Onbarupdate() the following:
int ATR_zero = (int)(Math.Round(ATR(1)[0]/TickSize,1));
But if i code that into a custom indicator like this:
protected override void Initialize() { Overlay = false; Add(new Plot(Color.Lime, "AtrZero")); } protected override void OnBarUpdate() { int Range = (int)(Math.Round(ATR(Period)[0]/TickSize,1)); ATR_Zero.Set(Range); }
Then call this custom indicator in the Strategy with a Print function in OnBarUpdate():
Print(CustumIndicator(1).ATR_Zero[0]);
The result is completly different than the previous one
Print(ATR_zero);
Is there any rationale explantion??
Thanks
Chris
Comment