Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
How do I implement a stop loss?

Hi everybody,

I am trying to implement a stop loss to this strategy. However, after looking on the documentation and on the forum, I am still not quite sure how I should go about it.
Should I store the buy (and sell) price in a variable and then check manually every day if the current price has risen above or fallen under my stop loss? Or should I just use a StopOrder type of order? (if that's the case I don't know how I would implement it)

I need your advice, thank you in advance!
D

1 response

This post has an example with a trailing stop. It adresses an issue with stock splits and stops, which is the reason why I wouldn't recommend stop orders (in real life brokers often just cancel stop orders after splits).