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
AlgoFX Session Liquidity Sweeps tracks common intraday reference levels and flags a sweep when price trades through a level and the candle closes back on the other side. Supported levels include PDH/PDL, Asian session high/low (00:00–08:00 server), and London session high/low (08:00–12:00 server), built from chart OHLC and broker server dates.

Sessions use bar open time with [start,end) membership and handle midnight crossing. Levels activate only after a session closes; partial first-loaded sessions are ignored. Sweep signals use an ATR filter: sell sweep requires high > level + MinPenetrationATR*ATR and close < level; buy sweep is symmetric. A close beyond a level marks a break and consumes the level; each level emits one event and the forming candle is never evaluated.

For EAs, read buffer 2 (Buy) and 3 (Sell) at shift 1 via iCustom/CopyBuffer; va...

πŸ‘‰ Read | AppStore | @mql5dev
πŸ‘12πŸ”₯10❀9🀩7
Risk Lot Calculator is a MetaTrader 5 chart utility that calculates lot size from a target risk and stop-loss distance. It renders an on-chart panel and does not place, modify, or close orders.

The panel displays symbol/timeframe, equity and balance, and whether equity or balance is used as the risk reference. Risk can be a percent of the reference or a fixed money amount. Stop-loss is entered in points and also shown as a price distance.

It reports tick size/value, point and contract size, min/max lot and step, and broker StopsLevel. It calculates loss per 1.00 lot at the stop, then computes a raw lot, rounds it down to lot step, and clamps to symbol limits.

Margin is computed via OrderCalcMargin for a buy at current ask, including free margin checks. Warnings appear when StopsLevel is violated, risk is below minimum lot, lot is capped, or margin is insuf...

πŸ‘‰ Read | Quotes | @mql5dev
❀16πŸ‘14🀩6πŸ”₯5
A session/killzone indicator draws time windows defined in GMT on charts running on broker server time. Each window is converted to server time before rendering, covering Asian range, London open, New York open, and London close for a configurable lookback (default five days).

Boxes render as outlines by default (fill disabled) and sit in front of candles; enabling fill places the box behind price. Each window can also draw dashed high/low lines, and the newest box per session may print a two-line label (font 8) only when there are enough bars. Range is shown in pips for standard FX quotes, otherwise in price with symbol digits and profit currency.

Offset handling supports auto-detection by comparing server and GMT clocks (rounded, clamped to Β±14). When auto-detect is unavailable or in Strategy Tester, a manual offset is used. Window edges are resolv...

πŸ‘‰ Read | AlgoBook | @mql5dev
❀23🀩17πŸ‘11πŸ”₯6
Random position sizing remains a common reason for account drawdowns. A compact MQL5 script addresses this by calculating lot size from two inputs: acceptable account risk (%) if stop loss is hit, and stop-loss distance in pips.

The script reads tick value, tick size, and volume constraints directly from the broker. Loss per 1.00 lot is computed as: stop_distance / tick_size * tick_value. The target risk amount (equity or balance * risk%) is divided by loss per lot, then rounded down to the symbol’s volume step so effective risk does not exceed the limit.

Inputs include risk %, account value basis (equity or balance), stop distance (pip definition varies by digits), and optional symbol override. Output is shown via alert and logged. If minimum lot exceeds the risk cap, it reports that condition instead of rounding up.

πŸ‘‰ Read | NeuroBook | @mql5dev
🀩18πŸ‘16πŸ”₯10❀8
Session Range Box is an MT5 chart indicator that plots Asian, London, and New York trading sessions as range boxes. Each enabled session is shown from open to close, with high/low lines, an optional mid line, and a label displaying the session name and range in the symbol’s native price units. An optional fourth box marks the London/New York overlap when the time windows intersect.

A corner panel summarizes the latest session day with high, low, and range for Asia, London, New York, and the overlap, plus the clock mode in use. When attached on weekends, the panel reports the last day with available bars.

Default hours are defined in GMT and can be switched to broker server time. Inputs cover session visibility, start/end times, colors, the number of past days to draw (5 by default, up to 20), and panel placement. DST adjustments are manual; historical b...

πŸ‘‰ Read | AlgoBook | @mql5dev
🀩20❀18πŸ‘17πŸ”₯17🀯4πŸ‘€1
CreyesHistoryCSV exports closed trade history from a trading account into a CSV file compatible with Excel, LibreOffice, and similar tools. It also outputs a compact performance summary to the Experts tab. The script is read-only and does not open, modify, or close any trades.

Usage requires placing CreyesHistoryCSV.mq5 in MQL5\Scripts, compiling if needed, then running it from the Navigator on any chart. After selecting inputs, the CSV is written to MQL5\Files (accessible via File -> Open Data Folder).

Key inputs include export range in days (1–3650), optional symbol and magic number filters, output filename, and a configurable column separator. Exported fields cover timestamps, deal/position identifiers, symbol, side, volume, price, P&L components, net result, magic, and comment.

Export includes only position-closing deals; deposits and withdrawals ...

πŸ‘‰ Read | Freelance | @mql5dev
πŸ”₯17πŸ‘15🀩15❀14
PivotPoints indicator plots the daily pivot point plus three resistance and three support levels derived from the previous day’s high, low, and close. It renders several prior days, with each set of levels valid only for its own session. Levels are fixed at the daily open and do not repaint.

Displayed lines include PP (pivot), R1–R3 (resistance), and S1–S3 (support). Supported calculation modes cover Classic (PP and range-based extensions), Fibonacci (0.382/0.618/1.000 of prior range), and Camarilla (close-based levels using 1.1 Γ— range scaled by 12, 6, and 4).

Configuration options include formula selection, number of days to plot, optional text labels, and separate colors for pivot, resistance, and support. Designed as an information tool across any symbol and timeframe via daily candle data, without trade signals or profit guarantees.

πŸ‘‰ Read | CodeBase | @mql5dev
❀15πŸ‘12🀩12πŸ”₯9
An EA built around Supertrend flips that trigger only after candle close beyond the band. On each new candle it rebuilds Supertrend from closed bars (default 300), using ATR(10) and multiplier 3.0, then opens a single trade on the last confirmed trend change: buy on flip up, sell on flip down. One position per symbol and magic; new flips do not stack entries.

Position sizing supports fixed lot or risk percent of balance/equity (default 1%). Stop loss can track the Supertrend line plus buffer (default 50 points) or use a fixed distance; broker stop level and spread are enforced. Take profit is a stop multiple (default 2.0). Breakeven moves SL to entry plus offset after 1R (default 20 points). Optional opposite-flip exit is enabled by default.

Sideways markets can cause repeated losses; if computed volume is below broker minimum, minimum volume is used and risk...

πŸ‘‰ Read | VPS | @mql5dev
❀22πŸ‘10πŸ”₯10🀩7
True Trading Cost is a free MT4 chart indicator (source included) 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 price, and gross vs net risk/reward. BUY, SELL, and RESET manage only a hypothetical plan; nothing is sent to the broker.

Entry/Stop/Target are set as draggable chart lines, with RESET pulling defaults from current Bid/Ask and ATR(14). Commission is entered as round-turn per lot in account currency. BUY is modeled at Ask to Bid, SELL at Bid to Ask, so spread is not double-counted. Net results can include commission, extra fees, slippage, and optional swap.

An optional panel tracks swap estimates and six-hour spread stats from live ticks only, stored in memory and resetting daily. Lot sizing supports risk-percent (rounded down, no forced ...

πŸ‘‰ Read | Forum | @mql5dev
❀8πŸ‘6🀩6πŸ”₯3
ATR-based dynamic support and resistance bands replace fixed pip levels with volatility-scaled distance from a moving-average basis. Bands are computed as basis Β± (multiplier Γ— ATR), with ATR calculated internally using Wilder smoothing. This avoids external indicator handles; only the latest bar is recalculated on ticks, while history is processed once at initialization.

Upper dashed band acts as dynamic resistance, lower dashed band as dynamic support. In ranges, touches can mark overextension; closes outside the band with expanding width can indicate breakout conditions. The dotted basis (SMA or EMA) represents the mean and often acts as internal support/resistance during trends.

Band width reflects volatility: narrowing suggests compression that can precede expansion, widening confirms rising volatility. An on-chart label shows ATR parameters and the ...

πŸ‘‰ Read | NeuroBook | @mql5dev
❀24πŸ‘11πŸ”₯5πŸ‘¨β€πŸ’»3🀩2
Spread & Slippage Tracker separates two costs often mixed under β€œbroker trouble”: the spread at decision time and the slippage between requested and executed price. Both are measured from live data rather than assumptions, making it clearer where execution cost is coming from.

Spread is sampled every tick via SYMBOL_SPREAD, maintaining daily min/avg/max with an optional daily reset to prevent older volatility from distorting current sessions.

Slippage is captured only when a deal executes through OnTradeTransaction, which requires an Expert Advisor rather than an indicator. The EA places no orders and only observes account activity.

The panel shows current spread plus daily stats, then slippage stats: tracked deal count, average, and worst adverse slippage. Slippage is signed so positive always indicates a worse fill for the trade direction. Optional CSV l...

πŸ‘‰ Read | NeuroBook | @mql5dev
❀7πŸ”₯4πŸ‘3🀩2
A chart utility for monitoring two execution-critical values: time remaining to the current bar close and the live spread. The countdown is driven by a one-second timer, so it updates even when tick flow is sparse, and it derives the close time from the last bar open without scanning history.

The candle label shows remaining time with adaptive formatting: MM:SS below H1, HH:MM:SS from H1, and Nd HH:MM:SS on higher periods. The spread label displays Ask-Bid in points or pips, with 1 pip mapped to 10 points on 3/5-digit symbols. An optional warning threshold (points) can switch the spread color when conditions degrade.

Placement is fixed to a chosen chart corner with pixel offsets. Typical inputs include visibility toggles, spread units, warning level, font, size, and colors. Server time is used for timing; weekend/holiday gaps can leave the countdown at...

πŸ‘‰ Read | Forum | @mql5dev
❀17πŸ‘5πŸ”₯4🀩4
Equity/Drawdown Monitor Panel focuses on live drawdown from the account’s own high-water mark, rather than relying on balance, which only updates on closed trades and can hide risk from floating losses.

The panel tracks the highest equity observed since attachment (optionally reset daily) and reports current drawdown from that peak as a percentage. It reads current account snapshot values, avoids unnecessary updates on ticks where nothing changed, and does not scan price history.

Key fields: Equity (balance plus floating P/L), Balance (closed-trade result only), Peak (tracked max equity), Drawdown (percent below peak). A configurable threshold switches the readout from silver to red.

Optional alerting is one-shot per threshold breach, then re-arms only after recovery inside a defined band to prevent repeated firing.

Designed as account-level teleme...

πŸ‘‰ Read | Freelance | @mql5dev
❀7πŸ‘6πŸ”₯6🀩5
Supertrend with trend color change is a trend-following trailing stop built from ATR-based bands. Two bands are calculated at multiplier x ATR around a chosen price source, but only one is active: the lower band during an uptrend and the upper band during a downtrend. Bands only move in the trend direction, so the line trails without stepping back.

A trend switch is confirmed when a candle closes beyond the active line. The indicator then flips to the opposite band, moves to the other side of price, and changes color. Optional arrows mark the bar where direction changes, and an info label reports settings plus current UP/DOWN state.

Key inputs include ATR period, multiplier, and price source (median or close), along with line styles, arrow colors, and optional alerts. Wilder-smoothed ATR is computed internally, only the last bar is recalculated per...

πŸ‘‰ Read | NeuroBook | @mql5dev
❀28πŸ‘9πŸ”₯8🀩6
An intraday indicator focused on the current daily open as a reference level, with an on-chart point-distance readout to avoid manual measuring.

It plots the daily open for today and optionally previous sessions (1–30). Today’s line can be extended to the right; prior days are limited to their own session. A label at the last bar shows the open price and signed distance from current Bid in points (e.g., DO 1.08520 +35 pts), with configurable colors for above/below.

Update logic is lightweight: lines are created on initialization and only when a new D1 bar appears; on ticks only the label text is refreshed, and only on change. Session boundaries follow broker server daily bars, so daily open can differ by timezone. Objects are prefixed DailyOpen_ and cleaned up on removal; running multiple instances on one chart is not recommended.

πŸ‘‰ Read | Forum | @mql5dev
❀20πŸ”₯8πŸ‘7🀩5
MZ Smart Trail Manager is a position management EA that does not open trades. It modifies stop loss on existing positions, including manual orders or positions opened by other EAs.

Stop protection is built from three optional layers: break-even with offset after a defined favorable move, a stepped trailing stop that updates in fixed increments to reduce modification frequency, and a progressive profit lock defined in account currency. The active stop is always the most protective of the enabled rules, and it never moves against the position.

Position scope can be filtered by all trades, manual-only, or a specific magic number. An optional initial stop can be applied to positions opened without SL. The logic respects broker stop level and freeze level to avoid rejected updates.

Default distance inputs use ATR (M15, period 14) as multipliers, with an option t...

πŸ‘‰ Read | CodeBase | @mql5dev
❀21🀩10πŸ‘8πŸ”₯2
Smart Liquidity Hunter v1.11 is an MT5 chart indicator that flags price sweeps around previously confirmed swing highs and lows using OHLC as a liquidity proxy. It does not read resting orders or stop placements, and it does not place trades.

Bullish signals require a closed candle to sweep below an eligible swing low and close back above it. Bearish signals require a sweep above an eligible swing high followed by a close back below it. Penetration must exceed the larger of MinSweepPoints and a volatility threshold based on the simple mean of prior true ranges, plus wick/close-location freshness filters. Dual-direction candidates are ignored, and no arrow is printed on the forming bar.

Defaults include SwingStrength=3, MaxSwingAge=100, VolatilityPeriod=14, MinSweepVolRatio=0.10, MinWickPercent=25, MinCloseLocationPct=60, with optional candle-color fi...

πŸ‘‰ Read | AppStore | @mql5dev
πŸ‘9❀8🀩3πŸ”₯2πŸ†1
Multi-Timeframe Trend Dashboard is an MT5 chart indicator that summarizes an EMA-based trend state across multiple timeframes in a corner panel. An optional EMA line for the chart timeframe can be plotted. No order placement, modification, or closing is performed.

Per enabled timeframe it shows the label (M15, H1, H4, D1, W1 plus an optional sixth), the state (UP/DOWN/FLAT), distance from last close to EMA in price units and ATR, and how many bars the current state has persisted up to a scan limit. A summary counts states and reports Aligned UP, Aligned DOWN, or Mixed. On weekends it uses the last available bar per timeframe.

Trend logic uses EMA(close) with a configurable period (default 50), EMA slope over a short lookback (default 5), and ATR (default 14) to filter noise. UP/DOWN require price side plus EMA slope exceeding NΓ—ATR (default 0.08); ot...

πŸ‘‰ Read | Forum | @mql5dev
πŸ‘12πŸ”₯10❀9🀩7
DoEasy’s indicator framework is extended to support multi-buffer standard indicators drawn on the current chart while sourcing data from any symbol/period. The core change is stronger buffer identity: each buffer now carries indicator type, instance ID, and a new β€œline role” (e.g., main/upper/lower), plus a short indicator name matching terminal display.

Library updates add enums, new buffer properties, and collection search/sort criteria across all buffer subclasses. Creation methods now generate paired calculated+drawn buffers per indicator line for ADX, MACD, RVI, Stochastic, Bands, Envelopes, and Fractals, with special handling for Bollinger Bands line indexing.

Tests demonstrate rendering H4 indicators on an H1 chart, both in a subwindow and the main window, enabling cleaner multi-timeframe visualization for trading tools.

πŸ‘‰ Read | VPS | @mql5dev
πŸ‘15❀9πŸ”₯7🀩7
News Event Marker is a MetaTrader 5 chart indicator that reads the terminal’s built-in economic calendar and renders selected releases directly on the chart. It draws a vertical line at each scheduled time, with coloring by importance, plus an optional shaded time window and short labels for higher-impact items.

A corner panel lists upcoming and recent releases with countdown or β€œago” timing and shows actual and forecast figures when available. It can raise optional alerts a configurable number of minutes before high- or medium-impact events. The tool is display-only and does not place, modify, or close orders.

Filtering supports importance levels, a configurable lookback/lookahead horizon, and an event cap to avoid clutter. Currency selection can be automatic by parsing the chart symbol for 3-letter codes, or manual via a comma-separated list.

Data...

πŸ‘‰ Read | VPS | @mql5dev
❀17πŸ‘16πŸ”₯15🀩14
IndexGapMarker scans daily candles and marks each opening gap above a configurable minimum. For every detected gap, it draws a box that remains green or red while unfilled, then switches to grey once price trades back to the prior close. A label reports the gap size in percent and the current fill status.

Key inputs include scan depth in days, minimum gap threshold, color settings, optional display of filled gaps, and label on/off control.

Best suited to stock index CFDs with defined closing sessions (DAX, Euro Stoxx, FTSE). Instruments trading nearly 24/7 typically show fewer gaps. The indicator can run on any chart timeframe since calculations use daily data. It is informational and not a trading system.

Deployment: copy IndexGapMarker.mq5 to MQL5\Indicators, compile in MetaEditor, then attach to an index chart. H1 is a practical default.

πŸ‘‰ Read | CodeBase | @mql5dev
πŸ‘15❀13πŸ”₯11🀩9