Tobby Liu

How long should a backtest be?

Quantitative Model


Hi all, i am new to algo-trading. 
So far I built an algo that seems to work for 1 year. 
How far should I backtest? The longer the better, or does it depend on the timeframe used? 
More guidance from the community will be helpful. 
Many thanks! 
 
Hiroki
Yes, just backtest all available data you have. 
 
Bumblebee
Original Posted by - b'Hiroki': Yes, just backtest all available data you have. 
Hi Hiroki, what you mentioned is not a proper way for backtesting!
To avoid overfitting, it is better to split the whole datasets into in-sample and out-of-sample. 
In-sample dataset is used to develop and optimize a trading algorithm, while out-of-sample is used to validate the trading performance. 
 
Tobby Liu
Original Posted by - b'Bumblebee': Hi Hiroki, what you mentioned is not a proper way for backtesting!
To avoid overfitting, it is better to split the whole datasets into in-sample and out-of-sample. 
In-sample dataset is used to develop and optimize a trading algorithm, while out-of-sample is used to validate the trading performance. 
I have a further question. 
Many stocks can have over 10 years of history, but crypto market usually have less than 5-year data. 
Does it mean that a crypto algo will be less "robust" for real trading? 

 
Bumblebee
Original Posted by - b'Tobby Liu':
I have a further question. 
Many stocks can have over 10 years of history, but crypto market usually have less than 5-year data. 
Does it mean that a crypto algo will be less "robust" for real trading? 

Hmmm ... may or may not. 
From statistical point of view, sampling error can be reduced by increasing the sample size. 
However for financial market, very old data may be irrelevant to the current situation due to structural market changes, 
 
Maurice Ng
Original Posted by - b'Bumblebee': Hmmm ... may or may not. 
From statistical point of view, sampling error can be reduced by increasing the sample size. 
However for financial market, very old data may be irrelevant to the current situation due to structural market changes, 
A good backtest should generally cover at least 1-2 financial cycles. 
The financial cycle for crypto is usually very short (within a few months), but for stock market, it may last for several years. 
Thus, I don't think there will be disadvantage for crypto algo.