I set this strategy up for symbols ZT and ZF for CME US index RTH, and when enabled both symbols triggered orders instantly 40 minutes before the open, and then the strat was auto disabled. I received this message:
Enabling NinjaScript strategy 'EC05ATRBreakout/288695454' : On starting a real-time strategy - StartBehavior=WaitUntilFlat EntryHandling=All entries EntriesPerDirection=1 StopTargetHandling=Per entry execution ErrorHandling=Stop strategy, cancel orders, close positions ExitOnSessionClose=True / triggering 30 seconds before close SetOrderQuantityBy=Strategy ConnectionLossHandling=Recalculate DisconnectDelaySeconds=10 CancelEntriesOnStrategyDisable=False CancelExitsOnStrategyDisable=False Calculate=On bar close IsUnmanaged=False MaxRestarts=4 in 5 minutes
NinjaScript strategy 'EC05ATRBreakout/288695454' submitting order
Disabling NinjaScript strategy 'EC05ATRBreakout/288695454'​
Any ideas?
here's the script:
AtrMult = 1;
AtrPeriod = 15;
}
else if (State == State.Configure)
{
}
else if (State == State.DataLoaded)
{
ATR1 = ATR(Close, Convert.ToInt32(AtrPeriod));
ATR1.Plots[0].Brush = Brushes.DarkCyan;
AddChartIndicator(ATR1);
}
}
protected override void OnBarUpdate()
{
if (BarsInProgress != 0)
return;
if (CurrentBars[0] < 1)
return;
EnterLongStopMarket(Convert.ToInt32(DefaultQuantit y), (Close[0] + ((ATR1[0] * AtrMult) )) , "");
EnterShortStopMarket(Convert.ToInt32(DefaultQuanti ty), (Close[0] - ((ATR1[0] * AtrMult) )) , "");
}
​
Comment