MQL5 Algo Trading
527K subscribers
3.66K photos
5 videos
3.67K 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
The key new feature of MetaTrader 5 Build 6060 is built-in support for the Model Context Protocol (MCP) and agentic AI.

The terminal and MetaEditor now include an integrated AI Assistant that can help analyze markets and trading activity, develop MQL5 applications, explain code, identify errors, and automate complex tasks.

Another important addition is Passkey support β€” a modern technology for securing trading accounts. Passkeys provide an additional authentication factor during sign-in, protecting users against phishing attacks and unauthorized access.

For developers, we've significantly enhanced MetaEditor. The editor now includes the long-awaited code folding and 'highlight all occurrences' features, making it much easier to work with large projects.

Learn more...
πŸ‘14❀6πŸ‘Œ2
Multi-symbol EAs often call SymbolInfoDouble(), SymbolInfoInteger(), and related functions on every tick for every tracked instrument. At 20 symbols, 10 ticks/sec, and 4 properties, that is 800 terminal lookups per second. These lookups cross into terminal internals and add measurable latency at scale.

A dedicated metadata cache removes repeated reads of static contract and session data. CSymbolMetaCache fetches per-symbol specification and weekly trading sessions once during Init(), serves typed getters from memory, and evaluates IsMarketOpen() via cached session windows without touching the terminal API.

Refresh becomes the only post-init API touch point, typically scheduled daily around server midnight. Static fields are safe to cache; dynamic fields like bid/ask/spread are not. Tick value is static only when profit currency matches account currency; othe...

πŸ‘‰ Read | Signals | @mql5dev
❀11πŸ‘4⚑1πŸ‘Œ1
A revived MT5 trading robot is rebuilt as a hybrid system: Python handles data pipelines, feature building, model training, and signal generation, while MetaTrader 5 executes trades via the Python API. Multithreading assigns each symbol its own model context to avoid sequential bottlenecks when trading portfolios.

The design adds portfolio-level risk control with a global TOTAL_PORTFOLIO_RISK so position sizing depends on both instrument volatility and existing exposure across symbols.

Core infrastructure focuses on reliability: queued logging with a dedicated printer thread for readable multithreaded diagnostics, and market-data retrieval with retry windows to survive broker outages.

The ML pipeline expands limited history using noise, time shifts, scaling, and price inversion with robust NaN/inf cleaning. Labels range from simple forward moves to ...

πŸ‘‰ Read | Quotes | @mql5dev
❀16πŸ‘11πŸ†2πŸ‘Œ1
Backtest profitability often collapses live due to execution costs, not logic errors. Spread, slippage, and commissions accumulate, especially in high-frequency systems with small average wins.

An MT5-native MQL5 analyzer can quantify this risk from closing-deal CSV data (date, result, volume). It applies a linear cost model per deal: Fixed + (CostPerLot * Volume), then recomputes net profit and profit factor across rising cost multipliers.

Key outputs: breakeven cost per deal, cushion (net profit divided by assumed total cost), retention, profit factor after costs, win erosion (winners that flip), thin-winner share, plus a composite A+ to F robustness grade with recommendations.

πŸ‘‰ Read | CodeBase | @mql5dev
❀16πŸ‘10⚑2πŸ‘Œ1
Part 2 extends an Ehlers-style DSP stack from β€œdetect regime” to β€œadapt parameters” and β€œconsume modules deterministically” in an MT5 EA. All logic runs on closed bars, filters are replayed from history, and modules expose stable accessors like Ready(), Value(), InPhase(), Quadrature().

CyclePeriod uses an Ehlers Hilbert-transform homodyne discriminator to estimate dominant period in bars, with clamp limits (6–50, +/-50% step) and double smoothing to control noise. The same engine feeds MAMA/FAMA by computing phase from I/Q components and making EMA alpha adaptive via deltaPhase, bounded by FastLimit/SlowLimit.

A regime-switching EA classifies trend vs cycle (via Even Better Sinewave) and applies separate playbooks, validated in Strategy Tester with real ticks as an engineering demonstration, not a profit claim.

πŸ‘‰ Read | NeuroBook | @mql5dev
❀41πŸ‘3πŸ‘Œ2πŸ‘€2
Tool logic is built around a 25 EMA centerline plus volatility envelopes. Price near the EMA implies neutral conditions. Pushes into upper red/orange bands signal overextension; moves into lower blue/violet bands signal underpricing. Bands are spaced in fixed 0.1% steps, giving a consistent deviation map.

A 7-timeframe scanner (1M through Daily) produces a consensus bias. Higher timeframes define the primary direction, while lower timeframes identify pullbacks or short-lived counter moves. ADX acts as a filter: weak ADX supports range behavior; strong ADX signals trend strength and reduces the quality of reversal entries.

Classical usage falls into three cases. Trend continuation: strong bullish/bearish consensus, then enter on a pullback into outer bands aligned with the macro trend. Mean reversion: mixed consensus plus weak ADX, then fade extreme d...

πŸ‘‰ Read | CodeBase | @mql5dev
❀21πŸ‘12πŸ‘Œ2πŸŽ‰1πŸ‘¨β€πŸ’»1
A modular MQL5 multi-symbol trading panel streamlines portfolio management from a single chart, removing repeated chart switching and context-menu actions. It supports per-symbol Buy/Sell, close by symbol or globally, one-click closing of winners/losers, and bulk SL/TP updates, while showing live account stats and floating P/L.

The design separates responsibilities: CSymbolManager parses and validates a comma-separated symbol list, ensures symbols exist and are selected in Market Watch. CTradeManager wraps execution via CTrade/CPositionInfo, filters by magic number, iterates positions safely in reverse, and exposes aggregated profit/position metrics. CPanel builds UI objects with a consistent prefix, updates values without recreating controls, and routes chart events to trading actions through small parsing helpers, keeping the EA focused on lifecycle and...

πŸ‘‰ Read | NeuroBook | @mql5dev
❀17πŸ‘9πŸ‘Œ1
Correlation becomes actionable only when it’s measured: it determines whether multiple trades are independent bets or the same exposure repeated across symbols. Portfolio risk is not the sum of individual risks; pairwise correlations add interaction terms that can inflate or reduce total variance.

The article breaks risk into diversifiable (instrument-specific) and systematic (shared) components, then uses Pearson correlation and a covariance matrix to compute correlation-adjusted portfolio risk. Examples show identical 1% positions ranging from ~0.45% to ~1.95% combined risk depending only on correlation.

Two MT5 programs implement this: a script that reads open positions, pulls recent H1 data, builds the covariance matrix, and prints naive vs true risk plus a β€œhidden factor”; and a background service that continuously monitors, displays a compact pa...

πŸ‘‰ Read | AlgoBook | @mql5dev
❀23πŸ‘6😁2πŸ‘Œ2
A modified Dingo Optimization Algorithm (DOAm) is presented as a response to the question of whether population-based metaheuristics can reach consistent 100% outcomes under a hard cap of 10,000 iterations.

Key changes target update stability and search freedom. Group attack switches from subtracting to adding the best solution and normalizes sumAttack by (na * coords). Survival activation is tightened from <= 0.3 to <= 0.01. Scavenging removes abs(), allowing negative moves, and averages displacement across all dimensions.

Implementation follows a C_AO base class with popSize=50, P=0.5, Q=0.7, and methods Init, Moving, Revision plus helpers for attack vector selection, attack sum, chase, scavenging, and survival updates.

πŸ‘‰ Read | VPS | @mql5dev
❀17πŸ‘3πŸ‘Œ3
Modern trading stacks often accumulate correlated, lagging signals. A proposed alternative pairs a Discrete Fourier Transform cycle decoder with a Leaky Integrate-and-Fire Spiking Neural Network to isolate dominant market frequencies and add time-based confirmation.

The DFT decomposes rolling price or indicator series (e.g., RSI, MACD) into frequency components, selects the dominant harmonic by amplitude, and projects a normalized cycle state used as a turning-point candidate.

The SNN consumes Fourier, RSI, and MACD inputs as synaptic currents. Membrane potential accumulates across bars, decays via a leak factor, and triggers execution only when a fixed threshold is reached, then resets.

Implementation notes in MQL5 emphasize mode isolation for debugging, bar-close evaluation to reduce noise, and a procedural core using CTrade/CSymbolInfo without the CExpert fra...

πŸ‘‰ Read | Signals | @mql5dev
❀34πŸ‘12πŸ‘Œ2πŸ‘¨β€πŸ’»2😁1
A flicker-free vector GUI renders the full dashboard to a single-frame bitmap canvas, with auto-resize and high-DPI scaling designed to avoid terminal lag.

A vertical, scrollable monthly calendar grid tracks results with cyan win days and red loss days, using mouse-wheel scrolling for rapid navigation.

Trade execution history is shown as scrollable log cards with grades and an editable notes workflow via an on-chart pencil control.

Behavioral diagnostics detect and flag revenge trading, FOMO entries, panic liquidations, and discipline failures such as stop-loss widening mid-trade.

The quantitative layer computes Sharpe, Sortino, Calmar, Ulcer Index, and SQN, separated into Long and Short profiles. A 1,000-path Monte Carlo bootstrap projects drawdown paths and estimates Risk of Ruin, with a cooperative task scheduler to time-slice heavy scans. No...

πŸ‘‰ Read | Quotes | @mql5dev
❀12πŸ‘8πŸ‘Œ3πŸ‘¨β€πŸ’»2
A modified brute-force research tool for MT5 shifts focus from manual EA tuning to automated pattern search across currency pairs. The goal is to evaluate robustness on larger history windows and compare results between short and long samples, where overfitting risk rises as the sample shrinks.

Key upgrade: a linearity-based filter that scores equity-curve smoothness, reducing the need for visual screening. It costs roughly 2x runtime due to a second pass, but improves the quality of candidates carried into later filtering stages.

The signal model moves from boolean rule sets to a single polynomial that outputs a signed, continuous β€œsignal strength.” The polynomial now uses full OHLC-derived bar components (not just Close-Open), enabling richer feature combinations while keeping degrees low for tractability. The template code was updated to accept ...

πŸ‘‰ Read | NeuroBook | @mql5dev
❀32πŸ‘6πŸ‘Ύ5πŸ‘Œ3✍2πŸ‘¨β€πŸ’»1
A trend indicator based on confirmed swing highs/lows builds a weighted pivot center, then applies an ATR-adaptive trailing band around that center to classify direction. Bullish state is shown via the bullish trail color; bearish state via the bearish trail color. Direction changes can print BUY/SELL tags and trigger terminal, push, or email alerts.

Options include swing markers, pivot center line, latest confirmed support/resistance, closed-candle vs live-candle alerts, and EA-accessible buffers for trend and signals.

Signal rules: BUY on a flip from -1 to 1; SELL on a flip from 1 to -1. Reliability improves when validated on candle close, with price holding on the correct side of the trail and alignment to a higher timeframe.

Typical usage: M15/M30 intraday, H1/H4 swing, D1 long-term. H1 often balances noise and responsiveness; lower timeframes increa...

πŸ‘‰ Read | Forum | @mql5dev
❀14πŸ‘5⚑1πŸ‘¨β€πŸ’»1
Multi-timeframe SMMA dashboards address a common limitation of single moving averages: one timeframe can appear bullish while the higher-timeframe structure stays bearish. Displaying M15, H1, H4 and other SMMAs side by side clarifies alignment and reduces false reads.

Typical interpretations are straightforward. Price above multiple timeframe SMMAs suggests broad bullish conditions. Price below them suggests broad bearish conditions. Mixed positioning often signals a pullback within the dominant trend rather than a confirmed reversal. A large gap to a higher-timeframe SMMA can flag extension and higher odds of consolidation or mean reversion. Distance values also quantify proximity to dynamic support or resistance.

These tools are practical for trend, intraday, swing, and pullback traders, and can simplify MA context for less experienced users. For a...

πŸ‘‰ Read | Freelance | @mql5dev
❀13πŸ‘4✍2
A volume-state candle dashboard can quantify how much activity sits behind each candle and whether the result is meaningfully bullish or bearish. It separates typical participation from unusually high or low volume, strong buy-side or sell-side effort, and special cases such as climax volume and absorption where activity is high but net price progress is limited.

A large bullish candle on high relative volume tends to support genuine buying. A small-range candle on very high volume can signal absorption and a potential turning area.

Common use cases include price-action confirmation, validating breakout participation, spotting reversal conditions near support and resistance, and fast context for intraday trading. It applies to tick volume on FX/CFDs and real volume where available in crypto, equities, and futures. It should remain a confirmation laye...

πŸ‘‰ Read | Freelance | @mql5dev
❀14πŸ‘5
MQL5 services in MetaTrader consolidate three monetization paths for traders and developers: Signals subscriptions, a Market for EAs and utilities, and a Freelance order book. Access is integrated into the terminal, with public stats, distribution by symbols, and risk/slippage warnings supporting selection and due diligence.

Signals enable deal copying via fixed-fee subscriptions. Copy accuracy is typically higher when provider and subscriber accounts use the same broker. Providers can publish track records and monetize distribution at scale, including VPS-based execution for continuous operation.

The Market lists 20,000+ products with encrypted EX4/EX5 delivery, automated settlements, and multi-activation licensing. Built-in VPS can be hosted near broker servers to reduce latency, relevant for scalping and arbitrage.

Freelance offers structured co...

πŸ‘‰ Read | CodeBase | @mql5dev
πŸ‘6❀5