if( (MAX(High, 65)[0] - MIN(Low, 65)[0]) > 10)
{
WRFv = 1;
}
else
{
WRFv = 0;
}
WRF.Set(WRFv);
It basically plots a 1 if the stock has moved in a range of 10 within the last 65 days or a 0 if false.
I see this working correctly when I add the indicator on the chart. However I was getting some error messages about the OnBarUpdate so I added the following code at the beginning
if (CurrentBar < 65)
{
return;
}
However whit this change the indicator does not work in the market analyzer. Instead of the 0/1 values I get the Close price in my indicator colum and the log shows the following error: Error on calling 'OnBarUpdate' method
If I take the if (CurrentBar < 65) statement away I can see the correct values in the Market Analyzer but the indicator does not plot in the chart
What am I doing wrong?
Thanks
Comment