Discussion of article "Gradient Boosting (CatBoost) in the development of trading systems. A naive approach"
Testing on EURUSD H1 as per the example case cited in the article.
Perhaps the information here will be of use.
"
Array out of Range
When working with arrays, the access to their elements is performed by the index number, which cannot be negative and must be less than the array size. The array size can be obtained using the
CopyTicks() function tries to store the requested number of ticks to an array, but if there are less ticks than requested, the size of resulting array will be smaller than expected.
Another quite obvious way to get this error is to attempt to access the data of an indicator buffer while its size has not been initialized yet. As a reminder, the indicator buffers are dynamic arrays, and their sizes are defined by the terminal's execution system only after the chart initialization. Therefore, for instance, an attempt to access the data of such a buffer in the OnInit() function causes an "array out of range" error.
A simple example of an indicator that generates this error can be found in Test_Out_of_range.mq5 file. "

- www.mql5.com
"array out of range in 'cat_model.mqh' (189, 51)"
Testing on EURUSD H1 as per the example case cited in the article.
Perhaps the information here will be of use.
"
Array out of Range
When working with arrays, the access to their elements is performed by the index number, which cannot be negative and must be less than the array size. The array size can be obtained using the
CopyTicks() function tries to store the requested number of ticks to an array, but if there are less ticks than requested, the size of resulting array will be smaller than expected.
Another quite obvious way to get this error is to attempt to access the data of an indicator buffer while its size has not been initialized yet. As a reminder, the indicator buffers are dynamic arrays, and their sizes are defined by the terminal's execution system only after the chart initialization. Therefore, for instance, an attempt to access the data of such a buffer in the OnInit() function causes an "array out of range" error.
A simple example of an indicator that generates this error can be found in Test_Out_of_range.mq5 file. "
You are correct, the catboost_learning.py uses a lookback of 250 instead of 50 as configured in the cat_trader.mq5. A technical obstacle intended to deter the casual onlooker perhaps?
You are correct, the catboost_learning.py uses a lookback of 250 instead of 50 as configured in the cat_trader.mq5. A technical obstacle intended to deter the casual onlooker perhaps?
no just aticle was for 50 features, for simplicity but then I did for 250
new article on the way alsoThis is completely wrong approach . You can't generate a model based on the same training and testing dataset then say it is working that's useless and baseless. Its called Curve fitting the model . Such models look good on paper but will never work in real world. Please use correct approach to machine learning , there are several ways to do it but yours is completely wrong.
I think you both just completely wrong, guys. The aritcle marked as 'naive approach' as introduction to CatBoost model. No one forbids you to test the model on new data. Also at the and of the article you can see test on new data + learning period.
Just read an articles more carefully, because next part on the way.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
New article Gradient Boosting (CatBoost) in the development of trading systems. A naive approach has been published:
In this article, we train the CatBoost classifier in Python and export the model to mql5, as well as parse the model parameters and consider a custom strategy tester. The Python language and the MetaTrader 5 library are used for preparing the data and for training the model.
The compiled bot can be tested in the standard MetaTrader 5 Strategy Tester. Select a proper timeframe (which must match the one used in model training) and inputs look_back and MA_period, which should also match the parameters from the Python program. Let us check the model in the training period (training + validation subsamples):
Model performance (training + validation subsamples)
If we compare the result with that obtained in the custom tester, these results are the same, except for some spread deviations. Now, let us test the model using absolutely new data, from the beginning of the year:
Model performance on new data
The model performed worse with new data. Such a result is related to objective reasons, which I will try to describe further.
Author: Maxim Dmitrievsky