Current location - Trademark Inquiry Complete Network - Futures platform - How to avoid over-fitting of trading system in futures trading?
How to avoid over-fitting of trading system in futures trading?
What is "over-fitting" in futures trading?

Give a quantitative example. You set up a futures trading system, and you need to conduct a historical test.

There is a parameter in your trading system. What are parameters? For example, the breakthrough of turtle trading rules opened positions at the highest point on the 20th. This 20 is the parameter.

Why choose 20? Why not choose 2 1, 34, 15 or 28?

This is called parameter selection.

The so-called over-fitting means that you use this strategy. After historical back-testing, you find that if I change the parameter to 24, then my system has the highest income in the past trend.

So, I will use 24. In my trading system, all parameters should be selected with the best historical performance. This is perfect.

What are the disadvantages of doing so? Because its effect is the best in the historical trend, but the best in the historical trend does not mean that the future will be better. Maybe you come back to test a year later and find that the best parameter now is 32. Because the trend of the coming year has been integrated into history and changed history.

And if you over-fit a historical test result, for example, you find that you trade rebar futures with 654.38+00,000 yuan, your maximum withdrawal is only 654.38+00,000 yuan, and your maximum loss is only 5 times. So, you designed your own position based on this optimized data.

And the result? In the future market trend, this parameter is suddenly not as good as expected, and the rhythm has changed, resulting in your direct loss to the liquidation line.

This is the danger of over-optimization.

In fact, futures traders who can go to the step of parameter optimization generally do not explode their positions. The biggest risk is that the loss exceeds expectations, which will lead to a series of setbacks in confidence and wavering in will.

Many futures traders will optimize the parameters of the system, but they often don't know how much optimization is too much. Actually, I don't know.

The word excessive is obviously a word without scope. What do you mean, excessive? I can't control it.

So, what can I do to avoid over-fitting?

What I am doing is trying to push it up and look at this problem from another dimension.

Fitting, parameter optimization, to put it bluntly, are all small details. Behind different parameters, it represents different profit-loss ratios. For example, the 20-day moving average and the 50-day moving average, the amount of single loss you bear, and the gains in a wave of market are definitely different. However, the market trend is uncertain.

This is very important. Since we don't know what the future market will look like, is it meaningful for us to struggle over which number I choose here? You choose 2 1, you choose 15, and you choose 45. Is this suitable or not? Whether it is over-fitting or not is up to the future market. We can't go to the future. It's meaningless to dwell on this.

The so-called futures trading road is simple because sometimes, your idea must be simple, so simple that others think it is too rude.

The dimension of my station is to look at the system directly.

The 20-day moving average is different from the 50-day moving average. Breaking the 10 day high is also different from breaking the 20-day high. The former has more signals and more stops, but the former's admission position may be more advantageous at some time.

You like to make shorter trends and can't accept big profit-taking, so choose small parameters. You don't like to send signals frequently and want to follow the general trend, so choose big parameters.

As for the small parameter, is 20 good or18,21good? There's no point in obsessing about this.

In addition, the design of positions should not refer to the so-called history. Some people rely heavily on historical tests for the establishment of strategic position. Including the biggest retracement in history, the biggest loss in history, the average loss and so on. Is it okay? Of course. However, from the perspective of absolute safety, it is best to make a 50% discount, and then cooperate with winning and losing.

In futures trading, there is actually no perfect position management method because of the uncertainty of the trend. Maybe you designed it according to the position of strategic historical backtesting, which is nothing at all, but still a little low. But it is also possible that if you are conservative enough to build only half of your position, this strategy will still liquidate you.

The uncertainty of the trend makes everything possible.

A set of strategies will be liquidated. Is there a problem? That's not necessarily true. It is possible that it is only because the market during this period has blocked the killing of God and the Buddha has blocked the killing of Buddha. The reason why you are liquidated is not a logical problem, but a problem of fund management.

The way of fund management is a long topic. If you are in charge of a set of strategies, you'd better have a safety mat+conservative position+win or lose.

The so-called over-fitting is actually to make a futures trader overconfident. He thinks his strategy is good, he thinks his parameters are good and he thinks his position is good.

As a result, the market suddenly changed its rhythm. After he was shocked, he walked very smoothly. To put it bluntly, this kind of thing cannot be solved by 100%. Because of what?

Because the trend is uncertain. You do the trend, you don't do the trend. You create an impact, the trend never stops, you create a day, countless chaos …

So, how can we do our best?

Do a good job in fund management rules. Try to be conservative before the account has no income. If conservative or losing money, then continue to lighten up. If you can't stop loss when you have only one hand, then you can only stop opening or close your position.

You have made sure that your trading logic is fine, your fund management has reached the limit, and you still can't stop losing money. So I can only say that you are lucky to buy the lottery ticket of 10, which is the first prize. ...

The market let me die and I had to die.

Finally, sum up. There is no standard or good method for over-fitting. It can't be solved at all.

I suggest, forget it. You should design the trading system from the perspective of your own execution and your own preferences. If 20 is a reasonable parameter for you. Then there is no difference between 2 1 and 18 because you don't know the future.

If you are afraid of over-fitting. Then you have designed and improved the fund management rules. The fund management rules are perfect, and it doesn't matter whether they are suitable or not.

With the same set of data, no matter what algorithm is used, the result is the same. The journey is similar.

1: Minimize the use of parameters.

2. Multi-variety and multi-period inspection of the same parameter.

3. The test time should be as long as possible.

4. Make a rule, such as how many representative strategies have failed at present.

The optimization parameters are controlled within 4.

Distinguish between real and virtual, light and dark.

You can test more different products. For example, your system is designed for stock indexes and can be used to test rebar, aluminum and foreign exchange. In addition, the time period is long enough. At least 50 transactions are required. If you adjust the parameter values, such as two parameters, change them at will. There can be positive returns, which is a reliable system.

There is no solution to this problem, which can be avoided through the combination of multiple strategies, varieties and periods. There is no perfect strategy, because the market structure itself has been changing.

How to avoid over-fitting of trading system in futures trading?

The trouble with the theme is understandable. The topic is that there are too many theories to learn, too many trading methods, and the trading system has not been established and is still in the testing stage. Li pointed out that the first subjective assumption is the natural enemy of the trading system, and the purpose of establishing the trading system is to overcome subjective consciousness. Mature traders operate according to the trading signals sent by the trading system, and execute according to the system signals regardless of right or wrong; The setting principle of the second trading system is simple and clear, easy to operate and repeatable;

You can test more different products. For example, your system is designed for stock indexes and can be used to test rebar, aluminum and foreign exchange. In addition, the time period is long enough. At least 50 transactions are required. If you adjust the parameter values, such as two parameters, change them at will. There can be positive returns, which is a reliable system.

My experience is to reduce the number of parameters. For example, a trading system with two parameters is more difficult to fit than a trading system with 10 parameters. If there are too many parameters, you can't help but adjust them until you get the best back test result. If you're overdressed, you don't know. If there are fewer parameters, a result close to the universal law can be obtained.

In fact, it is not that difficult to do futures well. Finding effective methods and tools can help traders.

After the completion of logic programming, our strategy always needs to determine the quantitative data and find the appropriate data range through the inspection of historical data.

But often many quantifiers like to fit the best data set to achieve the purpose of high winning rate, low retracement and high income. This is called over-fitting.

As we all know, all tests use history to verify ideas. This data has performed well in history, but it may not be applicable in the future. For example, can you find your way in Shanghai with a map of Beijing?

A good strategy has such characteristics when selecting data.

1. When the data changes within a reasonable range, the results will not be qualitatively different. In other words, when the value of the data set changes within a reasonable range, the result is still profitable, and there is not much retreat. If a small change will lead to a loss, then this strategy is unsuccessful.

2. Different test varieties should not produce opposite results.

No matter whether it is stock, thread or soybean meal, a strategy that cannot be used universally is not a successful strategy.

Don't make it so complicated, the simpler the more effective.