Shares sold > shares bought

Hi,

I ran into a rather unusual situation today in paper trading:

  1. I bought 14 shares of one symbol.
  2. I submitted an OCO order to exit this position:
    take profit order id: 15de4378-49ee-4ba7-b9ff-bbc45bb65dff
    stop-loss order id: 52b1062a-0fa6-4bc9-8bd6-71e15cb987d8
  3. The stop-loss order was executed through several partial fills. At the end, 16 shares were sold, instead of 14!

I understand part of the problem: my code submitted a replacement order for the stop-loss order. The replacement order id is: cdea8f84-c16a-462f-ac31-95f31a53ebee
This replacement order was submitted when a partial fill of the exit order was being executed. Specifically, when Account Activity #2 (below) was executed.

What I don’t understand is

  1. why did the subsequent activities (3, 4, and 5) fail to account for the 2 shares sold under Activity #2?
  2. Did the system open a short position (by selling 2 additional shares) from a stop-loss order?
  3. What happened later? I can find no indication that the short position, if it ever existed, was liquidated (I liquidate my positions at the end of the day), and there are no positions listed under my account.
  4. If the activities don’t reflect what actually happen, then what happened? (how many shares were sold, at what price, at what time…)

Thanks!

  1. AccountActivity({ ‘activity_type’: ‘FILL’,
    ‘cum_qty’: ‘4’,
    ‘id’: ‘20231201104203861::cf2edca5-4a6c-446d-adb5-fdf7798fff22’,
    ‘leaves_qty’: ‘10’,
    ‘order_id’: ‘52b1062a-0fa6-4bc9-8bd6-71e15cb987d8’,
    ‘order_status’: ‘partially_filled’,
    ‘price’: ‘28’,
    ‘qty’: ‘4’,
    ‘side’: ‘sell’,
    ‘symbol’: ‘SPR’,
    ‘transaction_time’: ‘2023-12-01T15:42:03.861999Z’,
    ‘type’: ‘partial_fill’})

  2. AccountActivity({ ‘activity_type’: ‘FILL’,
    ‘cum_qty’: ‘6’,
    ‘id’: ‘20231201104204901::26bf3ac6-7e5f-42ad-996c-a96d138f11d6’,
    ‘leaves_qty’: ‘8’,
    ‘order_id’: ‘52b1062a-0fa6-4bc9-8bd6-71e15cb987d8’,
    ‘order_status’: ‘partially_filled’,
    ‘price’: ‘27.99’,
    ‘qty’: ‘2’,
    ‘side’: ‘sell’,
    ‘symbol’: ‘SPR’,
    ‘transaction_time’: ‘2023-12-01T15:42:04.901551Z’,
    ‘type’: ‘partial_fill’})

  3. AccountActivity({ ‘activity_type’: ‘FILL’,
    ‘cum_qty’: ‘8’,
    ‘id’: ‘20231201104205200::fd4628f8-c92a-4e85-8ae6-3a5f7ee05129’,
    ‘leaves_qty’: ‘6’,
    ‘order_id’: ‘cdea8f84-c16a-462f-ac31-95f31a53ebee’,
    ‘order_status’: ‘partially_filled’,
    ‘price’: ‘27.99’,
    ‘qty’: ‘4’,
    ‘side’: ‘sell’,
    ‘symbol’: ‘SPR’,
    ‘transaction_time’: ‘2023-12-01T15:42:05.200647Z’,
    ‘type’: ‘partial_fill’})

  4. AccountActivity({ ‘activity_type’: ‘FILL’,
    ‘cum_qty’: ‘13’,
    ‘id’: ‘20231201104206075::d0494f73-2dcf-45f7-a051-107a129d5ff4’,
    ‘leaves_qty’: ‘1’,
    ‘order_id’: ‘cdea8f84-c16a-462f-ac31-95f31a53ebee’,
    ‘order_status’: ‘partially_filled’,
    ‘price’: ‘27.99’,
    ‘qty’: ‘5’,
    ‘side’: ‘sell’,
    ‘symbol’: ‘SPR’,
    ‘transaction_time’: ‘2023-12-01T15:42:06.075387Z’,
    ‘type’: ‘partial_fill’})

  5. AccountActivity({ ‘activity_type’: ‘FILL’,
    ‘cum_qty’: ‘14’,
    ‘id’: ‘20231201104206779::c2463e17-900e-4766-ae5a-fb4ab9f575f7’,
    ‘leaves_qty’: ‘0’,
    ‘order_id’: ‘cdea8f84-c16a-462f-ac31-95f31a53ebee’,
    ‘order_status’: ‘filled’,
    ‘price’: ‘27.99’,
    ‘qty’: ‘1’,
    ‘side’: ‘sell’,
    ‘symbol’: ‘SPR’,
    ‘transaction_time’: ‘2023-12-01T15:42:06.77904Z’,
    ‘type’: ‘fill’})]