Back to Community
Why my backtest is so different from yours?

The algorithm is the same. This is my backtest for the last 2 years.

Loading notebook preview...
Notebook previews are currently unavailable.
5 responses

This is your backtest. Hope for your reply.

Loading notebook preview...
Notebook previews are currently unavailable.

I'd check your commissions and slippage in your first backtest. That seems to be the usual suspect with this kind of problem.
If you don't have any stated commission which will look like the following.

set_commission(commission.PerShare(cost=0.000, min_trade_cost=0))  

Then your using Quantopian's default slippage model which I think is 0.001 per share with a $0 minimum cost per order.

The first backtest (ID 5d4751f7ddf49b626ff01028) was run as a full backtest in the user's account. It uses any commission and/or slippage models which are set in the code (eg set_commission(commission.PerShare(cost=0.000, min_trade_cost=0)) . The results are based upon those models.

The second backtest (ID 5d4716b08771d5657da5b623) was submitted and run as a contest entry. Contest entries are required to use the default commission and slippage models. If these are specified differently in the code, then the code is disregarded and the defaults are used.

It appears the difference between the two is the commission and/or slippage models. The later uses the defaults.

This is a good example of how some algos can be very sensitive to these parameters.

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.

Something that may work to improve results with commissions is to decrease your turnover. The top tearsheet is showing 200%+ turnover which is pretty high. If your strategy allows you to cap your daily turnover then doing so could help with the after commission performance.

Dan and Spencer, thank you for your explanation.I increased the rebalancing period and set the slippage and commissions to default.

for i in range(0,22,10):  
    algo.schedule_function(  
    trade,  
    algo.date_rules.month_start(days_offset=i),  
    algo.time_rules.market_open(),  
       )  
Loading notebook preview...
Notebook previews are currently unavailable.