Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Does this make any sense?

Hi, new to Quantopian, really loving how easy it is to create trading algorithms, and hoping I can get an algorithm funded, but who knows. So I made a very basic MA algorithm and ran it from the 08' to 18', and got a return of about 1100%, does that sound right? I ran another backtest that starts before the Financial Crisis (FC) leading to the present, and somehow the algorithm kept losses to less than 5% during the worst of the FC, is there something I'm not accounting for, because if I can gain so much from just a simple algorithm like this I'm just going to leave a chunk of my investments running on this algorithm and should profit a ton, right?

2 responses

First off, welcome aboard!

The strategy posted above simply invests in AAPL and does a bit of market timing. So, rather than compare it to the benchmark SPY it's fairer to compare with a benchmark of simply holding AAPL. Place the following in the 'initialize' method.

    set_benchmark(context.security1)

The returns of the algorithm aren't much different than simply buying and holding AAPL. Run the backtest starting at different dates and sometimes the algo performs a bit better than the benchmark and sometimes a bit poorer.

Moreover, the biggest reason the algo performs well is because AAPL performed well over those years. Try this with a different stock, perhaps IBM, and the results are much different.

In any case, one typically wouldn't want to "leave a chunk" of one's investment in any single stock. Conventional wisdom varies but the max concentration you may want to look at is between 2-10%.

The real gold mine would be to find an algorithm which would have picked AAPL 10 years ago and told you to hold it.

Good luck.

Ok yeah i had a feeling that something was off, when I used my algorithm with the legit SPY, the results were much more of what I expecterd, definitely need to make the algorithm more diversified if I want to do even better on the next iteration, thanks for the pointers!