protected override void OnBarUpdate()
{
// Exit Short Trade
if (BarsSinceEntry() > 5)
{
ExitShort(Position.Quantity)
}
// Enter Short Trade
...
}
During live trading, most of the time, the strategy will successfully close my one remaining short contract after 5 bars since entry.
However, sometimes it doesn't. The strategy leaves the one remaining short contract open without closing it after 5 bars since entry. There's plenty of volume in emini ES. I see no errors in Log. The strategy should successfully close my one remaining short contract.
During simulation, it always closes the remaining short contract. I've been unable to reproduce the problem in simulation.
What should I be looking for?
Comment