protected override void OnBarUpdate()
{
if (CurrentBar < FastEMAPeriod || CurrentBar < SlowEMAPeriod || BarsInProgress != 0)
return;
if (CurrentBar < Math.Max(BarsRequiredToTrade, BarsBefore + 1))
return;
if (CurrentBars[0] < 2) //Need more than 2 bars to trade
{
return;
}
if (BarsInProgress == 2) return;
and
else if (State == State.Configure)
{
Calculate = Calculate.OnBarClose; // OnBarClose OnEachTick
AddDataSeries(Data.BarsPeriodType.Tick, 1);
AddDataSeries(InstrumName, new BarsPeriod { BarsPeriodType = BarsPeriodType.Day, Value = 1 }, "CME US Index Futures RTH", false);
}

Comment