Shorts can occur when shorts are disabled


I’ve run into a situation that can lead you into a short position even with shorts disabled on your account. It looks to be timing related and firing back to back orders quickly while having a non-short position in the stock in place 1st. Below may be steps to reproduce:

  1. open position x with 3 shares
  2. fire two immediate back to back market (or limits that will fill) orders to sell 3 shares of position x
  3. end up with a short position of -3 shares on position x

The expected behavior would be that the API checks for the on/off setting of allowing short positions and if the setting is off, it does not allow the 2nd order to go through.