I made 2 backtests
1- from 1-1-2019 to 1-1-2025
2- from 1-1-2020 to 1-1-2025
Backtest 2 (5years) show higher profits than backtest 1 (6 year) even the difference year 2019 ended with 22% profit, so it suppose backtest 1 start 2020 with 22% extra balance to deliver higher profits
Why this not happened?
Mia Alissi
Here’s why you see this behavior in QuantConnect:
In QuantConnect, every backtest is an isolated run:
Because every backtest starts fresh, cash, open positions, and profits from a previous run (like your 2019 +22% gain) are NOT carried over to the next backtest window. So your second backtest (2020–2025) starts at $100,000, not $122,000, unless you explicitly set_cash(122000) at the start.
That’s why the 2020–2025 backtest does not include the compounding effect of your 2019 results.
If you want continuous compounding across years, there are two ways:
Also remember: Segmenting like this removes all path-dependent effects (open trades, drawdown, exposure shifts, etc.), so split backtests may produce very different results compared to a single, uninterrupted run.
If you want your profits to build year-over-year, always use a single, continuous backtest for the whole period.
Sources: Getting Started - QuantConnect.com, Research Guide - QuantConnect.com, Estimize - QuantConnect.com, Results - QuantConnect.com, Dividend Algorithm
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 QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect 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. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
Sam H
this means every time I increase backtest period I will get lower results, even the added years was profitable, that is unbelievable and not acceptable
Sam H
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 QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect 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. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!