double ask = GetCurrentAsk(); =5502
double bid = GetCurrentBid(); =5501.75
double currentPosition = Close[0]; =5500
I'm submitting an unmanaged market order to enter the market using ActiveOrder = SubmitOrderUnmanaged(0, OrderAction.Buy, OrderType.Market, OrderQuantity);
I check, and confirm, the average fill price is at the ask, 5502.
Then I submit an unmanaged stop loss order one point below my entry location at 5501.
stopLossOrder = SubmitOrderUnmanaged(0, OrderAction.Sell, OrderType.StopMarket, OrderQuantity, 0, 5501);
The problem is, the stop loss order is immediately being filled at the Close[0] value of 5500. Is this just a characteristic of order fill simulation in back testing or will this happen in real time as well? Shouldn't the bid/ask value have to come down to 5501 to trigger the stop loss order?

Comment