Let’s say that I own 1 share of SPY, and I enter a limit order to SELL 1 share of SPY above the ask.
Then I enter another order to SELL 1 share of SPY at a limit price above the limit price of the first order. Will that order be rejected? Will your system consider both orders as exits, or might it treat the second one as an enter (sell-short).
The second sell order would be rejected with an error something like this APIError: insufficient qty available for order (requested: 1, available: 0). If one has an open long position, there cannot be ‘sell’ orders for more than the shares held.