Genetic gold "Classic" Improvement

For whatever reason, many beginning traders are afraid to use genetic algorithms (GA) to optimize their systems. However, it is obvious that classical (exhaustive) as well as modern (genetic) optimizations play their role in strategy development. Today I will try to explain what differences both types of optimization can offer and help you see that you do not have to be afraid of “genetics”.

The biggest advantage of genetic optimization is undoubtedly time. Especially if we have more parameters to optimize, we can literally shorten the entire process from days to just a few hours, which is a speedup worth thinking about.

Most traders who have no experience with genetic optimization have the feeling that thanks to this shortcut the whole process will be like a “trap”. After all, how is it possible that GA can find solutions in 5-10% of the regular time, when the classic optimization process takes “full” time?

First, in a surprisingly high number of cases, genetic algorithms can find completely similar combinations that classical optimizations would also find. Second, you can find combinations that may differ. This can be useful, as I will explain shortly.

Let’s start with a simple comparison that shows quite realistic solutions found by GA – how close or how far they are from the solutions that classical optimization would find.

In this article I have chosen as an example a system of mine with 5 optimization parameters in total and on which I have applied Walk Forward Optimization (WFO). It means that I have divided the data used into 7 segments and have performed 7 optimizations (one on each data segment) to have more samples to compare. The comparison turned out as follows.

In the first place, the parameters that GA found are exactly the same as those of the classical optimization method (in more than half of the cases) 54%. That’s not bad at all, especially if we take into account that the reduction in the original time required for optimization is 90-95%. Subsequently, the parameters that GA found are very close to those found by the classical optimization technique; the result shows that there is no noticeable difference. The two groups together add up to 69%, which is a pretty decent result. In almost 3/4 of the cases, GA results were the same or very close to those in which classical optimization was used. However, GA found solutions 5-10% of the time than originally needed.

The remaining 31% of the results differ fundamentally, which can be a bit worrisome for some people. But as I will explain later, it is not necessary.

Usually the reason for a difference between the results is that classical optimization looks for the so-called local optimum and genetic algorithms tend to find a global optimum.

What exactly are these?

Suppose you have two parameters, N1 and N2, and you would like to find a combination with the best benefit.

The best combination shows that the gains for this case are around the $ 130,000 level. The problem is that this optimum is local and not global. The local optimum does not show similar results in the immediate vicinity. In other words, there is only one combination that provides great results, but the surrounding combinations will not. The local optimum is with a high probability over the optimized combination and a classical optimization technique tends to search for the local optimum.

Unlike genetic algorithms that seek a global optimum. In this area the profit is around $ 110,000, but the optimum has many functional “neighbors”. Therefore, the global optimum is more robust than the local optimum (which wins more, but the combination of parameters is debatable from the point of view of robustness).

Naturally, genetic algorithms do not always achieve the global optimum and occasionally also include a local optimum in their solutions. At the same time, classical optimization does not always produce only a local optimum; Often times, the best combination is part of a global optimum (and these are the moments when all the probable solutions found by GA and the classical optimization will correspond or be very close). Unfortunately, genetic algorithms also use the element of chance, so the end result is substantially less controllable; well, this is the price to pay for speeding up the optimization.

Personally, I use both types of optimization and I believe that both have their place in ATS development. Genetic algorithms may seem scary at first, but once you run a few tests and get used to them, you will realize that they are an irreplaceable help in many cases, and with their help you will do a lot more work. Of course, there are tons of academic studies that discuss aspects of both optimizations. We could argue about anything with respect to both methods, but I personally am not an academic; I am a pure practitioner. From a practical point of view, GA can be really invaluable, especially when used in a sensible and intelligent way. Therefore, there is no reason to be afraid of them, but it is important to use them with sense and reason.

Happy trading!

Website design By BotEap.com

Add a Comment

Your email address will not be published. Required fields are marked *