I have the following custom method:
privatebool IsTrough(IDataSeries price, int endBarsAgo)
{
if (CurrentBar - endBarsAgo < 2)
returnfalse;
if (price[endBarsAgo + 1] < price[endBarsAgo])
{
for (int i = 2; i <= CurrentBar - endBarsAgo; i++)
{
if (price[endBarsAgo + i] == price[endBarsAgo + 1])
continue;
elseif (price[endBarsAgo + i] > price[endBarsAgo + 1])
returntrue;
elseif (price[endBarsAgo + i] < price[endBarsAgo + 1])
returnfalse;
}
}
returnfalse;
}
When I run MRO(delegate{return IsTrough(lPrice, 0);}, 1, CurrentBar) sometimes I get the error message in the title of this thread.
Do you know what am I doing wrong?
Thanks in advance,
Stopped
Comment