double close = Close[1];
protected override void OnBarUpdate() { if (CurrentBar < BarsRequiredToTrade) return; double close = Close[1]; if (CrossAbove(smaFast, smaSlow, 1)) EnterLong(); else if (CrossBelow(smaFast, smaSlow, 1)) EnterShort(); }
Set "TickReplay" to true, "Order Fill Resolution" to High and his "Type" to Tick.
After the first execution, everything seems normal, but after the second time we have an Exception and broken tick history.
at NinjaTrader.Data.BarsSeries.GetTime(Int32 index)
at NinjaTrader.Data.Bars.GetTime(Int32 index)
at NinjaTrader.NinjaScript.NinjaScriptBase.Update(Int 32 idx, Int32 bip)
at NinjaTrader.NinjaScript.NinjaScriptBase.<>c__Displ ayClass447_2.<TickReplayOrUpdate>b__2(Object s, BarsUpdateEventArgs o)
at NinjaTrader.Data.BarsSeries.Add(Bars bars, Double open, Double high, Double low, Double close, DateTime time, Int64 volume, Double tickSize, Boolean isBar, Double bid, Double ask)
Comment