I have an issue, we are sending a stop for our positions, but before going overnight, the strategy stops sending the order one bar before the SessionEnd to make sure we don't have a stop overnight.
But, it appears the stop doesn't cancel if we stop sending the stop order, it just stays there in ACCEPTED state.
This is true both in Sim101 and in IB.
I've made a simple strat to illustrate .
I'm running on EMD 09-10
protected override void OnBarUpdate()
{
if (CurrentBar < 10)
return;
if(Position.MarketPosition == MarketPosition.Flat)
EnterLong(1,"Enter L");
if (ToTime(Time[0]) < (173500))
{
ExitLongStop(0, false, 1, Close[0]-10 , "Stop L", "");
}
}
create chart EMD 09-10 30days 1minute bar
Replace in the strat 1735 with 1132
compile
insert strat in graph
look at the Accepted Stop order
Look at watch go past 11h32 and the stop order still present even though traceorders show that no new order is sent ....
Please advice

Comment