Bracket Order - "valid" parameter
Hello, I'm trying to simulate a buy stop and sell stop trade, I am currently opening a buy bracket order where the main orders exectype is a Stop Order at a price above the current market price, everything is working as expected until I set the "valid" parameter to expire the bracket order after 30 minutes if the price isn't reached, the problem I'm seeing is that the main order gets expired after 30 minutes even after the main orders stop price is hit, is this the intended functionality? My goal is to issue a buy stop order that has an expiry time but if the price is reached I don't want to expire the tp/sl orders that were set during the creation of the bracket order.. any ideas?
Robin Dhillon last edited by
Issue the orders manually, gives more control over the orders sent. Try using the parent-child orders. It would be better if you could post a snippet of the code, for further analysis. Try reading the bracket order documention for manually issuing them.
sell_bracketmethods contain the parameters
stopargs, which are dictionaries intended to supply specific value for the corresponding orders. You can specify
validfor each, both or none of them. And you can use
kwargsto affect all of them.
See: Docs - Strategy