Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Please Is my Backtest good And Ready For Contest ?

Hello. I am new on Quantopian, is it a good Backtest ?

4 responses

Please, is 15309,24% A good performance ?

Hi Ryan,

That all depends what you compare it to. Since your strategy only trades Apple, the benchmark to beat is probably Apple as well.

For this one, it looks like your strategy only buys Apple (the 'else' statement never gets triggered), so the strategy's performance is almost the same as its 'long only' benchmark (see attached where I set the benchmark to be Apple).

Also, we all know that Apple (and other FAANG) stocks have performed exceptionally well during the period of the backtest. This is called 'lookahead bias' and something you'd want to avoid when designing a good strategy. Since we have a 'perfect vision' of the past, it's pretty easy to create a strategy that just buys all the stocks that have gone up the most, and sell the ones that have gone down the most. What's more difficult is to design a strategy that continues to perform well in the future as well, especially if we want to account for various risk exposures.

If you want to build a good Contest algo, I'd recommend going through Tutorial 6: Writing a Contest Algorithm. which guides you through all the requirements. Good luck!

I think your code might have some logic errors:

Namely:

   if context.Montant > context.DernierMontant or context.Tour == 0:  

You set context.Tour to 0 right at the beginning of your algorithm, then you never update it to any other value. This means that this 'if' statement is always true. The other problem with this line is that context.DernierMontant is always 0, so the only time both statements in the 'if' are not true is if Apple's stock price goes below 0. Either way, as Joakim pointed out, the algorithm is only ever going to buy AAPL.

@Ryan: En addition de la commentaire de QuantTrader, il y a 8 critères que votre algorithme doit passer avant de pouvoir participer au Contest. Les critères sont listés ici. Aussi, si tu exécutes un "full backtest", l'écran affichera des coches pour chacun des critères. Il faut passer tous dans un backtest au cours des 2 dernières années avant de soumettre au Contest. Le tutorial num. 6, Writing a Contest Algorithm, peut t'aider aussi.

Disclaimer

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by Quantopian. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. No information contained herein should be regarded as a suggestion to engage in or refrain from any investment-related course of action as none of Quantopian nor any of its affiliates is undertaking to provide investment advice, act as an adviser to any plan or entity subject to the Employee Retirement Income Security Act of 1974, as amended, individual retirement account or individual retirement annuity, or give advice in a fiduciary capacity with respect to the materials presented herein. If you are an individual retirement or other investor, contact your financial advisor or other fiduciary unrelated to Quantopian about whether any given investment idea, strategy, product or service described herein may be appropriate for your circumstances. All investments involve risk, including loss of principal. Quantopian makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances.