The orderType for stop order changes to LIMIT (in case of SL orders) or MARKET (in case of SL-M orders) when they gets filled. This behavior, it seems, originates at OMS level itself as the same behavior is witnessed in NestTrader also. Is this expected?
Yes, You are correct. Here how it works, when you place a SL-M or SL order, this orders will stay within the OMS and not sent to exch where as LIMIT & MARKET Order are sent immediately to exch and exch will allot the Exch Order Number.
With SL-M or SL, OMS will keep on checking for trigger level break, Once triggered then only OMS will route the that order to Exch as LIMIT (SL) or MARKET (SL-M) and exch will allot exch Order Number.
Exch only knows LIMIT and MARKET Order. Exch doesn't know how many SL or SL-M is pending with the Broker OMS.
One more scenario:- Assume you placed a stoploss Sell Order For your Existing Long Positions. After some time, Broker OMS goes down for some technical reason. Same time your stock prices goes below your stop level. You will think that I have already placed stoploss order,So no problem. But in real your stoploss order is with the OMS only and oms is not routed that order to exch as it is already down. You end up in keeping your long positions open
If the OMS goes kaput and while fetching the orders from the exchange on reconnection, it has no way to know the actual orderState since the exchange does not supports sl orders. that makes sense. and unfortunately this is the same scenario I am facing
Yes, You are correct.
Here how it works,
when you place a SL-M or SL order, this orders will stay within the OMS and not sent to exch where as LIMIT & MARKET Order are sent immediately to exch and exch will allot the Exch Order Number.
With SL-M or SL, OMS will keep on checking for trigger level break, Once triggered then only OMS will route the that order to Exch as LIMIT (SL) or MARKET (SL-M) and exch will allot exch Order Number.
Exch only knows LIMIT and MARKET Order. Exch doesn't know how many SL or SL-M is pending with the Broker OMS.
One more scenario:-
Assume you placed a stoploss Sell Order For your Existing Long Positions.
After some time, Broker OMS goes down for some technical reason.
Same time your stock prices goes below your stop level.
You will think that I have already placed stoploss order,So no problem.
But in real your stoploss order is with the OMS only and oms is not routed that order to exch as it is already down.
You end up in keeping your long positions open
If the OMS goes kaput and while fetching the orders from the exchange on reconnection, it has no way to know the actual orderState since the exchange does not supports sl orders. that makes sense. and unfortunately this is the same scenario I am facing
Yes, thats the peril of all simulated orders.