Обсуждение статьи "Создание самооптимизирующихся советников на MQL5 (Часть 17): Ансамблевый интеллект"
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) analyzes 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 optimization.
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.
Вы упускаете торговые возможности:
- Бесплатные приложения для трейдинга
- 8 000+ сигналов для копирования
- Экономические новости для анализа финансовых рынков
Регистрация
Вход
Вы принимаете политику сайта и условия использования
Если у вас нет учетной записи, зарегистрируйтесь
Опубликована статья Создание самооптимизирующихся советников на MQL5 (Часть 17): Ансамблевый интеллект:
Все алгоритмические торговые стратегии сложны в настройке и обслуживании, независимо от их сложности. Эта проблема актуальна как для новичков, так и для опытных специалистов. Новичкам приходится нелегко, пытаясь постоянно настраивать периоды своих стратегий на пересечение скользящих средних, в то время как эксперты с таким же упорством занимаются настройкой весов своих глубоких нейронных сетей. Серьёзные проблемы есть у обоих подходов.
Модели машинного обучения нестабильны и часто разваливаются в условиях реальной торговли. Их непрозрачная и сложная структура еще больше затрудняет поиск и устранение неисправностей, а также выявление узких мест в производительности. С другой стороны, стратегии, разработанные людьми, могут быть более устойчивыми, но для их запуска часто требуется ручная настройка — процесс, который может быть трудоемким в зависимости от используемого подхода. В статье предлагается ансамблевая схема, в которой модели с учителем и человеческая интуиция дополняют друг друга, быстрее компенсируя взаимные ограничения.
Для достижения этой цели мы разработали нашу стратегию и статистическую модель таким образом, чтобы они использовали одни и те же четыре технических индикатора. Мы выбрали стратегию на основе канала скользящих средних и и обучили модель Ridge Regression на тех же индикаторах. Благодаря этому нам удалось быстро определить оптимальную конфигурацию для всей системы.
Автор: Gamuchirai Zororo Ndawana