Discussing the article: "Creating a mean-reversion strategy based on machine learning" - page 8
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Imho of course, but using Savitsky_Golay is not much different from using muve. The SG filter is the midpoint of a polynomial regression in a given sliding window, with a specified degree of polynomial. For degree 1, it is a perfect match with the muve of the corresponding period.
To identify the return to the mean, it makes more sense, in my opinion, to use amplitude filtering - renko, renji, zigzags. I think that ranges are the best - the difference between Hg and Lw is a constant. Well, or a constant size ZZ, which is basically the same thing.
Fourier and singular value decomposition show themselves quite well as filters. I have not been involved in the selection of parameters, first variants.
An example of adding exponential decay to the filtering process, based on the first markup function from the article. The last examples are given more weight in the markup, to adjust for more recent data.
For training on shorter intervals, e.g. 2018 to 2024, few trades may be obtained if n_clusters = 10 in the hyperparameters. Reducing the number of clusters, e.g. to 5-3, helps to get more trades.
In this way, you can train on shorter time periods and look for good patterns on them by varying different parameters.
You can also reduce the filter periods (Savitzky-Golei filter or splines) of samplers of trades.
Thanks, I'll try to do something interesting and maybe useful in the future :)
this is great: At the end of the article it will be possible to train different machine learning models in Python and convert them into trading systems for the MetaTrader 5 trading terminal.
I will look into it in more detail - thanks for the article!
I will look into it in more detail - thanks for the article!
Hello Maxim,
I found an issue with the value generation in the get_features function in Python and in MetaTrader 5.
The problem lies in the "skew" statistic in Python and "skewness" in MQL5. From the tests I performed, the values generated by the two languages are slightly different. For example:
-0.087111
In MQL5, and
-0.092592
In Python
It may seem minor, but after the classification of the meta_labels, this leads to a delayed prediction, causing the EA to usually enter one candle late, which makes the strategy ineffective. I recommend not using this statistic in MQL5, or attempting to calculate it manually to match the same values.
Greetings from Brazil
Hello Maxim,
I found an issue with the value generation in the get_features function in Python and in MetaTrader 5.
The problem lies in the "skew" statistic in Python and "skewness" in MQL5. From the tests I performed, the values generated by the two languages are slightly different. For example:
-0.087111
In MQL5, and
-0.092592
In Python
It may seem minor, but after the classification of the meta_labels, this leads to a delayed prediction, causing the EA to usually enter one candle late, which makes the strategy ineffective. I recommend not using this statistic in MQL5, or attempting to calculate it manually to match the same values.
Greetings from Brazil