alpacahq / alpaca-py

The Official Python SDK for Alpaca API
https://alpaca.markets/sdks/python/getting_started.html
Apache License 2.0
491 stars 119 forks source link

[Bug]: Stock Split Updates are not handled in bracket orders #469

Open eric-stanley opened 3 weeks ago

eric-stanley commented 3 weeks ago

Is there an existing issue for this?

Current Behavior

When I make a bracket order of NVDA stock with the below options

**1. Order type as 'BUY'

  1. Market Buy amount as $1190.00
  2. Limit Sell amount as $1210.00
  3. Stop loss as $1185.00
  4. For 5 shares**

And when the stock split happens during off-hours or weekends (assuming 1:10 split)

The order is not updated fully updated and only the share counts are updated as below

**1. Order type as 'BUY'

  1. Market Buy amount as $1190.00
  2. Limit Sell amount as $1210.00
  3. Stop loss as $1185.00
  4. For 50 shares**

Which results in selling 5 shares when the market opens at $119.5 (assuming that the price before split was $1195 when the market opened) as the stop loss condition has met

Expected Behavior

I would expect my conditions as well to get updated along with the stock split numbers as below (assuming 1:10 split)

**1. Order type as 'BUY'

  1. Market Buy amount as $119.00
  2. Limit Sell amount as $121.00
  3. Stop loss as $118.50
  4. For 50 shares**

SDK Version I encountered this issue in

0.23.0

Steps To Reproduce

1. Place a bracket order for XX stock with order type as 'BUY' along with limit sell and stop loss
2. Wait for the stock to get split (either +ve or -ve)
3. The limit sell and stop loss amounts has to be updated along with the number of shares

Filled out the Steps to Reproduce section?

Anything else?

Tested in live market

hiohiohio commented 3 weeks ago

@eric-stanley Thank you for the report. Seems this issue is not in scope of alpaca-py. Could you please contact to support? ref. https://alpaca.markets/support