Discussing the article: "Quantum Neural Network in MQL5 (Part II): Training a Neural Network with Backpropagation on ALGLIB Markov Matrices"

 

Check out the new article: Quantum Neural Network in MQL5 (Part II): Training a Neural Network with Backpropagation on ALGLIB Markov Matrices.

The article presents an innovative quantum neural network architecture for algorithmic trading that combines the principles of quantum mechanics with modern machine learning methods. The system includes quantum effects (resonance, interference, decoherence), multi-level memory of different time scales, Markov chains with the ALGLIB library, and adaptive parameter control. The full implementation is done in MQL5 using the built-in matrix/vector types, which removes implementation barriers in MetaTrader 5.

Algorithmic traders are increasingly faced with the fact that their usual models are no longer producing results. LSTM networks, previously considered a breakthrough, achieve around 58% accuracy. Transformers, despite their advances in NLP, struggle with the noise of financial data. ARIMA-type models have lost their practical value.

A typical situation: a trading system performs well historically, but quickly loses its efficiency in real trading. The main reason is overfitting and the inability of traditional networks to adapt to changing market conditions. The transition from a calm trend to high volatility makes many algorithms useless. Forecast accuracy drops to 51–58%, drawdowns reach 40–50%, and the Sharpe ratio rarely exceeds 1.0.


Author: Yevgeniy Koshtenko

 
Hello, hang on, how do you actually use it and train it?

My tests are running but there are no results, i.e. I can’t test how it trades on historical data – or is that only possible in demo mode and for a limited time?
 
Evgeny, the community would be truly grateful if you could post some working code for the expert advisor and the included file. At the moment, they don’t even compile without errors. But most importantly, you state that 400 features have been implemented for training the model, yet judging by the code, not even a tenth of those features are present.
Квантовая нейросеть на MQL5 (Часть II): Обучаем нейросеть с обратным распространением ошибки на марковских матрицах ALGLIB
Квантовая нейросеть на MQL5 (Часть II): Обучаем нейросеть с обратным распространением ошибки на марковских матрицах ALGLIB
  • 2025.07.25
  • www.mql5.com
В статье представлена инновационная архитектура квантовой нейронной сети для алгоритмической торговли, объединяющая принципы квантовой механики с современными методами машинного обучения. Система включает квантовые эффекты (резонанс, интерференцию, декогеренцию), многоуровневую память различных временных масштабов, марковские цепи с библиотекой ALGLIB и адаптивное управление параметрами. Полная реализация выполнена на MQL5 с использованием встроенных типов matrix/vector, что устраняет барьеры внедрения в MetaTrader 5.
 
panovq #:
Hi there, listen, how do you actually use it and learn how to trade with it?

I’ve been running tests but there are no results yet; in other words, I can’t test how it trades using historical data – or is that just not possible, and it’s only available in demo mode and for a limited time?

Hello, what timeframe, settings and instrument are you using?

 
Sergei Goncharov #:
Evgeny, the community would be truly grateful if you could post some working code for the expert advisor and the included file. At the moment, they don’t even compile without errors. But most importantly, you state that 400 features have been implemented for training the model, yet judging by the code, not even a tenth of those features are present.

What errors are you getting during compilation? It compiles perfectly for me; if that weren’t the case, I wouldn’t have published it in the first place)

 
Yevgeniy Koshtenko #:

And what sort of compilation errors are you getting? It compiles perfectly for me; if that weren’t the case, I wouldn’t have published it in the first place)

Yes, the compilation’s fine – I just corrected the path to the included file and that was that. The main issue here is with how the expert advisor works and its stated functions. I’m new to the MQL community and thought that when you read a phrase like‘predicts market behaviour with 65% accuracy. The SimpleQuantumEA.mq5 expert advisor uses 400 indicators’ and you see the published code, you’d expect the expert advisor to trade according to that principle. But that’s not the case. Please don’t take this as an insult. I admire your ideas and incorporate a lot of them into my own work. It’s the same with other authors; nothing published works 100%. I suppose it’s human greed. That’s just how we’re wired. Anyway, I’m grateful to you for what you share. For example, I’ve already added over 2,000 lines of code to your advisor. For instance, after writing code to test the effectiveness of 400 indicators, I was left with only 149 that proved effective. The algorithms filtered out the rest as noise that didn’t affect the forecast. Is it the same for you?


I’d just like some more information from you on the steps you took to achieve a 99 per cent profit rate on trades. I’m not even asking for the code, just some advice. What layers did you use, and what additional neural networks? I see that you started the Quantum expert advisor with an LSTM model. In the end, did you drop it and start using Quantum on top of it as a filter? Or do you have a separate LSTM expert advisor and a separate Quantum algorithm ?

Please share more advice and information. After all, if you start giving more back to the world, you’ll see how much more comes your way straight away. That’s how the universe works. I’m writing here because you don’t reply to private messages :) I assure you, if I manage to come up with something worthwhile along the way, I’ll definitely share it. But for now, I’m only just getting started...

 

Good afternoon.

I would like to remind you that the MQL5 platform does not support quantum computing. Real quantum neural networks use specialised platforms such as Qiskit or Cirq, and quantum hardware (for example, IBM Quantum). This is merely a simulation of ‘Attention’.

It’s a bit of a hodgepodge of LSTM, Transformers, ARIMA and so on. Genuine quantum computing won’t run on standard servers or PCs.

 
Thank you very much for sharing these studies.
 
Very good
 
Nice article! However, Despite the "quantum" terminology, the system does not use a real quantum computer. It is a classical neural network with additional nonlinear mathematical functions inspired by quantum mechanics.

The core novelty is the addition of three nonlinear effects: Resonance, Interference and Decoherence.