I'm using the SubmitOrder, Unmanaged = true; mechanism. But if my position changes from flat to long and if I have a SellShort limit order already in place, it cancels it automatically: "Cancelled pending entry order on opposite side of the market:" it says, because now my position is long and the order was created (created when my position was flat by the way) with SellShort action.
I just want to enter limit orders to go short or long and ignore what my position is. Meaning, if a short is hit, my overall position decreases by one--meaning, if I'm flat, I'm now 1 short. If I was 10 short, now I'm 11 short. If I was 10 long, now I'm 9 long. Why does it seem this is so hard to do programmatically? It works fine on the DOM.
At this point, it seems I have to track every one of my orders and manually convert them from SellShort to Sell anytime my position changes. Horrible nuisance, that.
Is there some way to submit orders more simply and ignore whether they are to open positions vs. closing positions?

Comment