This article introduces manual backtesting and does not cover quantitative backtesting. The accompanying picture captures the backtest performance of one of my medium- and long-term trading strategies in the past three years for reference only.
1. What is backtesting?
A complete set of trading strategies is simulated in a historical market to obtain various parameters of the trading strategy and the capital curve during this period. The data obtained by backtesting is the upper limit of the trading strategy performance after excluding the influence of factors such as mentality, execution, and environment. If any other factors are added, the performance will be reduced.
It can also be understood that only when the mentality, execution and environment are done to the best of one's ability can the performance of the trading strategy during the backtest be close to that during the backtest. Therefore, comparing the backtest yield rate with the actual yield rate can indirectly reflect the influence of factors such as mentality and execution.
2. Why backtest?
Through backtesting, we can get the performance of the trading system in the past period of time. This performance includes different parameters according to the characteristics of the trading system, including trading time, trading direction, entry point, exit point, stop loss setting, single risk, income, profit and loss ratio, total profit and loss and other basic parameters. If the record is more detailed, it can also include the details of the entry and exit conditions, the market environment when it occurs, etc.
By analyzing these data, the following three objectives can be achieved:
1. Understand the upper limit of the performance of the trading strategy over a period of time.
2. Adjust parameters and optimize strategies.
3. Build confidence in trading strategies through real data and solve mentality problems during execution.
3. How to backtest?
Backtesting is very simple. As long as you can find historical data, you can find trading conditions within the corresponding time period according to the conditions specified in the trading strategy. However, this process is very time-consuming and labor-intensive to perform manually.
However, when trading strategies are first designed, the initial values are set based on experience or theory. The initial values must be backtested for a long enough period of time before they can be gradually optimized.
Every parameter in the trading strategy is the crystallization of the traders' hard work. For example, why was the stop profit changed from 3 times ATR to 2.5 times ATR? It may be that after backtesting 20 years of trading data, it was found that the long-term performance of the latter was far better than the former, so it was adjusted to 2.5 ATR. If there is no backtesting, there is no way to make this adjustment.
So the backtesting method is not difficult, it is to record, analyze and adjust the parameters of each transaction according to the historical market. What really tests the quality of the trader's persistence day after day.
4. Backtesting Notes
1. After all, backtesting is not real trading, and the future market trend is unknown in real trading. However, in backtesting, the subsequent trend is determined. At this time, it is difficult to pretend that you don’t know the subsequent market and judge whether to enter the market without being affected. It is very likely that you will find more reasons to enter the market for the market that has come out, and find more reasons not to enter the market for the market that has not come out.
Therefore, it is best to cover the subsequent market conditions during backtesting, or use the backtesting function of the market viewing tool to replay the market conditions. Try to judge the trading conditions as accurately as possible. This is the key to ensuring the objectivity of the backtesting data.
2. The backtesting time should be long enough, at least two rounds of bull and bear market, to basically determine the average performance of the strategy. This is also very important. Most trading strategies are only trying to capture a certain type of market conditions. Some perform well in trending markets, but will experience continuous stop losses in volatile markets. On the contrary, some strategies are suitable for volatile markets, but will suffer losses in trending markets.
Therefore, in order to make the backtest market cover as many trends as possible, it is necessary to extend the time as much as possible. But it is not infinitely long, after all, backtesting is very energy-consuming. It is enough to experience two rounds of bull and bear cycles to illustrate the problem.