Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Stop Loss and Take Profit

Hi this is something I do have workarounds for, but I feel like it could protect algorithms better if this was provided implicitly by Q.

One way to do it is I would set a limit order at my take profit, and a stop order at my stop loss. I would manually cancel the other order if one of them was executed on the next handle_data event. However, it's possible that both orders could be triggered inside the same minute depending on volatility.

The way I settled with is to monitor the price myself, and place the order when the price target is reached. However, that means I could miss some important prices.

1 response

No doubt Q will be implementing OCAs which will solve your problem.

IB's OCA order type

I'm curious, are you (or is anyone) trying to day trade here? I can imagine trying to scalp a few cents by providing a narrow bracket order pair but certainly not using minutely data. Even using IB's pulsed quotes makes it challenging to trade this way when one is running a true real time system. Somehow I had assumed that systems trading here were generally of a swing type or long term investors and their monthly/quarterly rebalancing. And that tight stops and tight profits would be problematic in implementation on a platform with limited control and 60 seconds between execution opportunities. But who am I to point out such a quandary when you are actually doing it and getting it done.