MQL5 Algo Trading
579K subscribers
4.63K photos
7 videos
4.64K 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
John Ehlers published an alternative RSI calculation as part of a broader indicator set, commonly referenced as MyRSI. Due to material differences versus the platform’s standard RSI, a standalone implementation is often justified for testing and integration in existing workflows.

Key differences are structural. Output is normalized to the -1 to 1 range rather than 0 to 100, making the zero line a practical reference for regime changes. Because the scaling and internal math differ, values are not directly comparable to standard RSI levels, and common thresholds such as 50 do not translate as equivalent signals.

Operationally, it can still be used in typical RSI-style setups, with thresholds and triggers recalibrated to the normalized range.

πŸ‘‰ Read | Docs | @mql5dev

#MQL5 #MT5 #Indicator
❀25πŸ‘9πŸ‘Œ3
Malaysian Engulfing is treated as a strict, code-friendly engulfing variant for MT5/MQL5, addressing two gaps: inconsistent real-time detection and lack of post-signal context.

The rule set is unambiguous. Bullish: a bearish candle followed by a bullish candle opening at or below the prior close and closing above the prior high. Bearish: a bullish candle followed by a bearish candle opening at or above the prior close and closing below the prior low.

The workflow is split into two indicators. A strict detector renders arrows only for β€œperfect” candidates. A retest validator runs a lightweight state machine (SEARCH β†’ FOUND β†’ reset/confirm), defines a high/low zone, enforces invalidation, limits retests via barsRetestRange, and confirms returns with a wickThreshold filter.

Output is deterministic: arrows, rectangles, and confirmation events suitable for bac...

πŸ‘‰ Read | NeuroBook | @mql5dev

#MQL5 #MT5 #Indicator
❀36⚑4πŸ‘3πŸ‘Œ1
Candlestick analysis often breaks in automation because terms like β€œlong body” or β€œsmall wick” are interpreted differently, producing inconsistent MT5 signals and unreliable backtests.

This article replaces subjective pattern naming with an alphabetical encoding driven by measurable body-to-wick ratios. Each bar is deterministically classified into symbols (A/a, H/h, E/e, G/g, plus Doji), with uppercase/lowercase pairing bullish and bearish equivalents.

In MQL5, a CandleType(shift) classifier converts OHLC into codes, then two-candle patterns are detected by concatenating symbols and matching valid permutations. A lookback parameter scans historical bars once per new candle, emitting reproducible logs and alerts.

The result is a stable, testable signal layer that’s easy to scan, filter, and evaluate statistically, while leaving risk and money manage...

πŸ‘‰ Read | VPS | @mql5dev

#MQL5 #MT5 #Indicator
❀53πŸ‘7πŸ‘Œ5⚑4
Constant exposure is a common failure mode in retail algorithmic trading. Many systems assume persistent exploitable structure and run 24/5, even when markets shift into near-random regimes where edge collapses. In those conditions, expected returns converge toward transaction costs, making spreads and commissions the dominant outcome.

Quant desks often gate execution with Information Theory rather than standard technical filters. A Shannon Entropy Index estimates the probability distribution of rolling log-returns and quantifies randomness via H(X) = -Ξ£ P(x) log2 P(x). High entropy implies higher efficiency and low predictability; low entropy suggests structural inefficiency where trend or mean-reversion systems have a higher probability of working.

Operationally, entropy can function as a portfolio-level master switch: allow strategies to trade onl...

πŸ‘‰ Read | CodeBase | @mql5dev

#MQL5 #MT5 #Indicator
❀38πŸ‘3πŸ‘€2πŸ‘Œ1
MetaTrader 5 forward-simulation logic can add context after an EMA crossover instead of leaving traders with an isolated signal.

A compact engine anchors on the crossover bar, freezes EMA slope at that point, then projects a fixed count of synthetic candles forward using a 0.91 decay so each step weakens. Controlled noise is applied to steps and wick sizes to avoid a rigid linear path.

Implementation details include EMA buffers/handles, a PredictedCandle OHLC struct, timer-driven refresh, and redraw avoidance via anchor tracking. Signal invalidation is handled with a pip-threshold rule. Rendering uses chart objects for bodies and wicks, plus a separator and state labels, with strict cleanup on updates and removal.

πŸ‘‰ Read | AppStore | @mql5dev

#MQL5 #MT5 #Indicator
❀26πŸ‘Œ3✍1
GlowTrend Pro is a trend-following indicator focused on visual state changes and reduced noise via a smoothed moving average. The plot switches color based on slope to flag momentum direction.

Blue line signals bullish momentum, while red line signals bearish momentum. β€œGlow” dots are printed at the moment the state flips and can be treated as timing markers for entry or exit review.

The indicator supports configurable period, averaging method (EMA, SMA, Smoothed, Linear Weighted), and price source (Close/Open/High/Low). Linked-buffer logic is used to keep transitions continuous and avoid broken segments on the chart. Default lookback is 20; higher values smooth output at the cost of latency.

Operational guidance typically pairs a color change with the corresponding dot. Common use cases include H1/H4 for swing setups and M5 during high-volatility s...

πŸ‘‰ Read | VPS | @mql5dev

#MQL4 #MT4 #Indicator
❀38πŸ‘4πŸ‘Œ2πŸ‘€1
Static retest-bar limits don’t scale across symbols and timeframes: volatility shifts can make a fixed range either miss valid pullbacks or accept noisy confirmations. The solution is an adaptive retest range selected from historical behavior, not manual tuning.

Each Malaysian Engulfing setup is stored with formation time, zone bounds, retest time, and retestBars, then evaluated from a consistent entry rule (open of the bar after the retest). A forward scan computes MFE and MAE in points, enabling objective comparison across setups.

A single-parameter constrained brute-force search groups setups by retestBars, computes avgMFE and avgMAE per group, and scores them using avgMFE βˆ’ avgMAE. In MQL5, optimization runs in OnInit over a clamped date window, outputs separate bullish/bearish optimal ranges, and applies them in OnCalculate with a runtime summar...

πŸ‘‰ Read | Quotes | @mql5dev

#MQL5 #MT5 #Indicator
❀34πŸ‘8😱5πŸ‘Œ2
Aura Heiken Ashi is a trend-following indicator built to reduce noise and focus on higher-probability entries. It extends classic Heiken Ashi with multiple confirmation layers intended to keep signals aligned with the prevailing market direction.

Core logic combines dual smoothing (SMMA plus EMA), dynamic supply and demand lines from recent imbalances, and a 200 EMA trend gate that permits bullish signals only above the line and bearish signals only below it. Momentum checks are validated with CCI and MACD, while ADX suppresses low-quality periods by switching candles to gray in low-volatility ranges. Tick volume is compared to local averages to confirm participation.

Operational rules: green candles favor longs above the 200 EMA, ideally near demand. Red candles favor shorts below the 200 EMA, ideally near supply. Gray candles indicate no trade. Con...

πŸ‘‰ Read | Freelance | @mql5dev

#MQL4 #MT4 #Indicator
❀45πŸ”₯5πŸ‘Œ4😱2πŸ†2πŸ‘€2πŸŽ‰1
Most retail indicators depend on fixed lookback windows. A static period treats every tick equally, so sudden liquidity sweeps and long wicks are absorbed into the calculation. The result is distorted slope, delayed confirmation, and frequent false breakout signals on lower timeframes.

Quantitative desks typically model the broker feed as a noisy measurement rather than ground truth. A Kalman Filter provides recursive state estimation by separating the underlying state (trend) from measurement noise in real time.

Key mechanics include a dynamic Kalman Gain that reduces sensitivity when volatility becomes erratic, limiting the impact of transient spikes. Since the model is predictive and recursive, it does not require an arbitrary period; tuning is handled through process-noise and measurement-noise parameters.

Common deployment targets are M1–M1...

πŸ‘‰ Read | Docs | @mql5dev

#MQL5 #MT5 #Indicator
❀25πŸ‘Œ2⚑1
MACD Institutional is a MACD variant that filters price input using high-volume activity before computing its averages. Instead of processing every tick or bar close, it reconstructs an internal price series and updates it only when current volume exceeds a volume moving average.

This approach treats low-volume moves as statistically weak. An analysis buffer (InpBufferSize) is refreshed only on above-average volume; otherwise prior values are retained, preserving state and reducing reactions to thin-liquidity noise.

Core functions include dynamic volume filtering driven by InpMAVolumePeriod, fewer low-activity crossovers, and a custom EMA computed strictly over the filtered window. Parameters cover volume averaging period, buffer size, classic fast/slow EMA periods, and the signal period.

Technical notes: author Fernando Javier De MendonΓ§a, built for Me...

πŸ‘‰ Read | VPS | @mql5dev

#MQL5 #MT5 #Indicator
❀19πŸ‘3πŸ‘Œ3✍2
Inside Bar detection has been automated for traders who rely on price action breakouts. The indicator scans charts for Inside Bar structures and classifies the result as bullish, bearish, or neutral based on the small candle’s open/close relationship.

Once confirmed, it plots a projection rectangle from the mother candle’s high/low and extends it forward by a configurable number of bars. Optional labels are printed next to each zone, with controls to keep only the last N patterns to reduce chart load.

Alerting supports popup, sound, mobile push, and optional email. Visual settings include automatic direction-based colors or manual overrides, plus optional rectangle fill. Designed to run on any symbol and timeframe, with non-repainting signals fixed after bar close and processing optimized to recent/visible candles.

πŸ‘‰ Read | Freelance | @mql5dev

#MQL5 #MT5 #Indicator
❀26πŸ‘5πŸ‘Œ2⚑1πŸ”₯1
A momentum-based candle coloring method can improve visibility of market direction and price activity by classifying each bar into four states.

Bullish momentum is shown in green (0.0), bearish momentum in red (1.0), and weak or no momentum in gray (2.0). A separate state flags news impact via candle expansion in silver (3.0), helping isolate unusually large ranges from routine movement.

The default momentum period is 4, tuned to detect sharper momentum shifts with minimal lag. This setup is suitable for quick visual triage before validating signals with volume, volatility, and session context.

πŸ‘‰ Read | CodeBase | @mql5dev

#MQL5 #MT5 #Indicator
❀29⚑5πŸ‘Œ2
This article builds a real-time flag pattern detector for MetaTrader 5 that replaces visual guesswork with repeatable rules. It validates continuation flags using ATR-normalized pole strength, capped retracement, bounded consolidation length, and breakout confirmation, while rejecting weak or overlapping setups.

The MQL5 design is fully graphical: no indicator buffers, only chart objects. Once confirmed, it draws the pole, an adaptive slanted channel from internal highs/lows, a shaded consolidation box, breakout arrow, and labels, with optional alerts.

Efficiency comes from a two-phase OnCalculate flow: one-time historical scan, then incremental updates using prev_calculated, tracking forming patterns separately from already-drawn ones to keep charts clean and processing fast on lower timeframes.

πŸ‘‰ Read | NeuroBook | @mql5dev

#MQL5 #MT5 #Indicator
❀24🀩2✍1πŸŽ‰1πŸ‘Œ1
John Ehlers documented the Hilbert Oscillator in Rocket Science For Traders (pp. 90–91). The indicator is commonly used to flag major turning points by analyzing the relationship between two plotted lines.

A typical interpretation is trend confirmation on crossovers: when the blue line crosses above the red line, an uptrend bias is indicated; the reverse crossover signals a potential downtrend bias.

The MetaTrader 5 implementation adds zero-line color states for immediate signals. A green state above the zero line is treated as a buy condition, while a red state below the zero line is treated as a sell condition.

The MetaTrader 4 variant is not included. Source code and the download are distributed via a Telegram channel referenced in the profile.

πŸ‘‰ Read | CodeBase | @mql5dev

#MQL5 #MT5 #Indicator
❀35πŸ‘Œ4πŸ‘3
A moving average bands width metric can be used to monitor volatility conditions. The indicator focuses on band width rather than price direction, treating contraction and expansion as volatility signals.

This implementation adds one visual change: periods when band width reaches extreme lows are highlighted in red. These low-width zones can flag unusually compressed conditions, where volatility expansion may follow.

Practical use is non-directional. It can support trade context by identifying congestion, then monitoring for potential trend change after compression, or trend continuation when a range resolves into a directional move.

πŸ‘‰ Read | Calendar | @mql5dev

#MQL5 #MT5 #Indicator
❀38πŸ‘Œ2
An updated Moving Average Bands variant has been published with clearer, signal-oriented behavior. The extension adds a practical ruleset that derives trade signals directly from band values, making the use case more explicit than the earlier release.

The recommended workflow uses band color changes as an actionable state indicator. These transitions can be mapped to initial entries, re-entries after pullbacks, and early exit candidates when conditions reverse.

This approach keeps the logic on-chart and reduces reliance on external filters, while remaining transparent enough to audit and adjust for different instruments and timeframes.

πŸ‘‰ Read | Freelance | @mql5dev

#MQL5 #MT5 #Indicator
❀75πŸ‘15πŸ‘Œ5πŸ†3🀝2
Raw forex and futures prices are non-stationary, so standard regression/classification models trained on levels tend to produce spurious relationships and look-ahead issues. Integer differencing forces stationarity but removes much of the dependence structure that ML features often rely on.

Fixed-width fractional differencing (FFD) uses a non-integer order d in (0, 1) to reach stationarity while retaining as much memory as possible. Weights follow the recurrence w[0]=1, w[k]= -w[k-1]*(d-k+1)/k and stop once |w[k]| falls below a threshold, then apply a reversed dot product over a log-price lookback window.

A production-focused MQL5 implementation is provided: a header-only CFFDEngine with Init(), Compute(), and ComputeBuffer() with prev_calculated optimization, plus an indicator wrapper supporting all applied price types. No dynamic allocation occurs after ...

πŸ‘‰ Read | Signals | @mql5dev

#MQL5 #MT5 #Indicator
❀47πŸ‘7πŸ‘Œ6πŸŽ‰2πŸ‘1
Seasonality is measurable recurring price behavior driven by calendar effects and market structure. It is most visible in commodities, but it also appears in FX and equity indices. A practical implementation in MetaTrader 5 uses MQL5 to score seasonality quality for a single symbol or a two-instrument spread.

Spread trading combines long/short exposure on related instruments to target relative price moves. The SpreadMultiYearComparison indicator computes a spread as the difference of the two opens, with optional weighting coefficients to align tick values and quote scales.

Methodology relies on 10–15+ years of D1 history, analyzing one selected month across years. A pattern is treated as actionable when direction repeats in ~70–75% of years and results are not dominated by outliers. The tool outputs year-by-year month returns, an average curve, and a...

πŸ‘‰ Read | VPS | @mql5dev

#MQL5 #MT5 #Indicator
❀38πŸ‘Œ4✍2πŸ‘2
Part 2 extends the defensive foundation with long-memory measurement on NQ M1 using a robust Hurst workflow.

Three estimators are implemented and blended: classical R/S (Hurst 1951, with Lo 1991 bias considerations), aggregated variance, and absolute moments. Each produces H plus a confidence weight based on valid log-log regression points; low-confidence outputs are excluded.

Four functions are added to MicroStructure_Foundation.mqh: HurstExponentRS(), AdvancedHurstExponent(), HurstExponentRobust(), and PopulateHurstAnalysis(). Results write into RobustFractalAnalysis without new includes. HurstProfile.mq5 plots H*(t), confidence, and a regime buffer.

An empirical run over 133 NQ Globex sessions (Nov 2025–May 2026) shows H*(t) near 0.47–0.50, requires ~40 post-open bars to activate, and breaks if pre-open/post-open data are mixed. Predictive power ...

πŸ‘‰ Read | VPS | @mql5dev

#MQL5 #MT5 #Indicator
❀33πŸ‘11🀯2πŸ‘Œ2πŸ†2πŸ€”1
A custom MACD indicator adds a full three-part view in a separate window: a color-coded histogram plus the MACD and Signal lines. This differs from common default layouts that emphasize the histogram only, improving visibility of momentum shifts and line crossovers.

Histogram coloring reflects the zero level: Green when MACD is above 0 and Salmon when below 0. This makes bias changes and zero-line transitions easier to spot at a glance.

Key components include the MACD line (Fast EMA minus Slow EMA), the Signal line (moving average of MACD), and the histogram. Inputs cover Fast/Slow periods (12/26), Signal period (9), selectable Signal MA method (SMA, EMA, SMMA, LWMA), and applied price (default Median).

Typical use cases: zero-line changes for momentum regime shifts, MACD/Signal crossovers for entries/exits, and classical divergence detection. Suitable ...

πŸ‘‰ Read | Freelance | @mql5dev

#MQL5 #MT5 #Indicator
❀33πŸ‘7✍6πŸ‘Œ2πŸ‘€2