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.
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.
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