MQL5 Algo Trading
586K subscribers
4.89K photos
7 videos
4.89K 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
Smart Break-Even & Partial Close is an EA that manages open positions regardless of whether they were placed manually, from the mobile app, or by other EAs. Logic is based on R multiples, where 1R is the entry-to-original stop distance captured the first time a stop is detected.

Sequence: partial close at InpPartialAtR (default 2R) closes InpPartialPercent (50%) once per position, rounded to lot step and skipped if volume cannot be split. Break-even at InpBreakEvenAtR (1R) moves SL to entry plus InpBreakEvenOffset points; positions without SL can use InpBreakEvenPoints. Step trailing starts at InpTrailStartR with a distance and step filter.

Controls include magic filtering (-1 all, 0 manual), optional all-symbol management, broker stop-distance validation, and β€œbetter-only” SL updates to reduce server requests. State persists via terminal global variables w...

πŸ‘‰ Read | Freelance | @mql5dev
❀10πŸ‘9πŸ”₯8🀩4
An MT5 chart indicator plots economic calendar releases as dotted vertical lines. Data is sourced from the terminal’s built-in economic calendar, covering events from InpDaysBack before current server time to InpDaysForward after it.

Filtering supports a comma-separated currency list (InpCurrencies, for example USD,EUR,JPY). When empty, events for all currencies are shown. Events are also filtered by minimum impact (InpImportance: 1 low, 2 medium, 3 high). Line colors map to impact level via InpHighColor, InpMidColor, and InpLowColor. Tooltips display currency and event name.

Objects are rebuilt on each new bar and every five minutes via timer to pick up newly scheduled releases without reload. Lines are drawn in the background, non-selectable, and are removed when the indicator is detached.

Requires a live server connection. The economic calendar is...

πŸ‘‰ Read | Docs | @mql5dev
❀8πŸ‘5πŸ”₯4🀩2
Equivalence Checker provides regression testing for MQL5 indicators by comparing full-history calculation against true tick-by-tick incremental updates, where most state bugs occur. It runs two independent paths: an incremental CalcIncremental() under test that persists state in buffers, and a reference path that recomputes from scratch (direct SMA window summation plus separate recursion chains for EMA and Wilder/RMA).

On every OnCalculate() call, the live bar values are compared and the worst deviation observed during the bar’s lifetime is retained and merged at close, preventing tick-only defects from disappearing in history. A fixed synthetic dataset mode makes inputs deterministic across symbols and terminals, enabling repeatable runs.

A 32-bit FNV-1a digest over a closed window anchored at a fixed bar time supports β€œgolden” regression checks, r...

πŸ‘‰ Read | VPS | @mql5dev
πŸ‘13❀10πŸ”₯9🀩4
Position sizing errors remain common outside major FX pairs, especially on gold and synthetic indices where tick values and contract specs vary by symbol. A script-based workflow can reduce manual calculation and execution delays by placing the stop level first, then sending an order sized to a fixed risk percentage.

Operation is event-driven: dropping the script on the chart at the intended stop-loss price triggers a market order with SL and optional TP. Below current price submits a BUY, above current price submits a SELL. Inputs include risk % (balance or equity), TP as a risk multiple, optional confirmation with full trade details, plus magic number, comment, and max slippage.

Risk calculation relies on OrderCalcProfit for instrument-accurate sizing, rounds volume down to the broker step, blocks orders where minimum lot exceeds risk, validates minim...

πŸ‘‰ Read | NeuroBook | @mql5dev
πŸ‘11❀5🀩5πŸ”₯4
True Trading Cost is a free, source-included MT5 chart indicator for estimating the monetary outcome of a planned Forex/CFD trade before any order is placed. It shows spread, position size, round-trip costs, break-even, and gross versus net risk/reward. BUY/SELL/RESET buttons control a hypothetical plan only and never send trades.

Entry/Stop/Target are managed with draggable chart lines. RESET can seed levels from current Bid/Ask and ATR(14). Commission input is round-turn per lot in account currency, with optional extra fees, slippage, and swap controls.

Buy models entry at Ask and exit at Bid; sell is the reverse, so spread is already embedded in executable prices. Net results add commissions/fees/slippage and optionally swap. Risk-based lot sizing uses equity percentage, rounds down to allowed steps, and returns no suggestion if budget is insuffic...

πŸ‘‰ Read | Signals | @mql5dev
❀12🀩12πŸ‘9πŸ”₯6
A utility script calculates historical spread for multiple symbols by server hour, using spread values embedded in M1 bars. This provides a cost view per instrument and highlights the cheapest and most expensive trading hours. Example output includes mean spread by hour for GBPUSD, US100, and XAUUSD over the last 90 days.

Usage: attach to any chart. Default behavior reads all Market Watch symbols for the last 90 days, or a custom comma-separated symbol list can be supplied. Inputs include Market Watch toggle, symbol list, M1 history days, and output file prefix.

Outputs in MQL5\Files: SpreadStats_hours.csv with median, 75th percentile, and mean spread per symbol/hour in points and % of price; SpreadStats_specs.csv with swap long/short, contract size, point, digits, and tick value. A per-symbol summary is printed to Experts.

Notes: bar spreads are often t...

πŸ‘‰ Read | Docs | @mql5dev
🀩6πŸ‘5❀4πŸ”₯4πŸŽ‰1
Indicator renders chart reference levels as horizontal objects: previous day High/Low, previous week High/Low, plus a configurable round-number grid around current price.

Daily levels use solid lines, weekly levels use dashed lines, and round levels use dotted lines. Round spacing is set via InpRoundStep in price units; when 0, it auto-selects based on symbol digits (0.0050 for 5-digit, 0.50 for 3/4-digit, 10.0 for fewer digits). The grid is anchored to the round level at or below current price, then draws InpRoundCount lines above and below.

Objects rebuild once per new bar to keep terminal load low. Each line includes a tooltip with name and price. Daily/weekly levels are sourced from D1/W1 history; levels are skipped until history is available. All objects are removed on indicator deletion. No buffers, no trade logic.

πŸ‘‰ Read | Quotes | @mql5dev
πŸ”₯10🀩9❀8πŸ‘7
An MT5 analytical indicator combining Mouteki-DeMark trendline breakouts with Fractal Dimension Index (FDI), an independent Hurst exponent (R/S on log returns), and an integrated market dashboard.

Trendlines are built from confirmed pivots only, requiring completed candles on both sides. Breakouts are evaluated on closed bars: BUY when high exceeds descending resistance, SELL when low breaks rising support, with at least one inherited DeMark qualifier. The dashboard separates no-break, false break, qualified break, and cancelled setups, and keeps T1–T4 projections as reference levels.

FDI estimates path roughness (trend-like vs range-like), while Hurst classifies persistence vs mean reversion. An optional regime gate can require FDI < 1.45 and Hurst > 0.55 for new SIGNAL events.

Event-based alerts cover SIGNAL, INVALID, and a single per-setup CLOSE ...

πŸ‘‰ Read | Quotes | @mql5dev
πŸ‘7❀4🀩4πŸ”₯3
An indicator implementation combining a Donchian channel with an ATR-based trailing stop.

The Donchian bounds per bar are computed from the highest high and lowest low of N_Channel bars ending two bars back. This prevents the breakout bar from contributing to its own channel. Breakouts are confirmed on closed data only: the previous bar must close above the upper bound or below the lower bound. An arrow is then plotted on the next bar, offset by 0.4 ATR from the bar’s high/low. A single arrow symbol is used, with direction inferred from placement.

After a breakout, a trailing stop initializes at Close Β± Trail_ATR * ATR and advances only in the breakout direction. If price closes across the stop, it is cleared until the next breakout. Following any close outside the channel, the stop is re-anchored from that bar’s close. The live bar stop updates with...

πŸ‘‰ Read | AlgoBook | @mql5dev
❀11πŸ‘10🀩7πŸ”₯6
ORB Box automates Opening Range Breakout marking for intraday sessions. It measures the high/low of a configurable opening window (for example 09:00–09:30, broker server time), draws a dashed box for that range, then extends dotted range-high and range-low levels to a defined session end.

Breakouts are flagged with arrows based on either close-through or wick-through rules, with an optional points buffer to reduce marginal triggers. By default only the first breakout per day is marked; an option allows one buy and one sell signal per day to capture reversals through the opposite boundary.

The indicator is display and alert oriented, not execution. It exposes data buffers for EA consumption: buy price, sell price, range high, range low (EMPTY_VALUE when unused). Notes: times are server-based, sessions must not cross midnight, and the opening window is...

πŸ‘‰ Read | Calendar | @mql5dev
πŸ‘7❀5πŸ”₯5🀩3
A swing-pivot indicator marks confirmed swing highs and swing lows with dots and plots a simple moving average (SMA) of the close.

A bar qualifies as a swing high when its high is strictly above the highs of ZZDepth bars on both the left and right. A swing low is defined symmetrically with lows. If both conditions are met on the same bar, the swing high takes precedence.

Confirmation requires ZZDepth bars to the right, so the dot is emitted ZZDepth bars after the extreme, then drawn back on the pivot bar. The latest pivot remains provisional until the confirming bar closes; after confirmation, pivots are not repainted.

This is a symmetric window test rather than a classic ZigZag, so there are no deviation or backstep settings. Parameters: ZZDepth (default 12), MA_Period (default 50). Buffers: 0 SMA, 1 pivot price (0 when none). No trade management i...

πŸ‘‰ Read | VPS | @mql5dev
πŸ”₯11❀7πŸ‘6🀩3
Daily Loss Meter provides an on-chart view of daily loss usage for funded and prop-style accounts with strict daily drawdown rules. It tracks closed P/L since the daily reset, including commission and swap, plus current floating P/L across the entire account.

The panel reports loss to date, remaining room before the limit, and the equity floor that must not be breached. Limits can be configured as a percentage or a fixed currency amount. The reference base at reset can be balance, equity, or the higher of the two, aligning with common rule variants.

Reset time is set in server hours. Equity at reset is captured only while the indicator is running; until recorded, balance is used and flagged. The progress bar changes at 50% and 80%, with one warning alert and one limit alert, optionally sent as mobile push. Deposits made today are excluded from P/L. D...

πŸ‘‰ Read | Calendar | @mql5dev
πŸ‘8❀5🀩5πŸ”₯2🀯1
Anchored VWAP recalculates VWAP from a user-selected event bar rather than a fixed session boundary. It accumulates priceΓ—volume and volume from the anchor forward, so the line reflects the average entry price of participants since that point. Trading above the line implies net-profit for post-anchor buyers; below implies the opposite, and the level often behaves as dynamic support or resistance.

The anchor is a draggable vertical line. Moving it triggers an immediate full recompute; normal updates are incremental, recomputing only the last bar per tick unless history changes.

Optional deviation bands are based on volume-weighted standard deviation since the anchor: Band 1 and Band 2 multipliers define β€œstretched” conditions. Band width adapts to dispersion.

Key inputs cover price type, tick vs real volume (fallback to tick if real is missing), snap-to-...

πŸ‘‰ Read | AlgoBook | @mql5dev
πŸ‘9πŸ”₯3🀩3❀2✍1
An indicator combining Bollinger Bands and a Keltner Channel in the main chart window, with explicit marking of volatility squeeze conditions.

A squeeze is flagged when the Bollinger upper/lower bands are fully inside the Keltner upper/lower channel. On each squeeze bar, an orange dot is printed on the Bollinger middle line. When a squeeze ends (on the current bar after being active on the prior bar), a release arrow is drawn.

Arrow direction is derived from momentum: the last closed close is compared to the close MomLookback bars earlier. Higher close prints an up arrow below the bar, lower close prints a down arrow above it, equal closes print no arrow. Calculations are non-repainting per bar since each bar uses only prior-bar data.

Implementation details: Bollinger uses SMA and population standard deviation of closes. Keltner uses EMA of closes w...

πŸ‘‰ Read | CodeBase | @mql5dev
❀14πŸ‘9πŸ”₯5🀩3πŸ‘Œ3
Session Range is a chart indicator that plots the high/low and range for the three primary FX sessions: Asia, London, and New York. Session boxes make it easy to compare volatility, identify overlaps, and track where price traded during each window.

Asia range is commonly used as an intraday reference for London and New York breakouts. The tool can trigger an optional alert and push notification when price breaks the Asia high or low, limited to once per side per day after the session closes.

Session hours are configurable in broker server time, including support for sessions crossing midnight. A tooltip displays session high, low, and range in points. The indicator can render 1 to 100 prior days and removes all chart objects on deletion.

Designed for H1 and lower; higher timeframes show a brief note instead of boxes. Not a signal service or financi...

πŸ‘‰ Read | Quotes | @mql5dev
❀8πŸ‘8πŸ”₯5🀩2
Session VWAP with standard deviation bands models the session’s volume-weighted β€œfair” price and the dispersion around it. VWAP is updated from the session open using a numerically stable weighted algorithm, recalculating only the last bar on each tick.

Alongside the main VWAP line, the tool computes volume-weighted standard deviation and plots configurable bands (commonly Β±1 SD and Β±2 SD). The bands provide context on how extended price is relative to the session’s traded distribution, including a Z-score: (Price βˆ’ VWAP) / SD.

Sessions reset on daily, weekly, or monthly boundaries with an optional start time in server time. Visual handling avoids connecting sessions and can draw session separators plus an info label. Typical deployment uses timeframes smaller than the chosen session. Tick volume is the default on FX/CFD; real volume is preferable on exc...

πŸ‘‰ Read | CodeBase | @mql5dev
πŸ‘9πŸ”₯4❀3🀩3
A technical indicator plots a long-period SMA to qualify an uptrend and flags pullbacks using RSI. A signal is generated only when three prior-bar conditions align: close above the SMA, RSI at or below RSI_BuyLevel, and the SMA higher than the previous bar. The SMA slope filter can be disabled via RequireRising.

Signals are rendered as up arrows positioned 0.1% below the bar low. Price and RSI are read from the last closed candle, preventing repainting from intra-bar movement. If multiple consecutive bars match, each is marked to represent a pullback zone rather than a single event.

Scope is long-only with no downtrend equivalent. Default RSI_BuyLevel is 40, reflecting typical behavior when price remains above a long-term average. Startup requires TrendSMA + RSI_Period + 3 bars. Buffers: 0 SMA, 1 marks. Indicator is display-only and does not execute trades.

πŸ‘‰ Read | CodeBase | @mql5dev
πŸ‘9❀5πŸ”₯5🀩4
A position sizing utility calculates the maximum lot size so the configured stop loss matches a selected risk limit.

Risk can be set as a percentage of balance or equity. Stop loss can be defined as a distance in points or as an exact price level.

Profit and loss estimation relies on OrderCalcProfit for higher accuracy across forex, metals, indices, and crypto, with tick value used as a fallback when needed. The computed volume is rounded down to the symbol’s volume step to ensure the target risk is not exceeded.

Outputs include entry, stop loss, lot size, and the resulting risk in account currency and percent. No positions are opened, modified, or closed. Suitable for prop accounts with strict daily loss and drawdown constraints. Free tool, no signals or financial advice.

πŸ‘‰ Read | AlgoBook | @mql5dev
❀9πŸ‘8πŸ”₯6🀩5
Tick Volume Delta Histogram provides an estimated buy/sell pressure signal for FX and CFDs using tick volume and candle structure. Since real aggressor volume is not available, each bar is assigned a ratio r in the range βˆ’1..+1, then tick volume V is split into estimated buy and sell parts, with delta = VΒ·r.

Three estimation modes are supported: close location within the bar range, body-to-range ratio, and a bar-level tick rule based on close vs previous close. Output is a histogram above/below zero for buy/sell dominance, in absolute ticks or as percent of volume (βˆ’100..100).

A β€œstrong” state is flagged when |delta| exceeds a configurable percent of the bar’s tick volume. An optional EMA overlay helps distinguish isolated spikes from sustained shifts, and divergence between price extremes and delta/EMA can act as a warning. Works across symbols a...

πŸ‘‰ Read | NeuroBook | @mql5dev
πŸ‘7🀩7❀5πŸ”₯5
This indicator combines a Donchian channel with a long-period SMA and flags channel breakouts only when aligned with the SMA trend filter.

The Donchian bands are calculated from the highest high and lowest low over EntryChannel bars ending two bars back. This avoids including the breakout bar in its own channel.

An upward signal requires the previous bar to close above the upper band and above the SMA. A downward signal requires the previous bar to close below the lower band and below the SMA. Signals against the SMA are skipped. With LongOnly enabled, only upward signals are produced.

Arrows are plotted on the bar after the breakout: 0.1% below its low for up moves, 0.1% above its high for down moves. The arrow buffer uses one symbol for both directions, with direction inferred from placement. Closed bars only; works on any symbol/timeframe; requir...

πŸ‘‰ Read | Forum | @mql5dev
❀20πŸ‘11πŸ”₯5🀩3
Warm-Up Meter measures how much history a recursive indicator needs before its output is within a chosen tolerance. It targets EMA, Wilder smoothing (RMA used by RSI/ATR/ADX), and any indicator built as recursive stages where the initial seed value never disappears and only decays by (1 - alpha) per bar.

The tool runs three chains on the same closed bars: a long-history reference chain, a probe chain seeded midway, and a tested chain seeded at a user-selected bar using either first-price or zero. Relative deviation between tested and reference is measured per bar, and β€œwarm-up” is the first bar after which the error stays within tolerance.

Reference validity is checked. If probe vs reference at the seed bar implies the reference still carries material error, the verdict becomes INCONCLUSIVE. Stacked smoothing effects are visible; measured warm-up is ...

πŸ‘‰ Read | Docs | @mql5dev
πŸ”₯7πŸ‘5❀3🀩3🀯1