Discussing the article: "Developing a Neural Network Trading Robot Based on Mamba with Selective State Space Models"

 

Check out the new article: Developing a Neural Network Trading Robot Based on Mamba with Selective State Space Models.

The article explores the revolutionary Mamba/SSM neural network architecture for financial time series forecasting. We will consider a complete MQL5 implementation of a modern alternative to Transformer with linear complexity O(N) instead of quadratic O(N²). Selective State Space Models, hardware-aware optimizations, patching techniques, and advanced AdamW training methods are covered in detail. Practical test results showing an increase in accuracy from 62% to 71% while reducing training time from 45 to 8 minutes are included. A ready-made trading EA with auto learning and adaptive risk management for MetaTrader 5 is presented.

Modern algorithmic trading faces a fundamental problem. Classical neural network architectures based on the attention mechanism exhibit quadratic computational complexity O(N²). This means that doubling the length of the time series results in a fourfold increase in processing time. For a trader analyzing thousands of candles of historical data, this inefficiency becomes a critical limitation.

Imagine this situation: your trading system needs to analyze the last 2048 price bars to decide whether to enter a position. The Transformer architecture would require about 4 million attention operations for this, and the processing would take several seconds. In high-frequency trading, where milliseconds decide the outcome of a trade, such a delay is tantamount to a strategy failure.

Moreover, modern markets are characterized by increasing complexity and interconnectedness. Successful forecasting requires the analysis of increasingly longer historical periods, taking into account correlations between different assets and time scales. Traditional architectures fail to address this challenge, limiting traders to context windows of 512-1024 data points.

Developing a Neural Network Trading Robot Based on Mamba with Selective State Space Models


Author: Yevgeniy Koshtenko

 
When compiling the ModernTimeSeriesNet.mqh file, the following errors occur: - undeclared
 
Борис Ворона #:
When compiling the ModernTimeSeriesNet.mqh file, the following error occurs: - undeclared

Hello! I have attached the latest version to the updated article. In the previous version, the expert advisor compiled fine as it was; the problem was simply that the required variables were defined in the EA rather than in the mqh file.

 
Yevgeniy Koshtenko #:

Hello! I’ve attached the latest version to the updated article. In the previous version, the expert advisor compiled just fine; the problem was simply that the variables were defined in the EA rather than in m

Thank you, it’s all working now.