user-docs icon indicating copy to clipboard operation
user-docs copied to clipboard

Is there an option for Bracket order with trailing stop?

Open arighna opened this issue 4 years ago • 1 comments

I want to submit a bracket order with a take_profit and a trailing_stop percent. I could not find an option for trailing stop under bracket order. I was trying to use the combination of below 3 orders as a workaround. Could someone help me to validate the below orders or a standard bracket order with trailing stop if that’s possible at all!


buy_order = api.submit_order(
    symbol = ticker,
    qty    = qty,
    side   = 'buy',
    type   = 'market',
    time_in_force = 'day', 
    client_order_id = order_id, 
) 
api.submit_order(
    symbol = ticker,
    qty    = qty,
    side   = 'sell',
    type   = 'trailing_stop',
    trail_percent = 1, 
    time_in_force = 'day',
    order_class   = 'oco',
    client_order_id = order_id+1
) 
api.submit_order(
    symbol = ticker,
    qty    = qty,
    side   = 'sell',
    type   = 'limit',
    take_profit   = {'limit_price': symbol_price * 1.05}, 
    time_in_force = 'day',
    order_class   = 'oco',
    client_order_id = order_id+2 
)

arighna avatar Oct 06 '20 17:10 arighna

Hi, trailing stop order are not yet supported with bracket (or OCO or OTO) orders.

shlomiku avatar Oct 07 '20 06:10 shlomiku