Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Quantopian Backtesting In Comparison to Reality

I just backtested a modification of Quantopian's sample algorithm with real world commission figures and posted 186k% returns over a five year period. How would this translate to real life? I find it hard to believe that such a simple algorithm could possibly generate such lavish returns. Am I missing an element beyond commission figures that would be apparent in live trading of such an algorithm?

3 responses

Hello Peter - if you share the backtest result, we'll be able to look at it more closely!

Two common things:

  • Buying Apple. Apple went up a lot over the last 4 years. If you did nothing but buy Apple, you made a lot of money. But that's obviously not a strategy that works in reality!
  • Outrageous leverage. One of the sample algorithms controls how much you can borrow, the other one lets you borrow without limit.

Dan

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.

Dan,

Are leverage computations built in to the API? Or is it as simple as checking an if statement to see if I'm beyond a set of bounds? I can't seem to find the example with leverage built in.

Peter

Hello Peter,

We don't have leverage built into the API yet. I agree that we need to build those tools - they're needed.

Here is the sample algo I was referring to: sample.

Here is the relevant code, edited for simplicity:

    context.max_notional = 1000000.1  
    context.min_notional = -1000000.0  
    if signal > 1 and notional > context.min_notional:  
        order(context.stock,-100)  
    elif signal < 1 and notional < context.max_notional:  
        order(context.stock,+100)