Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
20 Day Simple Moving Average

I created a very simple algorithm:
- Buy when Price > SMA20
- Sell when Price < SMA20

It's my first algorithm with Quantopian. Do you all have any suggestions on how I can improve my code, or if there are errors in the way I implemented it? Also, what is the drawback of using a simple moving average as an indicator? This algorithm seems to not beat the market for a lot of stocks. Any feedback would be helpful!