I wrote the following code:
protected override void OnStateChange() { ... ... else if (State == State.Configure) { AddDataSeries(string.Format("{0}",this.Instrument), BarsPeriodType.Second, 10); nGestBar++; } } && protected override void OnBarUpdate() { if (CurrentBars[0] < (BarsRequiredToTrade+MaxBars)) return; Print(string.Format("BarsInProgress= {0} - Time[{0}] = {1}", BarsInProgress,Time[BarsInProgress])); if (BarsInProgress == nGestBar) { Print(string.Format("Time[{0}] = {1}", nGestBar,Time[nGestBar])); GestionTrade(nGestBar); } if (BarsInProgress != 0) return;
The output is :
BarsInProgress= 0 - Time[0] = 4/12/2018 01:00:00
BarsInProgress= 0 - Time[0] = 4/12/2018 01:05:00
BarsInProgress= 0 - Time[0] = 4/12/2018 01:10:00
BarsInProgress= 0 - Time[0] = 4/12/2018 01:15:00
BarsInProgress= 0 - Time[0] = 4/12/2018 01:20:00
BarsInProgress= 0 - Time[0] = 4/12/2018 01:25:00
BarsInProgress= 0 - Time[0] = 4/12/2018 01:30:00
BarsInProgress= 0 - Time[0] = 4/12/2018 01:35:00
BarsInProgress= 0 - Time[0] = 4/12/2018 01:40:00
BarsInProgress= 0 - Time[0] = 4/12/2018 01:45:00
BarsInProgress= 0 - Time[0] = 4/12/2018 01:50:00
What I'm doing wrong?
Thanks
Comment