On to the error:
...OnBarUpdate()
{[INDENT]if (CurrentBar < 1)[INDENT]return;[/INDENT]
...
if (IsFirstTickOfBar)
{[INDENT]if (CurrentBar < Period)
{[INDENT](collection building stuff)
return;[/INDENT]
}
...
double priceChange = Close[1] - Open[Period]; ----Out of range exception: ''barsAgo' needed to be...'
...[/INDENT]
}
...[/INDENT]
}
if (CurrentBar < nnn)
Does anybody know how this CurrentBar thing is happening? I notice, also, the built-in indicator, BuySellVolume, uses a "trick" for approximating whether OnBarUpdate is on the first tick:
if (CurrentBar != activeBar)
{[INDENT]...
activeBar = CurrentBar;[/INDENT]
}
Thanks in advance,
Caleb

Comment