Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Does quantopian have cover orders? Or how can we simulate them?

Hi,
So suppose there is an equity which is trading at 100.
I want to buy it at 102 with target of of 0.5% which would be 102 * 1.005= 102.51 and stoploss of 1% which would be 102*0.99= 100.98
and I want to sell it at 99 with target of 0.5%, 99 * 0.995 = 98.505 and stoploss of 1%, 99*1.01= 99.99

How do I simulate this on intraday level?

1 response

Basically I want to know if we can place three limit orders, all at once.
like one limit order for buying or selling at x price
Second order for stoploss
Third order for target

And after placing these orders, if the target order is executed, stoploss order should be cancelled and vise-versa if stoploss order is executed the target order should be cancelled.
Does quantopian has this inbuilt or do we have to track all the orders, and in handle_data check for price and place stoploss or target
order as per the price?