MQL5 Algo Trading
488K subscribers
3.08K photos
3.08K 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
ATR Strength Index implements an RSI-style oscillator where the input series is ATR delta rather than price change. Each bar computes diff between consecutive iATR values, splits it into positive and negative components, and applies Wilder smoothing over RSI_period via PosBuffer and NegBuffer.

An Invert switch flips the diff sign so the oscillator aligns with standard RSI direction conventions. Output is clamped to 0..100 with neutral handling when both smoothed legs are zero.

The indicator draws in a separate window, limits processing via NumberOfBars, and adds adjustable upper/lower horizontal levels with custom colors using OBJ_HLINE.

πŸ‘‰ Read | NeuroBook | @mql5dev

#MQL4 #MT4 #AI
❀34πŸ”₯4πŸ†2πŸ‘Œ1
Hidden Smash Day setups are simple in concept but ambiguous on charts. For systematic trading, terms like β€œlower portion of the bar” and β€œconfirmation” must be converted into numeric thresholds to stay deterministic in backtests and live runs.

An MQL5 custom indicator can codify the Larry Williams rules: close location within the bar range, close relative to the prior close, and next-session confirmation (buy: next close above prior high; sell: next close below prior low). Signals can be marked immediately or only after confirmation via an input mode.

Visual output stays minimal: sea green up arrows below buy bars and black down arrows above sell bars. The implementation emphasizes non-repainting logic, strict bar-complete evaluation, and consistent buffer indexing for historical and real-time updates.

πŸ‘‰ Read | Calendar | @mql5dev

#MQL5 #MT5 #Indicator
❀42⚑5πŸ‘€2πŸ‘Œ1
Part 2 extends a news filter beyond blocking entries by managing already-open positions during high-impact windows. The goal is to prevent premature SL/TP hits from spread widening and transient spikes without closing trades or altering strategy statistics.

A controlled layer suspends SL/TP once per news window, stores original levels per ticket, and restores them deterministically when the window ends. Restoration is price-aware: if the market has not crossed stored levels, restore exactly; if crossed, place the nearest broker-valid level in front of price while respecting minimum stop distances.

Implementation requires a per-ticket state container, a suspension flag to prevent repeated modifications, magic-number scoping, and explicit single-symbol behavior. Risk remains during suspension due to lack of hard stops; the window should be short. Persistent s...

πŸ‘‰ Read | Quotes | @mql5dev

#MQL5 #MT5 #EA
❀58πŸ‘€6⚑5πŸ‘Œ4πŸ†4
CRT Indicator (STF) is a compact MQL5 indicator designed to objectively test β€œtextbook” Candle Range Theory patterns directly on live charts. Implemented in under 100 lines, the focus is strict structure and unambiguous rules rather than discretionary pattern matching.

The logic targets a three-candle formation with explicit conditions: directional shift, range expansion, midpoint placement, and a structure violation trigger. When detected, the originating candle range is projected immediately using simple trendlines.

No buffers, no multi-timeframe inputs, no repaint behavior, and no visual clutter. Output is single-timeframe structural detection rendered in real time.

Primary use is comparative analysis: how these rigid CRT definitions behave across symbols and timeframes when reduced to candle geometry only. This is a diagnostic tool, not a comple...

πŸ‘‰ Read | AppStore | @mql5dev

#MQL5 #MT5 #Indicator
❀53😁2πŸŽ‰2πŸ‘Œ2⚑1
A Telegram notification bridge for MT5 trade activity, built with dual detection. Real-time events are handled via OnTradeTransaction, with a 2-second deal history scan as fallback. A deduplication layer tracks the last 500 deals in memory to prevent duplicate alerts when both paths report the same event.

Covers trade open/close, SL/TP edits with old→new values, pending orders, reversals, deposits/withdrawals, connection state, and periodic account summaries (balance, equity, free margin, floating P/L, session P/L, day high/low equity, drawdown). Optional symbol, lot-size, and magic-number filters support multi-EA accounts.

Setup requires a Telegram bot token, chat ID, starting the bot chat, and allowing WebRequest for https://api.telegram.org in MT5. Runs only on live/demo charts since Strategy Tester blocks network calls. Uses HTTPS POST via WebRequest wi...

πŸ‘‰ Read | CodeBase | @mql5dev

#MQL5 #MT5 #EA
❀31πŸ‘€5πŸ‘Œ3πŸ‘Ύ3✍2πŸ†2⚑1
Multivariate time series forecasting benefits from modeling both temporal structure and cross-channel dependencies, which is critical in finance where correlations shift during regime changes. Common baselines either process channels independently, concatenate everything, or cluster variables, each with clear tradeoffs.

The DUET framework proposes dual clustering: Temporal Clustering (TCM) for heterogeneous time patterns and Channel Clustering (CCM) for frequency-domain channel selection, followed by a Fusion Module using masked attention and a prediction head. Reported results show consistent accuracy gains under variability.

An MQL5 implementation can map MoE-style temporal encoders to convolutional layers for segmented parallelism, with Top-K noisy gating implemented via OpenCL kernels (forward TopKgates and backward TopKgatesGrad) to select active ex...

πŸ‘‰ Read | AppStore | @mql5dev

#MQL5 #MT5 #ML
❀68πŸ€”5πŸ‘Œ4✍3πŸ’―2πŸ†2
On-balance volume (OBV) is a momentum indicator that uses volume flow to anticipate potential changes in price. It was developed by Joseph Granville and popularized in his 1963 work, Granville's New Key to Stock Market Profits.

A common limitation of standard OBV is low signal quality. Direction can change frequently, and the line itself often lacks clear levels that can be referenced for breaks, pullbacks, or confirmation.

One practical adjustment is to apply Donchian-style channels to the OBV series. The goal is to frame recent OBV extremes, reduce noise sensitivity, and make break conditions more explicit.

Usage remains consistent with OBV. Channel breaks and color-state changes can be monitored as candidates for breakouts, retracements, and momentum shifts.

πŸ‘‰ Read | Docs | @mql5dev

#MQL5 #MT5 #Indicator
❀31✍5πŸ‘Œ4🀝2
Recurring M1–M15 entries fail when price hits H1/H4/daily liquidity. Manual multi-chart confirmation is slow and unreliable.

Proposed solution: an MQL5 indicator with explicit inputs (ZoneTimeframe, LookbackBars, RatioMultiplier, ExtendBars, allowed reversal patterns, alert throttling) and measurable acceptance criteria. Detect HTF supply/demand via base→impulse scans, project zones onto the active chart, then alert only on zone re-entry plus a formal LTF reversal (engulfing, pin bar, inside-bar breakout).

Architecture: Zone Detection, Visual Layer with persistent rectangles across timeframe changes, and Reaction Monitoring on closed bars. OnCalculate runs two-pass: populate historical arrows, then emit a single non-repeating real-time alert per zone using per-zone triggered flags and throttling.

πŸ‘‰ Read | Calendar | @mql5dev

#MQL5 #MT5 #AlgoTrading
❀34πŸ‘Œ5πŸ‘3⚑2
Standard HPO patterns break down on financial labels with overlap. GridSearchCV and RandomizedSearchCV waste trials, cannot stop after the first PurgedKFold fold, and do not persist state for crash recovery or parallel workers. The result is excess compute, biased validation from leakage, and fragile experiments.

Optuna fits this domain when wired to a strict data contract: X/y aligned to event times, PurgedKFold as the only splitter, and separate weights for training (uniqueness) versus scoring (return attribution). A WeightedEstimator wrapper keeps weight computation inside the estimator so the objective stays focused on CV.

A workable setup: TPE sampling, fold-level reporting for pruning, Hyperband allocation across trials, SQLite storage with resume, plus a suggester that maps sklearn distributions to trial.suggest_* and treats weight scheme and decay as...

πŸ‘‰ Read | CodeBase | @mql5dev

#MQL5 #MT5 #Optuna
❀33πŸ‘Œ4
This article turns Hidden Smash Day detection into a testable MT5 trading system by separating pattern recognition (custom indicator buffers) from execution logic (Expert Advisor). Signals are only evaluated on new bars: a Hidden Smash at index 2 becomes tradable only after the next bar closes beyond its high/low, ensuring reproducible backtests.

The EA adds context filters: configurable trade direction, optional Supertrend alignment, and weekday-based trading permissions. Risk controls are explicit: stop-loss can be set to the Hidden Smash bar extreme or ATR-based volatility distance, take profit uses a fixed reward-to-risk ratio, and sizing supports fixed lots or balance-based risk percent via OrderCalcProfit while respecting broker volume constraints.

Execution enforces one position per magic number, with indicator handles and CTrade simplifying integrat...

πŸ‘‰ Read | NeuroBook | @mql5dev

#MQL5 #MT5 #EA
❀39πŸ‘Œ4
Manual trendlines stay as the trader’s input, but an MT5 Expert Advisor takes over the tedious part: continuously watching those lines for meaningful price interactions.

The workflow is built around explicitly synchronizing only the OBJ_TREND objects that matter. Once synced, the EA tracks each line’s lifecycle via OnChartEvent (create/modify/delete), keeps a structured internal list keyed by object name, and updates it when objects change.

For monitoring, the EA converts the two anchor points (time/price) into a live reference level by computing slope and projecting the line’s current price each tick. It then classifies interactions such as approach, touch, break, or rejection and raises alerts plus on-chart status updatesβ€”useful for multi-chart trading without constant screen time.

πŸ‘‰ Read | AppStore | @mql5dev

#MQL5 #MT5 #EA
❀99πŸ†9πŸ‘Œ6⚑2πŸ‘2
An indicator module that auto-plots Fibonacci retracement and extension levels from the latest ZigZag swing high/low. Levels refresh automatically when new swing points are confirmed, keeping the grid aligned with current structure.

Supported ratios include 0%, 23.6%, 38.2%, 50%, 61.8%, 78.6%, 100%, 127.2%, and 161.8%. Each level can be enabled or disabled independently, with optional price labels per level. A ZigZag connector line can also be shown for context.

ZigZag parameters are configurable via depth, deviation, and backstep. Computation is optimized to process only on new bars, reducing redundant recalculation. Fibonacci ratios remain a core reference set for harmonic-pattern workflows.

πŸ‘‰ Read | VPS | @mql5dev

#MQL4 #MT4 #Indicator
❀36πŸ‘3πŸ‘Œ3πŸ’―2🀩1
Swap carry is often treated as background noise in intraday systems, but it can represent a sizable hidden cost, including triple charges midweek. On some symbols, a positive swap can offset spread and commission over time, making outcomes more predictable than direction-only trading.

Classic swap locking uses two accounts with different swap tables on the same instrument, holding opposing positions. Best cases have positive swap on both sides; profit remains forecastable but still requires balance management between accounts.

A more technical extension uses synthetic positions derived from correlated pairs (for example, EURJPY as EURUSD plus USDJPY) to replicate exposure while targeting different swap profiles. A utility concept is outlined: parse Market Watch symbols, normalize naming, build currency graphs, and search bounded-length β€œswap polygo...

πŸ‘‰ Read | AlgoBook | @mql5dev

#MQL5 #MT5 #AlgoTrading
❀59✍8πŸ‘Œ3😁1
During optimisation in the Strategy Tester, some passes may crash due to insufficient memory. A practical approach is to identify β€œemergency” passes and correlate them with input parameter combinations, but manual analysis becomes unreliable when an Expert Advisor has many variants and non-linear allocation patterns.

A lightweight helper library can record memory consumption over time during a pass, making it easier to spot configurations that trigger abnormal growth. In a minimal example, an EA that repeatedly grows an array produces a clear, repeatable memory profile, and the top parameter set can be reproduced in a single run.

This enables targeted debugging of parameter sets with excessive allocations. Lower memory usage also increases optimisation capacity by allowing more testing agents to run in parallel, improving overall throughput.

πŸ‘‰ Read | CodeBase | @mql5dev

#MQL5 #MT5 #EA
❀29πŸ‘1
DoEasy chart object collection received a maintenance update after issues were found when adding indicator windows to the main chart window. The model remains: each chart maps to a chart object, containing window objects and indicator objects, with at least the main window present.

Library support files were extended with new message indices and configuration for screenshot/template storage. Screenshots target Terminal\MQL5\Files\DoEasy\ScreenShots\ with default .gif/.png/.bmp handling, while templates target Terminal\MQL5\Profiles\Templates\DoEasy\. A helper generates stable, time-based filenames with optional extra data for uniqueness.

Chart/window navigation and coordinate conversion were added using ChartXYToTimePrice and ChartTimePriceToXY, including per-window cursor coordinate storage and relative Y calculations. Indicator list refresh now compare...

πŸ‘‰ Read | AppStore | @mql5dev

#MQL5 #MT5 #Indicator
❀57πŸ‘12
A digital filter variant based on Hann windowing is available with an adjustable β€œspeed up” factor that changes responsiveness without altering the selected period.

With the speed up factor set to 0, output matches the baseline filter. Any value above 0 increases reaction speed. A comparison at the same period shows a visible difference between the default output and a configuration using speed up factor 5.

Operational guidance remains consistent with standard smoothing filters and moving averages. Higher speed up values reduce lag but typically reduce smoothness and can amplify short-term fluctuations.

Parameter selection is best handled through testing: increase speed up until responsiveness is acceptable, then back off if noise and instability become excessive.

πŸ‘‰ Read | Docs | @mql5dev

#MQL5 #MT5 #Indicator
❀24πŸ‘5πŸ‘Œ1
Efficient MT5 development starts with a clean project layout: keep Experts, Includes, Scripts, and Files in per-project subfolders. This keeps search scoped, makes Git tracking straightforward, and allows fast copying between demo and real terminals.

Avoid duplicated sources across terminals by relocating the MQL5 folder into a central projects directory and using a Windows symbolic link. One codebase then serves multiple terminals without manual sync.

Treat MQL5 like any professional codebase: use Git with a focused ignore list, commit frequently, and push to a remote for history and recovery. Debug on a separate demo terminal, release only compiled binaries to real accounts, and batch-compile all modules to catch interface drift early.

Improve diagnosis with targeted log extraction, external log review with highlighting, and regex-based contextu...

πŸ‘‰ Read | Docs | @mql5dev

#MQL5 #MT5 #AlgoTrading
❀75πŸ‘Œ2
A Bid-Ask Profile Dashboard for MT5 demonstrates building a real-time microstructure visualization panel directly on an MT5 chart using the standard ChartObject GUI framework.

The indicator monitors live Bid and Ask ticks, tracks consecutive price changes, and converts short sequences of directional movement into a market-pressure histogram. A lightweight buffer stores recent updates, while trend-strength logic applies decay to reduce the impact of older moves.

The interface is fully custom and includes color-coded buy vs sell pressure, dynamic histogram bars, and a close button for quick removal. Updates are tick-driven to keep redraw overhead low.

The code illustrates practical patterns for MQL5 dashboard construction, efficient buffer management, reusable GUI helpers, and real-time component updates suited to tick-level analysis.

πŸ‘‰ Read | Freelance | @mql5dev

#MQL5 #MT5 #Indicator
❀41πŸ‘Œ5
Combining Moving Average trend direction with Average True Range can improve trade timing by aligning entries with prevailing momentum and current volatility.

Pivot Point levels add structured support and resistance zones that can be used to validate breakouts, fades, and stop placement around nearby levels.

Take Profit and Stop Loss lines help convert analysis into defined execution rules. Targets can be set to reflect ATR-based ranges, while stops can be placed beyond invalidation points to reduce noise-driven exits.

Market regime changes, scheduled news, and liquidity conditions should be evaluated before relying on static levels. Consistent position sizing and adherence to a written plan remain central to risk control.

πŸ‘‰ Read | VPS | @mql5dev

#MQL5 #MT5 #Strategy
❀36πŸ‘Œ3
An Inside Bar detection indicator is available for highlighting consolidation candles directly on the chart. The pattern is identified when the latest closed candle’s high and low remain fully within the prior candle’s range.

Detected Inside Bars are marked by applying a configurable candle color, allowing quick visual scanning across timeframes. This can be used to track compression zones that may precede directional expansion, without adding additional chart objects.

Alerting is optional and can be enabled per preference. Supported notifications include terminal popup alerts and mobile push notifications when a new Inside Bar forms on the most recently closed bar.

Key inputs: InsideBarColor, FireAlerts, EnablePushNotification, EnablePopupAlert.

πŸ‘‰ Read | CodeBase | @mql5dev

#MQL5 #MT5 #Indicator
❀28πŸ‘Œ4πŸ‘3
Neuro-Structural Trading Engine is a multi-account MT5 framework for crypto CFD prop accounts built to prevent three common failure modes: oversized ATR stops, account-switch side effects, and chop-induced death by a thousand cuts.

Risk control is enforced with fixed-dollar stops: lot size is computed from tick size/value so each trade can’t exceed a strict $1 loss cap, independent of volatility. The EA adds partial profit taking at 50% of target, then moves the remainder to breakeven, plus rolling stop logic and hard daily/max drawdown halts for prop rules.

Reliability comes from process isolation: one Python β€œBRAIN” per account, each tied to its own MT5 terminal to avoid the singleton login issue. Signals are generated in Python (LSTM + 8 normalized features) and gated by a compression-ratio regime filter that blocks choppy markets, then execute...

πŸ‘‰ Read | AlgoBook | @mql5dev

#MQL5 #MT5 #AlgoTrading
❀25πŸ‘4πŸ‘Œ4