Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Mean Reversion Template with B Bands

Line 43: The history method is deprecated. Use data.history instead.
Line 75: Iterating over the assets in data is deprecated.
Line 50: data[sid(N)] is deprecated. Use data.current.
Line 52: data[sid(N)] is deprecated. Use data.current.
Line 52: The stddev method is deprecated.

If someone corrects these errors, can you please comment the old code so I can compare and learn? Thank you

Working through iterations, any assistance to speed up the learning curve would be appreciated:

  1. How to improve [order fill rates] because slippage assumption here is not realistic?

  2. Why trade only once every 20 days? Can this be changed to continuous time based on price v. B Band plots? (Or am I not reading correctly)

  3. Implement a Stop & Reverse overlay to BBands? Perhaps with a ama/ema/sma xover that can have variables adjusted manually (dynamically via pipeline)?

  4. Change from single stock to context.stocks so algo is (e.g.) ranking and trading highest momo stocks in Q500 based on [any momo indicator from TA-lib]?

  5. Use pipeline to continuously optimize context.stocks (and indicators from TA-lib) for multi-factor dynamic optimization? Is this possible?