Can't place trailing stop loss order

I have been trying to place trailing stop loss orders but I cant seem to do it. I can place other orders just fine, buy sell, stop loss.

Here is my code

api.submit_order(
symbol=‘AAPL’,
qty=1,
side=‘sell’,
type=‘trailing_stop’,
trail_percent=0.05,
time_in_force=‘gtc’,
)

and here is my error,


TypeError Traceback (most recent call last)
in
----> 1 api.submit_order(
2 symbol=‘AAPL’,
3 qty=1,
4 side=‘sell’,
5 type=‘trailing_stop’,

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

Whats wrong with my code? It’s taking from the alpaca api docs.

trail percent needs to be string