Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't create OCO #133

Open
AdoNunes opened this issue Feb 17, 2021 · 0 comments
Open

Can't create OCO #133

AdoNunes opened this issue Feb 17, 2021 · 0 comments
Labels
question Questions about use, potential features, or improvements

Comments

@AdoNunes
Copy link

I am having difficulties in creating an OCO leg order where one is a limit and the other is a stop limit.

The create_equity_order_leg does not accept order type and price, so I can not see where to add these arguments. Am I missing something or it is not implemented?

What I have right now:

from tdameritrade.orders import constants as td_const
from tdameritrade import orders
order_leg = orders.leg_builder.create_equity_order_leg(    
    instruction=td_const.Instruction.SELL,
    quantity=1,
    symbol='AA',
    # orderType=td_const.OrderType.LIMIT,
    # price="26"
    )

order_leg1 = orders.leg_builder.create_equity_order_leg(    
    instruction=td_const.Instruction.SELL,    
    quantity=1,
    symbol='AA',
    # orderType=td_const.OrderType.STOP,   
    # price="26"
    )

order_leg_collection = [order_leg,order_leg1]

order_mine = orders.order_builder.Order(
        session=td_const.Session.NORMAL,
        duration=td_const.Duration.DAY,        
        orderStrategyType=td_const.OrderStrategyType.OCO,
        orderLegCollection=order_leg_collection,
    )
@timkpaine timkpaine added the question Questions about use, potential features, or improvements label Sep 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Questions about use, potential features, or improvements
Projects
None yet
Development

No branches or pull requests

2 participants