Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
create trailing stop loss function

Dear all,

My goal is to create a trailing stop loss as I enter a trade. Meaning, every time prices move up, the stop loss moves up BUT not vice-versa.

I will try schedule a function which checks on a daily basis if the stop is reached or not and if so, sell the asset.

I'm a complete newby to python and Quantopian, so I don't know exactly how to tackle this problem.
Would you recommend creating a dictionary? Or do you have any other suggestions?

Thanks a lot!

BR,
Emanuel

2 responses

In the documentation look for check_positions_for_loss_or_profit function. That is a good starting point, then you can adapt it to your needs.