Skip to content
This repository was archived by the owner on Mar 23, 2022. It is now read-only.

Is there an option for Bracket order with trailing stop? #99

Open
arighna opened this issue Oct 6, 2020 · 1 comment
Open

Is there an option for Bracket order with trailing stop? #99

arighna opened this issue Oct 6, 2020 · 1 comment

Comments

@arighna
Copy link

arighna commented Oct 6, 2020

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 
)

@shlomiku
Copy link
Contributor

shlomiku commented Oct 7, 2020

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants