"Indicator 'Custom201010': Error on calling 'OnBarUpdate' method on bar 0: Index was outside the bounds of the array."
Here's a code part from OnBarUpdate:
protected override void OnBarUpdate()
{
double h0 = High[0];
double l0 = Low[0];
double c0 = Close[0];
double o0 = Open[0];
if(CurrentBar==0)
{
Value[0] = 0;
}
else
{
double h1 = High[1];
double l1 = Low[1];
Value[0] = (h0 <= h1 && l0 >= l1 ? 0 : h0 > h1 && l0 >= l1 ? 1 : h0 <= h1 && l0 < l1 ? 2 : h0 > h1 && l0 < l1 ? 3 : 4);
}
}

Comment