Discussion of article "Practical Use of Kohonen Neural Networks in Algorithmic Trading. Part I. Tools"

 

New article Practical Use of Kohonen Neural Networks in Algorithmic Trading. Part I. Tools has been published:

The present article develops the idea of using Kohonen Maps in MetaTrader 5, covered in some previous publications. The improved and enhanced classes provide tools to solve application tasks.

In inherited source codes, no input data normalization is used. However, it is very important in case where different components (features) of input vectors have different ranges of values. And this is the case in the EAs' optimization results and in pooling the data of different indicators. As to the optimization results, we can see there that the values having the total profits of dozens of thousands rub shoulders with small values, such as the fractions of Sharp ratio or the one-digit values of the restitution factor.

You should not teach a Kohonen network using such different-scale data, since the network would practically consider the larger components only and ignore the smaller ones. You can see this in the image below obtained using the program that we are going to consider in a step-wise manner within this article and attach hereto in the end. The program allows generating random input vectors, in which three components are defined within the ranges of [0, 1000], [0, 1], and [-1, +1], respectively. A special input, UseNormalization, allows enabling/disabling normalization.

Let us have a look at the final structure of the Kohonen network in three planes relevant to three dimensions of the vectors. First, the network learning result without normalization.

Kohonen network learning result without normalizing the inputs

Kohonen network learning result without normalizing the inputs

Now, the same with normalization.

Kohonen network learning result with normalizing the inputs

Kohonen network learning result with normalizing the inputs

Author: Stanislav Korotky

 
In the future, we will use CSOMDisplay for the task of selecting optimal parameters of the expert, and CSOM for forecasting.

Unfortunately, I have completely forgotten the topic. Reading the articles on the links did not give any understanding.


Suppose there are three input parameters that have been optimised. Kohonen did the clustering and visualised. What is the convenience of finding optimal parameters?

I don't understand at all about forecasting. If possible, an idea in a nutshell too.

 

In the future, I would like to see such a practical example.


We introduce some additional input parameter into the Expert Advisor. And evaluate its dependence on others.

 

I am more interested in the practical part of using clustering in forex, apart from making correlation tables and other things. Plus I don't understand the issue of stability of maps on new data, what are the ways to estimate generalisation ability and how much they are retrained

At least in theory to understand how this can be used effectively. The only thing that comes to mind is dividing a time series into several "states"

 
fxsaber:

Let's say there are three input parameters that have been optimised. Kohonen has done clustering and visualisation. What is the convenience of finding the optimal parameters?

I don't understand at all about forecasting. If possible, also in a nutshell the idea.

Usually optimisation gives a large choice of options and does not give estimates of their stability. The second article tries to solve these problems partly visually, partly algorithmically with the help of Kohonen maps. The article has been sent for verification.

 
fxsaber:

We introduce some additional input parameter into the Expert Advisor. And evaluate its dependence on others.

Kohonen allows us to do this visually - in the form of a map. If we are talking about a single digit, then this is for other methods.

 
Maxim Dmitrievsky:

I am more interested in the practical part of using clustering in forex, apart from making correlation tables and other things. Plus I don't understand the issue of stability of maps on new data, what are the ways to estimate generalisation ability and how much they are retrained

At least in theory to understand how this can be used effectively. The only thing that comes to mind is splitting the time series into several "states"

Maybe part 2 will provide some answers. If the law of data distribution is preserved, there should be stability. To control generalisability, it is suggested to choose the map size and/or training duration using validation sampling.

Some examples of use cases are in part two.

 
Stanislav Korotky:

Maybe the second part will provide some answers. If the law of data distribution is preserved, there should be stability. To control generalisability, it is suggested to choose the map size and/or training duration using validation sampling.

Some examples of use cases are in the second part.

yes, sorry, I didn't see that there is already a method of stopping through validation sampling. Then let's wait for examples, interesting :)

 
Clarification/addendum: as of now, the version of ALGLIB ported to MQL5 already provides agglomerative hierarchical clustering - see ClusterizerRunAHC in the file MQL5/Include/Math/Alglib/dataanalysis.mqh.