Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Average Reversion : why my algorithm is so " good " ?

Hello evryone, i'm new to quantopian. Today i try to code a simple mean reversion by inspiring myself with the one of the tutorial and it surprised me when i saw that this algorithm made near 50% returns.

Please this post is fully humble and i just want to learn about my mistakes because i choose quantopian to present my school project on algotrading. So do not misunderstand it as it could have a lot of simples mistakes and i'm not already fully comfortable with the API.

That i want to know is what parameters i've forgotten to consider because i guess this rates of returns is totally unrealistic or maybe I do not get the numbers of that algo.

PS : sorry for mistakes, i try to bettering my english too.

Thanks

3 responses

It is pretty close to correct. With the 15% margin, returns in relation to the amount invested are 95% rather than 109%. The three stocks traded all did well.

Couple of things to think about, including style which is of course personal preference yet some is for efficiency, 's' instead of securities is quicker in the debugger for instance, we tend to grow accustomed to such abbreviations very quickly.

A way to avoid margin and it results in a 60% profit increase. Since there is virtually no margin, the returns curve is profit-for-real rather than owed to the broker in part.

The original was 95% because 15% was owed to the broker. This is 155% and it's all yours to keep. ($1.5 million)

Thanks for your replies guys, it helps me a lot !

I will explain all those factors in my presentation. For my next algo i will use pipeline, so i guess it will prevent "hard-coding" better than choosing some random securities (like Apple etc...)

Just a last clarification to conclude :

How can i precisely confront my algo with the market ? I mean what metrics do i need to look ? I don't really understand benchmark returns and benchmark spy. That said, i think Thor Andersen your comparison of a simple buy and hold strategy and an other is quite correct to identify efficient markets.