MQL5 Algo Trading
579K subscribers
4.63K photos
7 videos
4.64K links
The best publications of the largest community of algotraders.

Subscribe to stay up-to-date with modern technologies and trading programs development.
Download Telegram
Price forecasting and market trend prediction are essential tasks in trading and risk management. Traditional machine learning models often face challenges in volatile markets. Moving from training from scratch to pretraining on large, unlabeled data sets, followed by fine-tuning specific tasks, enhances forecasting accuracy. Models like the Transformer architecture, when adapted for financial data, leverage asset correlations and temporal dependencies for improved predictions. Implementing alternative attention mechanisms accounts for market dependencies, enhancing model performance.

The R-MAT model is one such example, incorporating relative Self-Attention for processing molecular graphs. Its adaptability and accuracy across various tasks present new opportunities for developing trading strategies.

πŸ‘‰ Read | VPS | Share!

#MQL5 #MT5 #AITrading
πŸ‘31❀20✍4πŸ‘€2πŸ†1πŸ‘¨β€πŸ’»1
In our latest exploration of MetaTrader 5 development, we focus on implementing a robust Zone Recovery System combined with an Envelopes-based trend-trading strategy using MQL5. This system intelligently manages trades by employing a "zone" strategy to recover from potential losses, automatically placing counter-trades when needed. By integrating Relative Strength Index and Envelopes indicators, the strategy identifies optimal entry and exit points, maintaining low risk and maximizing profitability. Designed for dynamic market conditions, this setup offers flexibility and precision for both novice and seasoned developers looking to automate and enhance their trading algorithms. Dive into the intricacies of our structured MQL5 implementation for deeper insights.

πŸ‘‰ Read | NeuroBook | @mql5dev

#MQL5 #MT5 #AITrading
πŸ‘14❀11πŸ‘¨β€πŸ’»5πŸ†1
Discover the SAMformer framework, an innovative approach to overcoming traditional Transformer limitations in long-term multivariate time series forecasting. By leveraging a shallow architecture, SAMformer reduces computational complexity and addresses overfitting. The core feature, Sharpness-Aware Minimization (SAM), enhances model robustness against parameter variations, significantly improving prediction quality. SAMformer's high accuracy with fewer parameters supports efficient deployment in resource-limited environments, finding applications in finance, healthcare, and more. Recently, SAM optimization was integrated into the convolutional layer, simplifying implementation while retaining functionality. This progress marks a significant step toward advanced, scalable Transformer models.

πŸ‘‰ Read | Freelance | @mql5dev

#MQL5 #MT5 #AITrading
❀66πŸ‘7πŸ‘¨β€πŸ’»7😈2
Discover an innovative approach to market analysis through the lens of language and AI. Our study transforms price movements into binary sequences, then into mnemonic phrases using the BIP39 protocol, akin to cryptocurrency wallets. By applying a transformer architecture typically used in natural language processing, we develop a system to translate market data into human-readable language. This method captures hidden market patterns, achieving noteworthy prediction accuracy. Our findings suggest the market speaks a nuanced "language" with its vocabulary, providing unique insights for traders and developers. This groundbreaking approach opens new avenues for understanding and engaging with financial markets.

πŸ‘‰ Read | Forum | @mql5dev

#MQL5 #MT5 #AITrading
❀37πŸŽ‰3πŸ‘¨β€πŸ’»3πŸ‘2
Explore the innovative Market DNA concept, which creates a unique price-action signature for each currency pair, using metrics like volatility and session rhythms. The MQL5 implementation builds a "DNA passport" on MetaTrader 5, compressing market data into actionable insights. This robust system quantifies market regimes, aids in strategic adaptation, and flags significant shifts through mutation detection. Designed for both developers and traders, it automates analysis, enhances decision-making, and records signals for further use. By integrating Market DNA into trading workflows, gain a strategic edge with data-driven adaptability, consistent entries, risk-aware sizing, and efficiency in trade selection.

πŸ‘‰ Read | Signals | @mql5dev

#MQL5 #MT5 #AITrading
❀32πŸŽ‰4🀯1πŸ‘¨β€πŸ’»1
ETARE presents a modern approach to algorithmic trading by integrating genetic optimization, machine learning, and advanced risk management. This system continually adapts to market conditions through an innovative trading loop, periodically refining strategies every 50 trades. Each trading instrument receives individual analysis based on recent data, ensuring precise position management. The strategies employ a descending volume approach to manage risk and maximize profits. A comprehensive trading decisions database ensures continuous learning, allowing the system to optimize for future trades. Through rigorous testing, ETARE has demonstrated adaptability across various market conditions, embodying a resilient and evolving trading system.

πŸ‘‰ Read | NeuroBook | @mql5dev

#MQL5 #MT5 #AITrading
❀64πŸ‘6πŸ‘Œ6πŸ‘¨β€πŸ’»4😁1
In our previous technical development updates, we integrated an advanced ChatGPT module into MetaTrader 5 using MQL5, enhancing the user interface with scrollable chat and timestamp features. This time, our focus shifts to overcoming multiline input limitations and ensuring efficient chat history storage using AES256 encryption and ZIP compression.

Implementation involves refining multiline text rendering, integrating a sidebar for navigating preserved chat histories, and leveraging AI for real-time trade signal generation. We've modularized our MQL5 code and enhanced the bitmap handling, ensuring a seamless integration of UI elements like scalable icons and images.

Additionally, we improved prompt handling to accept multiline inputs effectively, using logic to append or create new paragraphs based on user input. This is crucial for detailed market queri...

πŸ‘‰ Read | Signals | @mql5dev

#MQL5 #MT5 #AITrading
❀48πŸ‘10πŸ‘¨β€πŸ’»4πŸ‘Œ2
In this update of our AI-powered trading system in MQL5, we've focused on further modularization and the automation of trading functionalities. The UI components have been separated into a dedicated include file, enhancing code cleanliness and maintainability. This also streamlines development, testing, and integration of new features like dynamic UIs and automatic signal execution.

Automatic signal checks have been implemented for new bars, enabling trade execution based on AI-generated signals parsed from JSON input. These signals outline entry points and Stop-Loss/Take-Profit levels, offering a clear trading strategy devoid of emotional biases, and improving efficiency.

Our visualization system now signals patterns like engulfing or divergences on charts using arrows, lines, and labels, facilitating clear pattern recognition. We've also implemen...

πŸ‘‰ Read | NeuroBook | @mql5dev

#MQL5 #MT5 #AITrading
❀58😁5πŸ’”5πŸ”₯4πŸŽ‰3⚑2πŸ‘Œ1
Explore an advanced AI-powered trading system in MQL5 with enhanced UI features. This includes loading animations for smoother interactions during API requests, precision in response timing, and intuitive response management tools like regenerate and export buttons. The implementation focuses on scalable, modular code, using clear rendering techniques for icons and dynamic updates without affecting core functionalities. Practical for developers, the upgrades facilitate better user engagement and streamlined trading operations. Future enhancements will include sentiment analysis and multi-timeframe signal confirmations for more informed trading decisions.

πŸ‘‰ Read | Quotes | @mql5dev

#MQL5 #MT5 #AITrading
❀30⚑7✍3πŸ‘2πŸ‘€2😱1πŸ‘Œ1
Trend-following labels are built from smoothed price direction rather than deviation: a Savitzky–Golay filter reduces noise, the gradient defines trend sign, and the signal is normalized by rolling volatility with a threshold to ignore weak moves.

Several labelers extend this baseline: β€œprofit-only” sampling keeps trades only if a random future horizon meets a net-profit requirement after spread/fees, and smoothing can be swapped (Savitzky–Golay, SMA, EMA, spline) or combined across multiple periods to confirm direction without conflicting signals.

Training uses two models: one predicts buy/sell, the other predicts tradable regimes. β€œNo-trade” labels are routed into the regime model instead of being dropped, preserving information and filtering bad entry points. Results show trend models generalize poorly on EURUSD; complexity reduction and tight sto...

πŸ‘‰ Read | Forum | @mql5dev

#MQL5 #MT5 #AITrading
❀42πŸ‘3πŸ‘Œ1
Backtests were run on EURUSD and GBPUSD from 01/03/2025 to 20/01/2026 on M5, with ONNX training targeted at M5–M15 behavior.

SidewaysMartingale is an Expert Advisor focused on range-bound execution with martingale recovery, gated by an ONNX-based regime classifier. The model outputs probabilities for sideways, bullish, and bearish states. Trading is enabled only when prob_side exceeds a configured threshold.

Model inputs use 9 engineered features: EMA200 slope, price distance to EMA200, ATR, range/ATR, breakout pressure, body dominance, day-of-week, hour-of-day, and previous candle direction.

Entries use Envelopes extremes: buys near the lower band and sells near the upper band, only under sideways confirmation. Martingale scaling is distance-based with capped series length and lot multiplier. A safety filter blocks new martingale legs when prob_bul...

πŸ‘‰ Read | AppStore | @mql5dev

#MQL5 #MT5 #AITrading
❀44πŸ‘€2πŸ‘Œ1
Markets often look random, but chaos theory frames them as systems with hidden structure: mean reversion, sensitivity to initial conditions, and fractal self-similarity across timeframes.

The article builds a MetaTrader-style Neural Attractor Oscillator: a small feedforward network trained on price history, using tanh for bipolar dynamics and normalization for stable learning. It predicts a moving β€œattractor” level, then outputs an oscillator as percent deviation from that attractor to flag overextension and potential snap-back.

Signal quality is gated by a Lyapunov exponent to quantify how chaotic the market is, with optional fractal noise (Midpoint Displacement) and momentum optimization to improve training. Practical use includes adaptive overbought/oversold bands, divergence detection, and smoothing choices (EMA/SMA) based on regime.

πŸ‘‰ Read | AppStore | @mql5dev

#MQL5 #MT5 #AITrading
❀29✍2πŸ‘Œ2πŸ‘€2πŸ€”1🀩1
Machine learning trading research benefits from consistent structure: reproducibility, traceability, cache efficiency, validation gates, and automatic documentation. Without this, results become non-auditable as data, features, and parameters drift across experiments.

A production-grade pipeline standardizes the path from tick ingestion to deployable ONNX artifacts for MetaTrader 5. Key elements include time-aware caching to prevent leakage, dependency-based cache invalidation, structured experiment storage keyed by configuration, and logs plus reports generated at each stage.

A practical data architecture keeps ticks in session RAM while persisting derived bars and features in Parquet. This reduces duplication, improves iteration speed, and stabilizes schemas compared with CSV workflows. ONNX export should be blocked unless runtime predictions ma...

πŸ‘‰ Read | AlgoBook | @mql5dev

#MQL5 #MT5 #AITrading
❀28πŸ‘Œ3
Tree-based classifiers often output overconfident probabilities, especially in noisy financial labels, so accuracy can look acceptable while probability estimates are systematically too extreme. That miscalibration feeds directly into bet sizing and Kelly-style sizing, creating oversized positions, deeper drawdowns, and weaker geometric growth.

Calibration is evaluated with reliability diagrams plus Brier score (overall usefulness), ECE (average gap), and MCE (worst-case tail risk), with bootstrap confidence bands to reflect limited independent samples.

Two practical calibrators are compared: isotonic regression (non-parametric, rank-preserving, best with enough data) and Platt scaling (sigmoid, steadier with small samples but less flexible).

The key engineering constraint is avoiding temporal leakage. Calibration is fit on out-of-fold predictions p...

πŸ‘‰ Read | NeuroBook | @mql5dev

#MQL5 #MT5 #AITrading
❀36
GoertzelBrain tackles the main weakness of classic cycle detection: knowing a dominant period and amplitude still doesn’t answer β€œlong or short” in non-stationary markets. It keeps Goertzel’s efficient single-frequency DFT, but adds context with a self-training neural ensemble.

Per bar, it builds a 7-feature vector from spectrum state (dominant period, amplitude, normalized confidence), spectral dynamics (period/amplitude slopes), plus price slope and volatility. Ten small MLPs (7-12-1) train online via single-sample SGD and are averaged to reduce instability.

The output becomes a directional filter: long only when the ensemble is above zero and rising; short when below zero and falling. A hidden buffer is exposed via iCustom() for EA integration, with careful heap allocation to avoid GoertzelCycle pointer lifetime bugs.

πŸ‘‰ Read | Quotes | @mql5dev

#MQL5 #MT5 #AITrading
❀25πŸ‘Œ6
Local voice control for MetaTrader 5 can be built without cloud APIs or fragile file polling by combining offline speech recognition with localhost HTTP.

The design splits into three simple processes: a Python listener using Vosk with a restricted grammar and wake-word gating, an MQL5 EA that polls GET /command via WebRequest and executes BUY/SELL/CLOSE actions, and a separate Flask TTS server that speaks confirmations through Windows System.Speech.

Key engineering choices improve reliability: command delivery is one-shot (served then cleared), wake phrase + next-utterance prevents accidental trades, and TTS uses a queued worker so the EA never blocks. Result: low-latency, bidirectional β€œspeak-trade-confirm” interaction suitable for hands-free trading and rapid setup execution.

πŸ‘‰ Read | Freelance | @mql5dev

#MQL5 #MT5 #AITrading
❀29πŸ‘Œ3πŸ‘2
This article demonstrates how to turn MetaTrader 5 into a lightweight visualization runtime using the MQL5 canvas, not indicator buffers. The focus is rendering a parametric butterfly curve with a clean math-style presentation inside a draggable, resizable floating panel.

Key techniques include supersampling via an offscreen high-resolution canvas and manual downsampling with per-pixel ARGB averaging for smooth anti-aliased curves. The plot adds a gradient background, axis grid with readable tick generation, rotated labels, and a four-segment color legend to show how the curve builds over 0..12Ο€.

The implementation also covers practical UI mechanics: hit-testing header and resize zones, clamped resizing to chart bounds, synchronized layer updates across multiple canvases, and redraw orchestration for responsive in-terminal tools.

πŸ‘‰ Read | Quotes | @mql5dev

#MQL5 #MT5 #AITrading
❀18πŸ‘3πŸ‘Œ3
This article shifts from 1D quote series to image-based market representation, encoding price, indicators, oscillators, and candlestick anatomy into 128x128 multi-channel frames. The goal is to let CNNs detect chart structures as visual textures rather than isolated numbers.

The model uses three parallel convolution paths (short-term moves, longer trends, volatility/momentum), then applies attention to suppress noise and emphasize decisive regions. A bidirectional LSTM adds temporal context, and multi-task training predicts both direction and move magnitude.

A key contribution is interpretability: attention heatmaps and neuron activation analysis expose what drove a signal (reversal zones, RSI/price divergences). RobustScaler, Gaussian blur, and training callbacks improve stability, with a roadmap toward multimodal news+macro inputs, multi-timefra...

πŸ‘‰ Read | Docs | @mql5dev

#MQL5 #MT5 #AITrading
❀46πŸ‘Œ4🀣2
Prime Quantum AI is an MT5 Expert Advisor that combines a classical trend pre-filter (ADX + Alligator with DI+/DI-) with vision-based chart analysis via external AI providers.

The decision flow is two-stage. On each tick, the selected timeframe is checked for a bullish or bearish trend setup using configurable ADX thresholds and Alligator alignment. If a signal is present, the EA captures three screenshots (entry, mid, context) from adaptive timeframes derived from the TF input and submits them to the chosen provider.

The provider returns JSON: direction, confidence (0–100), stop-loss, take-profit, and reasoning. Orders are placed only when AI direction matches the pre-filter and confidence exceeds the minimum threshold, with scan cooldown controlled by InpScanIntervalSec.

Operational notes include multiple risk modes, AI or fixed SL/TP options, ATR trail...

πŸ‘‰ Read | AppStore | @mql5dev

#MQL5 #MT5 #AITrading
❀24πŸ‘8πŸ‘Œ2πŸŽ‰1
Part 3 ported Python get_time_features into MQL5 as CTimeFeatures.mqh, producing a flat double array with Python-identical feature order and names for direct OnnxRun input.

Key MQL5 issues addressed: broker time vs UTC, incremental rolling volatility, and a timeframe-driven frequency gate that must match the feature-name registry. UTC is derived once at init via TimeCurrent()-TimeGMT(); this fixes systematic session misclassification but cannot track mid-run DST shifts.

Architecture: CTimeFeatures exposes Initialize/Update/Calculate, backed by CRingBuffer for population std (ddof=0) and forward-filled session/calendar vol. Session detection handles cross-midnight Sydney via OR logic. Day-of-week and day-of-year are re-indexed to match pandas conventions.

Frequency gating uses PeriodSeconds to support custom periods; calendar flags appear only for D...

πŸ‘‰ Read | Quotes | @mql5dev

#MQL5 #MT5 #AITrading
❀25πŸ‘5πŸ‘Œ2