How to address missing ONNX resources?
Since a .onnx file is an externally compiled model that cannot be recovered without the original training data, the best solution is to replace it with a built-in MQL5 mathematical regression.
The result is the integration of a "Statistical Signal Confirmation Block based on Dynamic Linear Regression" into the system.
Mathematical Forecasting (Replacing the Neural Network)
The robot no longer just reacts to what is happening now; it attempts to look into the future.
Linear Regression: On every tick, the Expert Advisor (EA) analyses the last 50 days (daily bars) and calculates the mathematical trajectory of the price.
Level Projection: It calculates probable High and Low values for 1 step ahead (tomorrow) and 20 steps ahead (in one month).
"Ensemble" Trade Filtering
This is the most critical intellectual enhancement. The decision to open a trade is made by two independent "voices":
The Voice of Indicators (Intuition): Checks the current candle direction and Moving Average (MA) positions.
The Voice of Mathematics (Forecast): Compares short-term forecasts with long-term trends.
Result: A trade opens only when both voices agree. For example, if an indicator says "Buy," but the mathematical forecast shows the trend is fading (Tomorrow's projected High is lower than the projected High in 20 days), the robot will ignore the entry, saving you from buying at the market top.
Dynamic Market Adaptation
Unlike the static ONNX file used in the original article (which was trained only once), my current version features:
On-the-fly Re-learning: It constantly updates regression coefficients. If market volatility changes, the calculations adapt automatically.
Autonomy: It no longer requires external files or libraries. The entire logic is contained within the code, making it highly reliable for testing and optimisation.
Combining Aggressive Grid Strategy with Cautious Entry
When applying this method to a grid strategy, you get the best of both worlds:
The core Grid Scalping algorithm remains aggressive-the EA is capable of building a grid of orders and exiting based on total profit.
However, the initial order in a series is now opened with much higher precision, as it is confirmed by the mathematical expectation of a rise or fall.
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Check out the new article: Self Optimizing Expert Advisors in MQL5 (Part 17): Ensemble Intelligence.
All algorithmic trading strategies are difficult to set up and maintain, regardless of complexity—a challenge shared by beginners and experts alike. This article introduces an ensemble framework where supervised models and human intuition work together to overcome their shared limitations. By aligning a moving average channel strategy with a Ridge Regression model on the same indicators, we achieve centralized control, faster self-correction, and profitability from otherwise unprofitable systems.
All algorithmic trading strategies are difficult to set up and maintain, regardless of their complexity. This universal problem is shared by beginners and experts alike. Beginners struggle to keep tuning the periods of their moving average crossover strategies, while experts are just as restless adjusting the weights of their deep neural networks. There are material problems on either side of the fence.
Machine learning models are fragile and often fall apart in live trading environments. Their opaque and complex designs make them even harder to troubleshoot and diagnose for performance bottlenecks. On the otherhand, human strategies can be more resilient but often require manual configuration to get started—an intensive process depending on the approach. This article proposes an ensemble framework in which supervised models and human intuition build on each other to overcome their collective limitations in an accelerated way.
To attain this end, we designed our strategy and statistical model to share the same four technical indicators. We selected a moving average channel strategy and fit a Ridge Regression model on those same indicators. Doing this, allowed us to quickly identify a profitable configuration for the entire system.
Author: Gamuchirai Zororo Ndawana