I looked at the log and it says error calling 'onbarupdate' method for bar 3 is out of range. If I substitute the PeriodType.Day to PeriodType.Minute it works ok for minute vut not for day. I think the answer is in the
{if (CurrentBar <3)
return;}
It doesn't matter what I set this to the result is the same, it eh index value is out of range. Any ideas on this one? I have never had problems with this before but when using a PeriodType.Day it doesn't seem to work.
Thanks
DJ
Code:
protected override void Initialize()
{
Add(PeriodType.Day,5);
}
protected override void OnBarUpdate()
{
{if (CurrentBar <3)
return;}
if (BarsInProgress == 1)
return;
{
DrawTextFixed("shortpivot1","ATR %: "+ATR(BarsArray[1], 5)[0].ToString("N1"), tPosition,Color.White,textFontMed, Color.Black, Color.Red, 10);
}

Comment