Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
My First Successful Algo!!!

So I have been spending a lot of free time creating algo's, but this one may be my best work...

Feel free to criticise and post improvements below! Thanks!

This strategy is based on MACD and Trends. If you don't understand the code, the algorithm buys SPXL (3x bull sp500) when MACD shows a bullish trend, (based on 0.30 histogram) and sells when the MACD falls off of its peak. It then proceeds to buy SPY and hold until the next Bull Flag.

ALGO has 1x leverage, 1x Dollar Usage, and a sharpe of >1

Enjoy working and improving this algo?

Also, what can I do to improve this algorithm? I have refined the hist and differences to produce max profits, but my fundamentals might be a little messed up.

1 response

Why don't you try turning this into a market neutral factor model (using the macd of individual stocks)? The performance is pretty good, but the amount of risk and leverage taken on would be too scary for a almost all investors as the strategy currently stands.

Another idea that instead of switching from SPY to SPXL abruptly, you instead lever up slowly and delever slowly. You can do this by adjusting weights between SPXL and SPY.