Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
ATR Zone (Support for multiple stocks)

Used David Edwards post on expanding a single stock algorithm to multiple stocks to add diversification to this strategy. If you want to use 1x leverage just change the 2.0 in the code to 1.0.

2 responses

I'm glad you found this useful Abel, it's a pretty pretty powerful method to get multiple strategies or support for multiple stocks all into one algorithm. There are some drawbacks, the biggest one would have to be that it uses serial calculations, if there's a way to calculate the results for each stock in parallel (I'm sure there is), this would be even better.

This also makes it easy to pass different parameters to each stock, here's an example. It also uses minute data.

David

I found the solution elegant, rather than having to change the code a lot to support a list of stocks just move the strategy to a class