MQL5 Algo Trading
490K subscribers
3.11K photos
3.11K 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
Source text is missing.

Send the text to convert, and include any platform constraint (X/Twitter, LinkedIn, Mastodon) plus a target length if different from 800 characters.

πŸ‘‰ Read | Signals | @mql5dev

#MQL5 #MT5 Please paste the post text (or upload an image of it). I need the content to generate 2 relevant hashtags.
❀21πŸ‘Œ11🀣3😁2
An MQL5 panel for MetaTrader 5 was built to estimate β€œfair” FX rates from a currency matrix and to flag deviations versus live quotes.

The model derives cross-rates via multiple triangular paths, applies iterative convergence with weighted updates, and uses an arbitrage threshold to filter spread-driven noise. Output includes deviation signals, candidate triangles, and a live-updating matrix view.

Limits are noted upfront: broker quote coverage, latency, and execution constraints make it non-competitive with co-located hedge-fund infrastructure. Current status is demo-only, with a robot under development and validation pending on real trading conditions.

πŸ‘‰ Read | NeuroBook | @mql5dev

#MQL5 #MT5 #AlgoTrading
❀21✍4
A Python-based Strategy Tester is extended toward MetaTrader 5 parity by adding sequential tick/bar playback, account and position monitoring, and reportable performance analytics.

Configuration is moved into JSON to mirror MT5 settings (symbols, timeframe, date range, modelling, deposit/leverage). The tester validates required keys and datatypes to prevent silent misconfiguration.

Four modelling modes are implemented: real broker ticks, synthetic ticks generated from M1 bars, new-bar execution (fast, least granular), and 1-minute OHLC (speed/accuracy compromise). A unified OnTick loop calls the EA callback per tick or per bar-open, while updating orders, positions, and account state.

The tester logs orders and deals, then produces an HTML report with core metrics (profit, win rates, drawdown, factors) and plots balance/equity curves, enabling practical st...

πŸ‘‰ Read | NeuroBook | @mql5dev

#MQL5 #MT5 #Strategy
❀39
Market Memory Zones standardizes price-level detection using objective zone types instead of subjective support/resistance markup.

Three core classifications are used: displacement zones from ATR-multiple impulsive candles with low overlap, structure transition zones from CHoCH-style swing breaks, and liquidity sweep origin zones from stop-run candles followed by reversal. Optional unfilled/inefficiency zones cover gap-like imbalances.

Implementation is object-driven: rectangles rendered in-chart, no indicator plots. Configuration includes detection timeframe, lookback, ATR multiplier, per-zone toggles, optional volume filter, max active zones, opacity, and forward extension.

Core design elements include a ZONE_TYPE enum, a MemoryZone struct (range, time, type, strength, mitigation checks), lifecycle hooks for init/deinit, new-bar processing, and zo...

πŸ‘‰ Read | Docs | @mql5dev

#MQL5 #MT5 #Indicator
❀29πŸ”₯4πŸ‘Œ3πŸ‘€3πŸ‘2
Cointegration and correlation can persist long enough to trade, but relationships decay. Most failures are progressive and can be monitored with rolling tools such as RWEC and IS/OOS ADF.

Some breaks are abrupt. A single event can flip hedge ratios and correlations across FX, commodities, and equities. In econometrics this is a structural break: regression parameters change in a way the model does not anticipate.

Example: NVDA/INTC after the Sep 18, 2025 partnership announcement. Correlation moved from about -0.71 to +0.75, invalidating any portfolio assuming a stable beta. RWEC can flag instability ahead of the event, but it cannot confirm permanence.

Chow tests are designed for confirmation when a candidate breakpoint is known. They compare pre-break, post-break, and full-sample regressions; large F-stat and near-zero p-value indicate a regime c...

πŸ‘‰ Read | VPS | @mql5dev

#MQL5 #MT5 #AlgoTrading
❀26✍6πŸ‘Œ2⚑1
GSM++ reframes graph learning as a sequence problem: tokenize the graph, encode local neighborhoods, then model global dependencies. The key idea is hierarchical tokenization that preserves topology and time while shortening sequences, with optional Mix of Tokenization to select the best view per node.

The framework clarifies when architectures win: transformers handle connectivity and global context efficiently, RNNs fit localized structure and streaming, and hybrids balance both; poor ordering can cause information loss in the middle of sequences.

The MQL5 implementation adapts this to candlestick data by skipping similarity clustering and using trainable bar tokenizers. Four token types (node, edge, subgraph, unit sequences) are fused via attention pooling in a reusable CNeuronMoT module, improving feature selection for trading signals.

πŸ‘‰ Read | NeuroBook | @mql5dev

#MQL5 #MT5 #AlgoTrading
❀48πŸ†3πŸ‘Œ2
A simple hotkey setup can cycle through symbols in the Market Watch list.

Comma (,) selects the previous symbol. Period (.) selects the next symbol. The handler typically maps these keys to keycodes 188 and 190, often implemented as switch cases such as case 188 and case 190.

To change the defaults, look up the desired key’s keycode and replace the numeric values in those cases. Ensure the chosen keys do not conflict with existing platform shortcuts and are consistently handled for keydown events.

πŸ‘‰ Read | VPS | @mql5dev

#MQL4 #MT4 #script
❀32πŸ‘Œ3
Faster delivery rarely comes from typing speed. It comes from fewer bugs, predictable architecture, and a repeatable workflow.

Coder and developer roles differ. Developers own design, planning, implementation, and maintenance. Coders typically implement scoped changes without full system context.

Key levers: enforce consistent naming and structure to reduce rework; debug quickly using formatting tools, targeted logging, and controlled changes; use libraries as designed instead of re-implementing utilities; split complex logic into small functions to keep code readable.

Operational habits matter. Minimize distractions, read documentation instead of copy-pasting, and apply spaced repetition to retain critical patterns.

MetaEditor setup and keyboard shortcuts reduce friction, including compile, navigation, search, and debug controls.

πŸ‘‰ Read | AlgoBook | @mql5dev

#MQL5 #MT5 #AlgoTrading
❀52πŸ‘9πŸ‘Œ7⚑5✍1🀯1πŸ†1
Momentum deviation can be applied to build deviation bands around a momentum series, forming an indicator conceptually comparable to Bollinger Bands but based on momentum statistics rather than price volatility.

The bands are derived from momentum with a deviation measure that expands and contracts as momentum dispersion changes. This makes the envelope responsive to shifts in acceleration and deceleration.

Operationally, it can be used in a similar manner to Bollinger Bands: monitoring momentum moves toward or beyond the outer bands for potential mean-reversion setups, and watching sustained runs near a band as a sign of persistent directional pressure.

πŸ‘‰ Read | Quotes | @mql5dev

#MQL5 #MT5 #Indicator
❀36πŸ‘3⚑2πŸ‘Œ2
MQL5 forum traffic highlights recurring issues among newer developers: inconsistent implementation, high bug rates, and unstable expectations about β€œcorrect” patterns.

Key habits to drop: fixating on past releases and reviews, seeking constant validation instead of testing and debugging, and assuming others must code the same way.

Progress tends to improve when developers shift from only consuming code to contributing fixes and answers, and when they share minimal reproducible examples rather than withholding context. Open collaboration and selective openness can shorten debug cycles and raise code quality.

πŸ‘‰ Read | Forum | @mql5dev

#MQL5 #MT5 #EA
❀76✍6πŸ‘Œ1
Larry Williams Outside Bar EA with an ONNX-based AI filter combines deterministic candle rules with probabilistic validation.

Startup requires the model file in MQL5/Files. Expected filename is larry_model.onnx (or the configured input). If the file is missing, initialization stops with INIT_FAILED.

Key inputs include Magic number, lot size, Risk/Reward ratio for TP vs SL distance, model filename, AI threshold (0.0–1.0), and ATR period used in feature generation.

On each new bar, an Outside Bar is detected when the current High exceeds the previous High and the current Low is below the previous Low. Signals trigger on close above the prior High for long, or close below the prior Low for short.

If triggered, 10 features are computed and sent to the ONNX model. Orders are placed only when Buy or Sell class probability exceeds the threshold. SL is set to th...

πŸ‘‰ Read | Docs | @mql5dev

#MQL5 #MT5 #EA
❀50πŸ‘8✍2
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
❀38πŸ‘2πŸ‘Œ1
Larry Williams’ Trade Day of the Week idea treats time as a measurable market condition: identical setups can have different odds depending on the weekday. The article tests this by isolating time as the only variable and comparing win rates per day.

A minimal MT5 research EA is built around a daily volatility breakout: compute yesterday’s range, project a buy level from today’s open, enter only on a clean 1‑minute crossover, and close at the next day’s open. No SL/TP or trade management to avoid masking weekday effects.

Implementation focuses on repeatability: new-day detection, a struct for range/level, safe position checks via magic number, and a switchable mode for baseline (all days) vs user-selected weekday filtering for controlled A/B testing.

πŸ‘‰ Read | Calendar | @mql5dev

#MQL5 #MT5 #EA
❀39πŸ‘Œ2
This article extends the Candle Pressure Index (CPI) into a session-aware framework: prior session highs/lows act as durable reference boundaries, and CPI helps decide whether a revisit is genuine acceptance (sustained closes beyond the level with aligned pressure) or rejection (a probe beyond the level that closes back inside with a pressure flip).

The MQL5 implementation builds Tokyo/London/New York windows in broker time, handles midnight-crossing sessions, and evaluates only closed candles for deterministic behavior in both live charts and historical reconstruction. Session ranges are computed by datetime filtering, with on-demand scans to prevent the evaluation candles from contaminating the level being tested.

Signals use a two-candle model: breakout acceptance requires a CPI-validated close beyond the boundary plus a retest/hold; rejection req...

πŸ‘‰ Read | Docs | @mql5dev

#MQL5 #MT5 #Indicator
❀34πŸ”₯3πŸ‘Œ3✍1πŸ‘€1
Part 3 completes the core CRiskManagement class for MetaTrader 5, moving from UI to a modular engine in Risk_Management.mqh that tracks losses/profits and enforces limits.

The design centers on clear enums and a Loss_Profit structure supporting fixed-money or percentage-based limits, with selectable reference metrics (balance, equity, free margin, net profit). It models daily/weekly/total loss caps, per-trade risk, and daily profit targets, plus prop-firm rules where daily loss is evaluated dynamically against equity and can expand with intraday gains (FTMO-style).

Implementation details include a CTrade wrapper, magic-number scoping, profit time windows, and lifecycle-safe constructor/destructor. Initialization and setters configure stop loss, calculation modes, and percentage application, enabling lot sizing from per-trade risk and optionally stop-...

πŸ‘‰ Read | Signals | @mql5dev

#MQL5 #MT5 #RiskMgmt
❀30πŸ‘7πŸ‘Œ1
Part 13 replaces native chart objects with a CCanvas-based price dashboard in MQL5, combining a live mini-graph and an optional stats panel in compact, movable UI blocks.

The design focuses on interaction: mouse-driven dragging, edge/grip resizing with hover feedback, minimize/maximize controls, and dark/light theme switching. Panels redraw on new bars to keep price and account metrics current.

Implementation highlights include separate canvases for header/graph/stats, resource-backed bitmap backgrounds with opacity blending, and smooth bicubic image scaling. The graph plots recent closes with a filled line view and time labels, while the stats panel surfaces balance/equity and current bar OHLC for fast decision support.

πŸ‘‰ Read | CodeBase | @mql5dev

#MQL5 #MT5 #Indicator
❀42😁1
Multi-Mode Logarithmic Transform Indicator provides four calculation modes for price analysis using logarithmic transformations. It shifts the focus from absolute price levels to relative, percentage-based movement, improving comparability across assets with very different price scales and growth profiles.

Log Scale (Absolute) applies the natural log to the close, helping normalize exponential growth and reduce compression of older data on long histories. Trend structure reflects constant percentage change rather than constant currency increments.

Log Scale (Cumulative) builds a running sum of log returns to produce a growth curve starting from a common baseline. This supports ROI-style comparisons between instruments over the same window.

Log Returns (Difference) measures bar-to-bar momentum via the log close change. Log Volatility (Deviation) uses...

πŸ‘‰ Read | Docs | @mql5dev

#MQL5 #MT5 #Indicator
❀42πŸ‘8πŸ€”1
Transformers replace step-by-step recurrence with self-attention, enabling parallel training and better handling of long-range dependencies than classic RNN/LSTM pipelines. For market forecasting, the focus is the Temporal Fusion Transformer: a hybrid that combines LSTM sequence modeling with attention for multi-horizon, interpretable predictions.

The workflow pulls OHLCV data from MetaTrader 5, engineers time, trend, momentum, and volatility features, then builds a PyTorch Forecasting TimeSeriesDataSet with a strict time_idx and returns as the target. Training uses PyTorch Lightning with learning-rate search and validation against a naive β€œlast value” baseline.

Deployment wraps feature generation, training, and inference into a bot that retrains on schedule and trades from fresh predictions. Key trade-offs: GPU-friendly but compute-heavy, data-hungry, and ...

πŸ‘‰ Read | Forum | @mql5dev

#MQL5 #MT5 #AI
❀38πŸ‘2πŸ‘Œ2
Wizard-generated multi-signal EAs can look correct in live execution but fail in the Strategy Tester due to structural issues: excessive signal voting, no market-regime awareness, and no limits on how often trades can be triggered.

The MetaQuotes signal modules are technically solid; the weakness is deployment. Fibonacci, MA, AC, and RSI each fit different conditions, yet the default design lets them vote continuously with equal weights, encouraging redundant confirmations and noisy flips between long/short.

Optimization here goes beyond parameter sweeps. Add governance layers without modifying library code: session/time filters, cooldowns, regime classification, conditional signal participation, and adaptive weighting. Then validate iteratively in the Tester with out-of-sample checks to reduce drawdown and overtrading without curve fitting.

πŸ‘‰ Read | Freelance | @mql5dev

#MQL5 #MT5 #EA
❀44πŸ‘3πŸŽ‰3πŸ‘Œ3πŸ†2
Part 6 extends an MQL5 RSI indicator into a configurable engine with multiple calculation variants and multi-timeframe alignment.

Supported RSI modes include classic plus Cuttler, Ehlers, Harris, quick, gradual, and RSX-style options. Inputs can be derived from close/open/high/low, composites, or internally smoothed OHLC. Pre-smoothing provides basic, growth-based, evened-out, and linear weighted averaging.

Visualization adds hue changes driven by direction, center, or boundary events. Boundaries can be static or dynamic using recent extremes. Multi-timeframe processing uses iCustom handles, buffer copying, and optional linear interpolation to align values across periods.

πŸ‘‰ Read | CodeBase | @mql5dev

#MQL5 #MT5 #Indicator
❀57⚑6πŸ‘€5πŸ‘Œ2
RiskSizer Panel Lite for MT5 is a compact chart panel focused on fixed-percentage risk sizing and fast manual execution. Lot size is estimated from a chosen Risk% of account balance, using two draggable horizontal chart lines (LOW/HIGH) as the SL/TP zone, with one-click BUY/SELL support.

For BUY: entry uses Ask, SL is LOW, TP is HIGH when HIGH is above Ask. For SELL: entry uses Bid, SL is HIGH, TP is LOW when LOW is below Bid. The panel shows spread, risk amount in account currency, calculated lots for both directions, and current line prices.

Controls include editable Risk% with configurable step buttons, a reset to restore default SL/TP distances, and an optional max-spread filter. Parameters cover risk step, default SL/TP points, max spread, deviation, magic number, and UI refresh rate. Lot sizing is approximate and balance-based; demo testing is recomme...

πŸ‘‰ Read | VPS | @mql5dev

#MQL5 #MT5 #EA
❀42⚑2πŸ‘Œ2