Discussing the article: "Neural Networks in Trading: Bidirectional Adaptive Temporal Correlation (Conclusion)"

Check out the new article: Neural Networks in Trading: Bidirectional Adaptive Temporal Correlation (Conclusion).

The BAT framework transforms a chaotic stream of market data into accurate forecasts and well-informed trading decisions. Backtesting shows steady capital growth with controlled risks. The model's architecture is simple, scalable, and ready for further optimization.

The final stage of our work is devoted to training the trading policy and testing it on real historical data. The first step was offline training using historical price data for the EURUSD currency pair on the H1 timeframe for the period from January 2024 to June 2025. This period served as a sort of training ground where the model learned to recognize historical patterns, analyze price dynamics and trading volumes, identify relationships between key features, and use those relationships to make forecasts. One could say that it developed its own trader's intuition, combined with mathematical rigor in data processing.

The next step — fine-tuning the model online in the MetaTrader 5 Strategy Tester — allowed the model to adapt to the real-time data stream. Here, it learned the characteristics of a live market: it remained stable amid market noise, adjusted its actions when liquidity declined, and reacted instantly to sharp price spikes. This approach ensured a seamless integration of historical experience with current market signals, making trading decisions as timely and well-founded as possible.

The final test was conducted using data from July through October 2025, which was entirely new and had not been used previously in the training process. All model parameters were loaded without modification, which allowed for an objective assessment of the algorithm's ability to generalize and adapt to unfamiliar conditions. The results demonstrate that a step-by-step approach to training and adaptation enables the model to effectively analyze the market, forecast changes in key market features, and provide traders with a reliable basis for real-time decision-making.


Author: Dmitriy Gizlyk

Dmitry, you have three parts of this article, each in a different version of NeuroNet.mqh... Does it matter?

The current implementation (Study.mq5, Test.mq5, StudyOnline.mq5) usesthe names of BAT components, but architecturally does NOT IMPLEMENT the system described in the articles.

Key differences:

  1. The encoder has been simplified — instead of a multi-layer structure (CreateFlow → MultiWindowsConv → MSRes → BiDirectCorrelation → SATMA → SpikeConvGRU2D), a single layer of `defNeuronBAT` is used.

  2. CreateFlow is absent — there is no conversion to an event-based representation or voxel-grid formation. Data is fed in as a flat vector `HistoryBars * BarDescr`.

  3. BiDirectCorrelation is unavailable — the bidirectional temporal correlation module is defined but not integrated into the encoder architecture.

  4. SATMA is not used — spatially adaptive aggregation has been replaced by CrossDMHAttention (attention), which is fundamentally different.

  5. The GRU module is missing — there is no dynamic modelling component at the motion synthesis level.

  6. STFS is incorrectly placed — it is embedded throughout, although it was intended to be only in Study.mq5 for training.

Conclusion: the code implements a general-purpose RL trader, adapting individual ideas from BAT, but does not embody the full architecture described in the articles.

Vladimir Sanin #:
Dmitry, you have three parts to this article, each in a different version of NeuroNet.mqh... Does it matter?
Good afternoon, Vladimir.
Each part introduces a separate implementation block and builds on the previous ones. The full version is in the final article.
Vladimir Sanin #:

The current implementation (Study.mq5, Test.mq5, StudyOnline.mq5) usesBAT component names, but architecturally does NOT IMPLEMENT the system described in the articles.

Key differences:

  1. The encoder has been simplified — instead of a multi-level structure (CreateFlow → MultiWindowsConv → MSRes → BiDirectCorrelation → SATMA → SpikeConvGRU2D), a single layer of `defNeuronBAT` is used.

  2. CreateFlow is absent — there is no conversion to an event-based representation or voxel-grid formation. Data is fed in as a flat vector `HistoryBars * BarDescr`.

  3. BiDirectCorrelation is unavailable — the bidirectional temporal correlation module is defined but not integrated into the encoder architecture.

  4. SATMA is not used — spatially adaptive aggregation has been replaced by CrossDMHAttention (attention), which is fundamentally different.

  5. The GRU module is missing — there is no dynamic modelling component at the motion synthesis level.

  6. STFS is incorrectly positioned — it is embedded throughout, although it was intended to be present only in Study.mq5 for training.

Conclusion: the code implements a general-purpose RL trader, adapting individual ideas from BAT, but does not embody the full architecture described in the articles.

The `defNeuronBAT` type corresponds to the `CNeuronBAT` object , which is described at the link. It includes the specified modules.

class CNeuronBAT :  public CNeuronSpikeConvBlock
  {
protected:
   CLayer                              cPrepare;
   CLayer                              cEncoder;
   CLayer                              cContext;
   CNeuronBaseOCL                      cConcatenated;
   CNeuronSpikeConvGRU2D               cGRU;
   CNeuronTransposeRCDOCL              cTranspose;
......
......
......
Нейросети в трейдинге: Двусторонняя адаптивная временная корреляция (Окончание)
Нейросети в трейдинге: Двусторонняя адаптивная временная корреляция (Окончание)
  • 2025.12.09
  • www.mql5.com
Фреймворк BAT превращает хаотичный поток рыночных данных в точные прогнозы и взвешенные торговые решения. Тесты на исторических данных показывают стабильный рост капитала при контролируемых рисках. Архитектура модели проста, масштабируема и готова к дальнейшей оптимизации.
Dmitriy Gizlyk #:

The `defNeuronBAT` type corresponds to the `CNeuronBAT` object , which is described at the link. It includes the modules specified.

My apologies, Dmitry. I forgot to load NeuroNet.mqh into the LLM… that’s where all the discrepancies came from.
What about the high (1500+) STFS error? Do the features need normalising? I’ve tried it; the error drops dramatically… but won’t that spoil the whole idea?
Vladimir Sanin #:
I’m sorry, Dmitry. I forgot to load NeuroNet.mqh into the LLM… that’s where all the discrepancies came from.
What about the high (1500+) STFS error? Do we need to normalise the features? I’ve tried it, and the error drops dramatically… but won’t that ruin the whole idea?
The error drops dramatically because MSE — mean squared error — is being used. Smaller values mean a smaller error. The idea was to minimise manual work outside the model. Therefore, a batch normalisation layer was added to the STFS output; only in this case, the intention was to train the model to determine the scaling parameters for normalised latent values relative to the ‘raw’ values obtained from the terminal. Something like RevIN. However, in this case, the direct normalisation of the data is carried out in a different model, and we cannot extract the normalisation parameters from it, so we simply train them.
Нейросети — это просто (Часть 84): Обратимая нормализация (RevIN)
Нейросети — это просто (Часть 84): Обратимая нормализация (RevIN)
  • 2024.04.05
  • www.mql5.com
Мы давно уже усвоили, что большую роль в стабильности обучения модели играет предварительная обработка исходных данных. И для online обработки "сырых" исходных данных мы часто используем слой пакетной нормализации. Но порой возникает необходимость обратной процедуры. Об одном из возможных подходов к решению подобных задач мы говорим в данной статье.