Discussion of article "Machine learning in Grid and Martingale trading systems. Would you bet on it?"


New article Machine learning in Grid and Martingale trading systems. Would you bet on it? has been published:

This article describes the machine learning technique applied to grid and martingale trading. Surprisingly, this approach has little to no coverage in the global network. After reading the article, you will be able to create your own trading bots.

Testing should be performed on the timeframe on which the bot was trained. In this case it is H1. It can be tested using open prices, since the bot has an explicit control of bar opening. However, since a grid is used, M1 OHLC can be selected for greater accuracy.

This particular bot was trained in the following period:

START_DATE = datetime(2020, 5, 1)
TSTART_DATE = datetime(2019, 1, 1)
FULL_DATE = datetime(2018, 1, 1)
END_DATE = datetime(2022, 1, 1)

  • The interval from the fifth month of 2020 to the present day is a training period, which is divided 50/50 into training and validation subsamples. 
  • From the 1st month of 2019, the model was evaluated according to R^2 and the best one was chosen.
  • From the 1st month of 2018, the model was tested in a custom tester.
  • Synthetic data was used for training (generated by the Gaussian mixture model)
  • The CatBoost model has a strong regularization which helps to avoid overfitting on the training sample.

All these factors indicate (which is also confirmed by the custom tester) that we have found a certain pattern in the interval from 2018 to the present day.

Lest us view how it looks like in the MetaTrader 5 Strategy Tester.

With the exception that we can now see equity drawdowns, the balance chart looks the same as in my custom tester. It is good news. Let us make sure that the bot is trading exactly the grid and nothing else.

Author: Maxim Dmitrievsky


i use martingale and grid for along time but with combination of vanilla options in order to manage the risk

i really like your idea and would love to see further improvements and results

Marcel Fitzner
Marcel Fitzner  

With extraordinary times where Central Banks are printing money like never before it is very likely that many assets are biased towards one direction (upwards). With backtesting of the last 3 years only, this trading system is prone to face higher risk once Central Banks have to hike rates (you can argue if you like that this never happens, but can you garantuee this 100%?)

Then draw downs will be higher than those ~40% as reported in the article. For any serious investor such risks are not acceptable.