Does the concept of ChartBars.ToIndex and ChartBars.FromIndex can be used in OnBarUpdate? If not how do we replace them?
I am looking for a certain amount of volume in the past using a for loop.
for(int barIndex = index; barIndex <= ChartBars.FromIndex; barIndex--)
{
sumOfVolumes4 += Bars.GetVolume(barIndex);
if (sumOfVolumes4 >= sumvolfibo)
{
foundIndex = barIndex;
break;
Print("FI" + foundIndex);
}
}
The loop is working OnRender but not OBU.
Also cant Print CurrentBar or Close[0] it return the wrong number.
Any pointers?
Ty
Comment