Support trailing stops

Trailing Stop - Beta Program

Finally, we are ready for a Beta program for the Trailing Stop. Please see the draft document here.

As of today, we plan to spend a couple of weeks doing a beta test for the Trailing Stop until the full launch. We are looking for 20-30 beta users for Trailing Stop.

If you are interested in this, please fill out your information in this google form so that we can invite you to the private Slack channel.

https://forms.gle/7k4n8xLUHqu7zpnHA

Trailing Stop on Alpaca is publicly launched now! https://alpaca.markets/blog/trailing-stop/

2 Likes

Hi Yoshi, nice Trailing Stop is a nice feature. I tried it today in Paper Trading with a short. It worked but not quite as I expected: here is what I got:

Trailing Stop Buy with trail price @ $4.25 and HWM $107.30
created at 09/24/2020 09:55 AM
filled ($109.84 each) @ 09/24/2020 01:32 PM

I would have expected it to get filled above $111.55. It was AAPL (it that helps). Any explanation?

@yoshi Thank you for implementing this! When I use execute the following code:

live_api.submit_order(symbol="SWKS", qty=1, side="sell", type="trailing_stop", time_in_force="gtc", trail_price="5.0")

I get the following error:

TypeError: submit_order() got an unexpected keyword argument ‘trail_price’

Any explanation? Thanks

I’m having trouble with this feature.

If I follow the example in the documentation https://alpaca.markets/docs/trading-on-alpaca/orders/ but via Python

api.submit_order(symbol='AMZN', qty=1, side="sell", type="trailing_stop", time_in_force="day", trail_percent=1)

I get the following error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: submit_order() got an unexpected keyword argument 'trail_percent'

I’ve messed around with switching the side and from trail_percent to trail_price and get the same error. If I remove the trail_percent or trail_price from the call it then tells me it’s required.

I’m sure this is user error, but any guidance would be helpful.

Thanks

I just had to update my alpaca. I used:

pip install -U alpaca-trade-api

Good luck everyone!

Fixed for me as well!

update your alpaca-trade-api with pip