Today we discover the dangers of optimization: over-optimization. That’s the secret to making our system robust, consistent, and quite durable over time, or a quick way to lose your capital. It’s a fine line we shouldn’t cross. Let us then see what requirements we must take into account and what precautions we must take during the creation of a system, either automatic or 100% manual. At what point does optimization appear?
When we are creating our trading robot, the first thing we do is determine how it starts making market entries, when it will come out with its corresponding motives (crossover, RSI, MACD, different timeframes, etc). Once this is done, we start with optimization.
Right now we are going to adjust the robot to each market, as it is quite difficult for them to behave in similar ways. Therefore, if hypothetically our robot enters by moving averages when we are optimizing, the program will tell us that moving averages have gone better and which ones have gone worse. It’s just in that instant that we’ll have to be very careful, because it is when the joys of seeing a system that has multiplied our capital by 4 in 6 months come, forgetting the rest of optimizations. Error.
What do we have to look at in optimization?
In the graph of the evolution of our capital. Capital should not have any operation that excelled from the rest notably. Trading is a work of constancy; we must never seek the ball, the trade of your life… if it comes, it will come. Imagine that our profit after a year (500 operations) amounts to 1,800€, but we see that with a trade or two we have made 2,000€. We are in front of a system that will rarely get super trades, but that for the rest of the time, will be a negative or near-zero profit system.
Another point that can help us identify whether or not we are over-optimizing will be to look at the values of nearby means and see what results there are. If the results are very uneven, be careful, it is very possible that we have over-optimized. It may be that the means 10 and 20 go very well and that the means 12 and 25, fail miserably. A good system has to keep these values quite similar, the more subsystems (system configurations), the better the overall result.
It is necessary to be careful that when we decide to optimize a variable, it must be directly related to the market, that is, that it is something measurable, some numerical value.
As an example of this point, we could optimize our trading system by the hour. The market does not know what time it is, nor is it sleepy, the market is there. We must draw a pattern of behavior from indicators, or whatever, that depends directly on the market. Not because it’s 9:00 in the morning the market is going to move or the other way around; not because it’s 10:00 at night, the market is going to be flat. There are trends day and night, although it is true that there are more during the day. If we decide to optimize by eliminating certain hours of the day, the days that for some unknown reason there is no trend, our system, if it is tendential, will probably suffer.
Time for backtesting and subsequent optimization. If our strategy is long-term, we must have at least 200 trades, at least. With less, it is impossible to get reliability from that system. It is estimated that the robot continues to operate for a period of approximately 1/3 to 1/8 of the total simulation. If we do a test of 8 months, at least the system should work from one month to almost 3.
If after optimizing the system does not work, nothing happens. I know, it’s nice to see how your system in the past could have made a killing, but now it’s no good. It was a combination of trades that might happen again, but maybe 20 years from now. Are you going to be losing money for that long?
The last thing, I was looking for images to illustrate the post and I remembered the most over-optimized systems that exist, the trading robots that are sold online. 95% are scams. With phrases like this: “I doubled the capital, in 6 months” and a guy smiling with money, people go crazy. The final part of the advertisement says: “For only 29,95€”… If the programmer had a system that doubled the capital in 6 months, it would be cheaper for him to go and ask for money in the bank or wherever. I put the photo here, so you can see the graphic they show on their websites. Good and functioning robots make money in the long run, but they are not exponential and perfect trend lines, without any failed trade.