alpacahq / alpaca-trade-api-python

Python client for Alpaca's trade API
https://pypi.org/project/alpaca-trade-api/
Apache License 2.0
1.73k stars 534 forks source link

[Bug]: Cannot fill order for a short sale with a trailing stop #681

Open jus3q opened 1 year ago

jus3q commented 1 year ago

Is there an existing issue for this?

Current Behavior

Submitting a short sale on a stock with a trailing stop does not work

api.submit_order( symbol=‘SPY’, qty=1, side=‘sell’, type=‘trailing_stop’, trail_percent=4.0, time_in_force=‘day’, )

Expected Behavior

I expect the order to fill and the trailing stop to be above the current price.

SDK Version I encountered this issue in

v2

Steps To Reproduce

in juptyer notebook on web input and through vscode.

Filled out the Steps to Reproduce section?

Anything else?

no