MQL5 Algo Trading
574K subscribers
4.45K photos
7 videos
4.46K 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
Market Behavior Analyzer is a chart indicator that converts swing movement into an explicit market-structure model. Instead of marking swing points only, it tracks the move between them and labels structure as HH, HL, LH, and LL. Each completed leg is measured in pips, with supporting metrics such as bar count and retracement percentage.

Two interactive panels are included. Market Story summarizes current structure and tags the latest leg as impulse or pullback. Swing Inspector enables selecting a swing point on-chart to view price, classification, leg length, duration, retracement, and adjacent swing relationships.

Key inputs cover lookback and swing validation: InpLookbackCandles, InpDepth, and InpMinDistPoints. Visual controls toggle lines and labels, adjust fonts and colors, and enable or disable each panel with configurable panel themes.

The to...

πŸ‘‰ Read | Calendar | @mql5dev
🀩15❀12πŸ‘8πŸ”₯6πŸ†4✍2πŸ‘Œ2
Prop Firm Daily Loss Tracker is an on-chart monitor for funded and prop firm accounts. It tracks daily loss consumption without generating trade signals or placing orders.

The panel displays day result in account currency, day start balance, current equity, percent of the daily loss limit used, remaining room for the day, and remaining room to the max total loss. A status line reports OK, WARNING, or LIMIT REACHED.

Day result is computed as the closed P/L for the day plus (equity - balance), excluding deposits and withdrawals. Daily limit is account size multiplied by the daily loss percent. The max loss floor is account size multiplied by (1 - max loss percent). The trading day rolls over at a configurable server hour.

Alerts can trigger once per day at the warning level and again at 100%, with optional push notifications. Settings also include pan...

πŸ‘‰ Read | AppStore | @mql5dev
❀23πŸ‘14πŸ”₯6🀩5πŸ‘Œ3
Edge or Luck evaluates closed trades from account history and estimates whether the average trade is distinguishable from chance. Net profit and profit factor describe outcomes, but not the probability that similar results arise randomly when the sample is small.

The script applies bootstrap resampling (Efron, 1979): it resamples the existing trades with replacement, matches the original trade count, computes an average, and repeats this 10,000 times. The central 95% of simulated averages forms a confidence band, while the fraction below zero estimates the probability that the true average trade is negative. No return distribution is assumed, which fits skewed trading results.

Interpretation: a band fully above zero suggests a detectable edge; including zero indicates luck remains plausible; fully below zero suggests underperformance. By default, fewer ...

πŸ‘‰ Read | Calendar | @mql5dev
❀18πŸ”₯10πŸ‘6🀩3πŸ‘Œ3
Arixis Market Regime Map is a market-state classification indicator for MetaTrader 5 focused on answering a single operational question: what regime is currently active. It avoids Buy/Sell signals and labels price behavior as Trend Up, Trend Down, Range, or Transition.

Classification is derived from quantitative inputs such as Efficiency Ratio, normalized directional slope, volatility, market structure, and agreement across multiple horizons. Efficiency Ratio compares net price displacement to total path length to separate directional movement from noise.

The tool uses causal, non-repainting calculations, includes hysteresis to limit regime churn, and provides historical visualization. A Regime Strength metric summarizes how strongly the measurements support the detected regime, without implying a probability or forecasting direction.

Intended use i...

πŸ‘‰ Read | AlgoBook | @mql5dev
❀17πŸ‘11πŸ”₯5🀩4πŸ‘Œ2
Killzones map repeatable intraday volatility windows: Asian range, London open, NY morning, lunch, and NY afternoon. The tool implements the commonly used ICT session schedule on MT5 and fixes a frequent issue on this platform: consistent time alignment across broker server clocks and DST changes (US and EU).

Five configurable session boxes are drawn with per-session names, colors, and NY-time inputs. Session pivots extend the high/low forward until traded through, with optional midpoints, labels, tooltip hit-rate stats, and a one-shot alert on level breaks. Prior day/week/month high, low, and midlines are included with the same statistics.

Key times add up to three NY-time markers, each with a vertical timestamp and optional opening-price line. Setup is driven by broker winter GMT offset and selected DST calendar; defaults target common GMT+2 winter...

πŸ‘‰ Read | AppStore | @mql5dev
❀24πŸ‘14🀩4πŸ”₯2πŸ‘Œ1
Backtest curves are not evidence. A reproducible workflow is required: formal rules, parameter ranges, and post-optimization validation before any live deployment.

A practical pipeline includes artifacts such as an indicator plus one or two EAs, explicit entry/exit and risk rules, in-sample vs forward splits with window criteria, and a stability search for parameter plateaus instead of single best runs.

Validation extends beyond one tester run: forward analysis on unseen data, multi-market and multi-timeframe checks, and clear thresholds for accept/reject and re-optimization cadence.

Example implementations in MQL5 cover PardoSystem (indicator) and PardoEA / Breakout_Bounce (EAs). The Pardo variant trades on bar open in OHLC modeling, using Envelopes breakout, a simple open-to-open trend filter, and a Pardo-style N-bar extremum breakout, with SL/TP, magic ...

πŸ‘‰ Read | AlgoBook | @mql5dev
❀16πŸ‘8🀩6πŸ”₯2πŸ‘1πŸ‘Œ1
Matplotlib-style plotting can be added to MQL5 via a thin client/server bridge rather than reimplementing chart rendering inside MetaTrader 5.

The MQL5 side provides CFigure, CAxes, and CPyplot wrappers that capture figure size, titles, labels, limits, grid, and series data. State is serialized to JSON and sent using WebRequest() to a local Flask service.

The Python service accepts routes per plot type, converts JSON into Matplotlib calls, and handles GUI constraints. Direct GUI rendering from Flask handlers can break due to main-thread requirements.

A terminal-friendly path is to render off-screen, return the figure as image bytes, save as BMP, and display via OBJ_BITMAP_LABEL. This keeps plotting deterministic and decouples UI from trading logic.

πŸ‘‰ Read | AlgoBook | @mql5dev
❀11πŸ‘8🀯2πŸ‘Œ2πŸ”₯1πŸŽ‰1🀩1
History Navigator update consolidates two gaps: bookmarks now render as on-chart annotations and can be recalled across symbol/timeframe changes that force EA reinitialization in MetaTrader 5.

Bookmarks are drawn as a vertical line plus a short text label at the saved timestamp, filtered by symbol and timeframe to avoid clutter. Object identifiers use an instance prefix and allocation counter, not bookmark text, preventing collisions and staying within platform name limits. Creation is deferred when the target bar is not yet available.

Cross-context navigation uses a pending-request hand-off via terminal Global Variables. Before ChartSetSymbolPeriod(), the EA writes symbol, timeframe, timestamp, version, tick counters, then exits without Sleep(). After REASON_CHARTCHANGE, the new instance restores the request, waits for SERIES_SYNCHRONIZED and CopyRates() a...

πŸ‘‰ Read | Docs | @mql5dev
❀12πŸ†6πŸ”₯3πŸ‘2🀩1πŸ‘Œ1πŸ‘€1
Correlation across symbols can hide real risk: multiple positions may behave like one trade if their returns move together. A rolling Pearson correlation matrix helps spot these clusters, but it remains a diagnostic tool, not a full portfolio risk model (it ignores size and direction).

The article builds an MT5 Expert Advisor that tracks symbols from open positions, computes bar-to-bar percentage returns from closed candles, and refreshes the pairwise correlation matrix on each new bar or when the position symbol set changes. Results are rendered as a heatmap with a configurable warning border for strong positive or negative relationships.

Implementation details focus on robust MQL5 design: return series and the matrix are stored in compact structures, the matrix uses a flat array with defined/undefined flags, correlations handle zero-variance series as u...

πŸ‘‰ Read | AppStore | @mql5dev
❀8πŸ”₯4✍2🀩2πŸ‘Œ2
Correlation-based screening misses deterministic non-linear inputs. MIC (Reshef et al., 2011) targets strength over shape, but it is a maximum over many grids and does not read zero on independence; at 200 points, unrelated columns can score near 0.22.

MINE approximates the grid search by freezing one axis via equipartition (tie-aware), reducing candidate cuts to clump boundaries, and solving the remaining partition exactly with a dynamic program. Runtime is dominated by repeated entropy terms, so integer xlogx lookup tables matter.

MIC comes with MAS, MEV, and MCN to describe dependence form and complexity. Evidence requires a permutation null; for time series, iid shuffles are invalid, so block permutations are used. Multi-feature scans must build the null of the maximum, not per-feature p-values.

πŸ‘‰ Read | Quotes | @mql5dev
❀18πŸ‘11🀩2πŸ‘Œ2πŸ‘¨β€πŸ’»2πŸ”₯1
Session Sweep Boxes plots Asian, London, and New York sessions as range boxes and flags liquidity sweeps of completed session highs/lows. A sweep is defined as price trading beyond a session extreme and then closing back inside it. Red arrows mark high sweeps (bearish), blue arrows mark low sweeps (bullish). Signals trigger only on closed candles, so outputs do not repaint.

Session times are configured in GMT for broker-independent behavior. Server GMT offset can be auto-detected or set manually; Strategy Tester requires the manual value. If sessions shift after DST changes, manual offset should be used.

After a session ends, its high/low can be extended as dotted lines until swept, invalidated by a close beyond the level, or reset by the next day’s same session. Options include filled boxes, labels, history depth, ATR-based arrow spacing, first-swee...

πŸ‘‰ Read | AppStore | @mql5dev
❀8🀩5πŸ‘4πŸ”₯2πŸ‘Œ2
MiniRocket is ported to native MQL5 as a fast, deterministic time-series feature transform: 84 fixed length-9 convolution kernels (weights -1/2) expanded across dilations produce ~10k bounded PPV features per price window, then a linear classifier handles prediction. No gradient descent, ONNX, or Python runtime, with ~2 ms per 128-bar transform.

The implementation focuses on correctness and speed: shared convolution terms reduce each kernel to a few additions, while Configure/Fit/Transform separation prevents leakage. Port accuracy is validated bit-for-bit against independent references, including sktime (accounting for float32 output).

The article also tackles the β€œno edge vs broken pipeline” problem by adding explicit controls to the audit harness, plus analysis of what zero-sum kernels can and cannot detect, enabling reproducible evaluation of multiple t...

πŸ‘‰ Read | Docs | @mql5dev
πŸ”₯15πŸ‘13🀩7❀5πŸ‘Œ3πŸ†1
Volatility Regime Shader assigns volatility to three regimes using ATR percentile ranking over a configurable lookback window, avoiding fixed ATR thresholds. The same percentile logic adapts across symbols and timeframes, where a 90th percentile reading means current ATR exceeds 90% of prior values in the window.

Compression is flagged at or below a chosen percentile and shaded light blue. Expansion is flagged at or above a chosen percentile and shaded light red. Normal conditions remain unshaded by default, with an optional Normal shade setting. An upper-right label can display the active regime and current ATR percentile.

Typical uses include regime filtering for automated or discretionary systems. Compression can gate breakout activation, while Expansion supports continuation logic and wider stop placement. Mean-reversion setups generally fit bett...

πŸ‘‰ Read | Freelance | @mql5dev
🀩14❀10πŸ”₯6πŸ‘5πŸ‘Œ3
SpikingBrain reframes market modeling as event-driven computation: price/volume streams are converted into discrete spikes that fire only on meaningful deviations. This reduces noise sensitivity, cuts compute for high-frequency data, and improves adaptation to regime shifts.

Core building blocks include spiking neurons with adaptive thresholds, efficient long-context attention using linear/sliding-window or hybrid strategies, and a Mixture of Experts where only relevant experts activate during strong moves.

The implementation focus is practical for MT5/MQL5: sparse spike activity preserves latency and memory, while spike-aware sparse attention uses dynamic graph-based neighborhoods and SparseMatMul to weight V efficiently, then re-encodes outputs back into spike space. The MoE is optimized by collapsing shared inputs into a single projection using summed expert ...

πŸ‘‰ Read | Signals | @mql5dev
πŸ”₯20πŸ‘12❀11🀩7πŸ‘Œ3
Watchlist Chart Opener automates batch chart creation in the trading terminal. A single run can open charts for every symbol in Market Watch or for a user-defined comma-separated list, using a selected timeframe or the current chart timeframe.

A template name can be provided to apply a saved .tpl file to each newly opened chart, ensuring consistent indicators and visual settings. Custom-list symbols can be added to Market Watch automatically. Nonexistent symbols on the broker server are skipped and written to the Experts log.

Filtering supports opening only symbols whose names contain specific text, including broker suffixes. Duplicate control can skip symbols that already have an open chart on the same timeframe. A maximum chart limit reduces the risk of opening an excessive number of windows, and an end-of-run summary reports opened, skipped, and fai...

πŸ‘‰ Read | Docs | @mql5dev
πŸ‘12❀9🀩6πŸ”₯4πŸ‘Œ3
Closed Trades Exporter outputs closed positions to a CSV compatible with Excel, Google Sheets, and other spreadsheet tools. Alongside standard history fields, it computes Maximum Adverse Excursion (MAE) and Maximum Favorable Excursion (MFE) from M1 price data covering each trade’s lifetime.

MAE reflects the worst move against the position before close, while MFE is the best move in favor. Aggregating these values helps validate stop-loss and take-profit placement. CapturedPct reports how much of each trade’s MFE was actually realized.

Each row represents one closed position (partial closes are separate rows) and includes ticket, symbol, side, volume, open/close times and prices, duration, profit/commission/swap/net, points result, MAE/MFE in points and account currency, captured percentage, magic number, and comment.

Export can be filtered by days, sym...

πŸ‘‰ Read | AppStore | @mql5dev
πŸ‘15❀12🀩6πŸ‘Œ3πŸ”₯2
AN Guard Lite provides passive trade logging for Expert Advisors and manual trading. It monitors activity but never opens, modifies, or closes positions.

Output includes a CSV journal with one line per event: position open, position close, closure reason (SL, TP, broker, program, manual), and net result including swap, commission, and fees. A text report is generated when removed from the chart with net profit, win rate, profit factor, average win/loss, expectancy, drawdown, monthly breakdown, and maximum favorable excursion per trade.

Trades are classified by the best gain reached in R, based on the first stop loss detected. Missing stop loss conditions are flagged, and best gain is marked unavailable.

Config supports symbol-only or account-wide scope, magic number filtering, file base names, CSV toggle, and no-SL alerts. Files are written under the termin...

πŸ‘‰ Read | NeuroBook | @mql5dev
❀18πŸ‘7🀩6
Session Sweep Boxes plots Asian, London, and New York sessions as chart range boxes, then flags liquidity sweeps of completed session highs or lows. A sweep is defined as a move beyond the session extreme followed by a close back inside. High sweeps are marked with a red arrow above the bar (bearish), low sweeps with a blue arrow below the bar (bullish). Signals are confirmed only on closed bars and do not repaint.

After a session completes, its high/low can be extended as dotted lines until swept, invalidated by a close beyond the level, or reset when the same session starts on the next day. Session times are configured in GMT for broker-independent behavior. Server GMT offset can be auto-detected or set manually; manual mode is required in Strategy Tester and useful after DST shifts.

Key options include history depth, per-session enable/start/end/c...

πŸ‘‰ Read | Forum | @mql5dev
❀14πŸ”₯9πŸ‘3πŸ‘Œ2⚑1🀩1
Volatility Regime Shader classifies volatility into three regimes using the percentile rank of ATR over a rolling lookback, not a fixed threshold. An ATR percentile of 90 indicates current ATR exceeds 90% of values in the window, allowing the same logic to scale across symbols and timeframes.

Compression bars at or below the configured percentile are shaded light blue, Expansion bars at or above the threshold are shaded light red, and Normal bars remain unshaded unless enabled. A top-right label reports the active regime and current ATR percentile.

Key inputs include ATR period (default 14), percentile lookback (100), Compression (<=20), Expansion (>=80), and bars to calculate (3000), plus optional alerts on regime changes using closed bars.

For automation, two iCustom buffers are exposed: buffer 0 = ATR percentile (0–100), buffer 1 = regime code (0...

πŸ‘‰ Read | Freelance | @mql5dev
❀16πŸ‘6🀩4πŸ”₯3
Volatility Regime Shader segments volatility into Compression, Normal, and Expansion using an ATR percentile rank rather than a fixed ATR threshold. The current ATR is ranked against a configurable lookback window, allowing the same settings to adapt across symbols and timeframes.

Compression is identified at or below a user-defined percentile and shaded light blue. Expansion is identified at or above a percentile and shaded light red. Normal is unshaded by default, with an option to shade it as well. An upper-right label can display the active regime and current ATR percentile.

The regime output can be used as a strategy filter. Compression conditions are commonly used to gate breakout activation, while Expansion supports trend continuation logic and wider stop placement. Mean-reversion setups typically prefer Compression or Normal conditions.

For ...

πŸ‘‰ Read | VPS | @mql5dev
❀13πŸ‘8πŸ”₯3🀩3πŸ†3
Watchlist Chart Opener automates bulk chart creation in the terminal. A single run can open charts for every symbol in Market Watch or for a comma-separated custom list, using a selected timeframe or the current chart timeframe.

A named chart template can be applied to each new chart so indicators, colors, and layout remain consistent. Custom-list symbols can be added to Market Watch automatically, while unavailable symbols on the broker server are skipped and reported in the Experts log.

Symbol selection supports a text filter for matching names, including common suffix conventions. Duplicate control can prevent opening charts that already exist for the same symbol and timeframe. A maximum chart limit reduces the risk of opening excessive charts, and a final summary reports opened, skipped, and failed results.

πŸ‘‰ Read | Freelance | @mql5dev
❀11πŸ”₯8πŸ‘5🀩4πŸ‘Œ1