Imagine that you code a multi-time frame script, where you have added two Bars Object besides the serie 0 in a Range Bar chart.
protected override void Initialize()
{
Add("$EURUSD", PeriodType.Range, 13);
Add("$EURUSD", PeriodType.Range, 14);
CalculateOnBarClose = true;
}
protected override void OnBarUpdate()
{
if (BarsInProgress == 0 || BarsInProgress == 1 || BarsInProgress == 2)
{
// Analyze every Range Bar when an anynew bar comes and take a position according all analysis
}
}
So far, so good. The issue pops up in this case: imagine that the Algo now ONLY take positions according to Bars 0 analysis, BUT I let this command the same:
" if (BarsInProgress == 0 || BarsInProgress == 1 || BarsInProgress == 2) "
Allegedly you'd get the same final result as if the command would be:
" if (BarsInProgress == 0 ) "
but the final results are totally different. So, if I have set the method OnBarUpdate with OnBarClose=True, how's possible to get two different results, if I'm working allegedly with Bars 0?
I need to find why cause I have to do several combinations test, and I need a reliable behaviour.
Thanks
Comment