An MQL5 analytical EA automates market-state reading using only closed-candle price action, reducing the manual workload across timeframes. It treats states as descriptive context, not signals: Compression (tight, overlapping ranges), Transition (loosening structure), and Expansion (wide, volatile movement). Trend is assessed separately via swing structure and close bias.
Implementation is modular: closed-candle gating (bar 1 timestamp) ensures non-repainting and runs once per bar for stable performance. Core features include relative range comparisons, CLV for close strength and directional bias, and swing-high/low scoring.
A hierarchical classifier resolves overlaps (Expansion, then Compression, then Trend, else Transition) and optional chart overlays visualize swings, compression zones, and state history without affecting logic.
π Read | Docs | @mql5dev
#MQL5 #MT5 #AlgoTrading
Implementation is modular: closed-candle gating (bar 1 timestamp) ensures non-repainting and runs once per bar for stable performance. Core features include relative range comparisons, CLV for close strength and directional bias, and swing-high/low scoring.
A hierarchical classifier resolves overlaps (Expansion, then Compression, then Trend, else Transition) and optional chart overlays visualize swings, compression zones, and state history without affecting logic.
π Read | Docs | @mql5dev
#MQL5 #MT5 #AlgoTrading
β€35π3π2
Part 47 extends the prior liquidity sweep/BOS EA with a Nick Rypock Trailing Reverse (NRTR) system in MQL5.
NRTR signals come from an ATR-based channel. A buy triggers when an up-support level appears after being EMPTY_VALUE on the prior bar; a sell triggers on the first down-support. Optional hedging allows opposing exposure, with MaxPositions enforcing caps.
The implementation loads the iCustom NRTR indicator, copies multiple buffers with retries, and centralizes execution in OnTick with new-bar gating. It adds auto/fixed sizing based on balance, equity, or free margin, ATR or points SL/TP, trailing modes, reversal exits, and virtual SL/TP closures.
π Read | Signals | @mql5dev
#MQL5 #MT5 #Strategy
NRTR signals come from an ATR-based channel. A buy triggers when an up-support level appears after being EMPTY_VALUE on the prior bar; a sell triggers on the first down-support. Optional hedging allows opposing exposure, with MaxPositions enforcing caps.
The implementation loads the iCustom NRTR indicator, copies multiple buffers with retries, and centralizes execution in OnTick with new-bar gating. It adds auto/fixed sizing based on balance, equity, or free margin, ATR or points SL/TP, trailing modes, reversal exits, and virtual SL/TP closures.
π Read | Signals | @mql5dev
#MQL5 #MT5 #Strategy
β€32π6
The article shows how to build custom MT5 indicators using window-function math instead of standard moving averages. Triangular windows can be derived by combining or directly computing linear coefficients, then normalized either for smoothing (MA-like) or for an oscillator that measures deviation from the mean.
It extends the idea by summing multiple sub-waves whose periods evenly divide the main period, letting developers keep low-frequency structure while controlling noise via a βnumber of wavesβ parameter. A key tradeoff is smoothing versus lag.
To reduce lag and improve responsiveness, the article introduces asymmetric sawtooth windows (LWMA as a single tooth) and multi-tooth variants that act like trend channel builders, with behavior changing for odd vs even wave counts.
Practical EAs test crossovers, historical βrewritingβ crossovers with fi...
π Read | NeuroBook | @mql5dev
#MQL5 #MT5 #Indicator
It extends the idea by summing multiple sub-waves whose periods evenly divide the main period, letting developers keep low-frequency structure while controlling noise via a βnumber of wavesβ parameter. A key tradeoff is smoothing versus lag.
To reduce lag and improve responsiveness, the article introduces asymmetric sawtooth windows (LWMA as a single tooth) and multi-tooth variants that act like trend channel builders, with behavior changing for odd vs even wave counts.
Practical EAs test crossovers, historical βrewritingβ crossovers with fi...
π Read | NeuroBook | @mql5dev
#MQL5 #MT5 #Indicator
β€22β‘3
GSM++ is a three-stage pipeline for graph-structured time series: hierarchical graph tokenization, local node encoding, and global dependency encoding. Hierarchical tokenization compacts topology and temporal order into sequences, improving feature extraction while reducing compute, with adjustable granularity per task.
An MQL5 implementation replaces HAC with a trainable Mixture of Tokenization using four token types per bar: node, edge, subgraph, and univariate subgraph. Tokens are fused via attention pooling (CNeuronMoT over CNeuronMHAttentionPooling). Local encoding uses Node-Adaptive Feature Smoothing to control per-node smoothing and reduce noise.
Global encoding follows a hybrid design: Chimera (2D-SSM) plus Hidformer (dual temporal/frequency streams). Testing showed excessive hold times, so CNeuronChimeraPlus adds a third 2D-SSM and rewrite...
π Read | Docs | @mql5dev
#MQL5 #MT5 #AlgoTrading
An MQL5 implementation replaces HAC with a trainable Mixture of Tokenization using four token types per bar: node, edge, subgraph, and univariate subgraph. Tokens are fused via attention pooling (CNeuronMoT over CNeuronMHAttentionPooling). Local encoding uses Node-Adaptive Feature Smoothing to control per-node smoothing and reduce noise.
Global encoding follows a hybrid design: Chimera (2D-SSM) plus Hidformer (dual temporal/frequency streams). Testing showed excessive hold times, so CNeuronChimeraPlus adds a third 2D-SSM and rewrite...
π Read | Docs | @mql5dev
#MQL5 #MT5 #AlgoTrading
β€40
Backtests were run on H1 for XAUUSD (01/03/2025β20/01/2026) and EURUSD (01/03/2025β21/01/2026) using a hybrid system: an ONNX market-structure classifier combined with deterministic execution and risk rules.
On each new bar, six ATR-normalized and context features are fed into the model: momentum change, distance to 50-bar swing high/low, relative tick volume vs 20-bar average, candle body strength, and hour-of-day. The model returns a structure label plus probability, with signals accepted only above a 0.65 confidence threshold.
Trade direction is filtered by a 50-period SMA: longs only above, shorts only below. Entries are placed as pending limits at a Fibonacci retracement level (default 61.8%) between detected pivots, with SL beyond structure invalidation, TP at 1:2 RR, and order expiry. Exposure is capped to one position or one pending order. Trailing ...
π Read | VPS | @mql5dev
#MQL5 #MT5 #AI
On each new bar, six ATR-normalized and context features are fed into the model: momentum change, distance to 50-bar swing high/low, relative tick volume vs 20-bar average, candle body strength, and hour-of-day. The model returns a structure label plus probability, with signals accepted only above a 0.65 confidence threshold.
Trade direction is filtered by a 50-period SMA: longs only above, shorts only below. Entries are placed as pending limits at a Fibonacci retracement level (default 61.8%) between detected pivots, with SL beyond structure invalidation, TP at 1:2 RR, and order expiry. Exposure is capped to one position or one pending order. Trailing ...
π Read | VPS | @mql5dev
#MQL5 #MT5 #AI
β€49β13β‘2
Backtests were run on EURUSD and GBPUSD from 01/03/2025 to 20/01/2026 on M5, with ONNX training targeted at M5βM15 behavior.
SidewaysMartingale is an Expert Advisor focused on range-bound execution with martingale recovery, gated by an ONNX-based regime classifier. The model outputs probabilities for sideways, bullish, and bearish states. Trading is enabled only when prob_side exceeds a configured threshold.
Model inputs use 9 engineered features: EMA200 slope, price distance to EMA200, ATR, range/ATR, breakout pressure, body dominance, day-of-week, hour-of-day, and previous candle direction.
Entries use Envelopes extremes: buys near the lower band and sells near the upper band, only under sideways confirmation. Martingale scaling is distance-based with capped series length and lot multiplier. A safety filter blocks new martingale legs when prob_bul...
π Read | AppStore | @mql5dev
#MQL5 #MT5 #AITrading
SidewaysMartingale is an Expert Advisor focused on range-bound execution with martingale recovery, gated by an ONNX-based regime classifier. The model outputs probabilities for sideways, bullish, and bearish states. Trading is enabled only when prob_side exceeds a configured threshold.
Model inputs use 9 engineered features: EMA200 slope, price distance to EMA200, ATR, range/ATR, breakout pressure, body dominance, day-of-week, hour-of-day, and previous candle direction.
Entries use Envelopes extremes: buys near the lower band and sells near the upper band, only under sideways confirmation. Martingale scaling is distance-based with capped series length and lot multiplier. A safety filter blocks new martingale legs when prob_bul...
π Read | AppStore | @mql5dev
#MQL5 #MT5 #AITrading
β€43π2π1
MetaTrader 5 exposes only current balance and equity, so long-term account behavior often gets analyzed outside the terminal. This article builds an MQL5 indicator that reconstructs the full deal history and plots four time series in a subwindow: starting balance baseline, realized balance (step changes on closes), equity, and floating P/L.
Accuracy comes from processing deals chronologically, detecting deposits/credits to anchor the baseline, and tracking position open/close state (including reversals). Equity is derived per bar as balance-at-time plus aggregated unrealized P/L across all open positions.
Performance is handled with per-bar sampling, periodic history refresh (based on deal count), cached tick specs per symbol, and a bounded price cache to avoid repeated CopyRates calls across multi-symbol portfolios. Practical outcome: immediate visual...
π Read | AppStore | @mql5dev
#MQL5 #MT5 #Indicator
Accuracy comes from processing deals chronologically, detecting deposits/credits to anchor the baseline, and tracking position open/close state (including reversals). Equity is derived per bar as balance-at-time plus aggregated unrealized P/L across all open positions.
Performance is handled with per-bar sampling, periodic history refresh (based on deal count), cached tick specs per symbol, and a bounded price cache to avoid repeated CopyRates calls across multi-symbol portfolios. Practical outcome: immediate visual...
π Read | AppStore | @mql5dev
#MQL5 #MT5 #Indicator
β€30
Part 6 refactors a dynamic multi-pair EA around execution quality rather than entry style, adding an adaptive spread module that continuously measures real-time spreads per symbol and blocks trading when costs spike.
Spreads are evaluated with both absolute limits and ATR-normalized thresholds, then symbols are ranked by a composite cost-efficiency score. Only the top set stays active, creating a smart routing layer that reallocates attention as liquidity changes and re-enables symbols when conditions recover.
Strategy logic remains simple (EMA crossover with RSI confirmation), but runs only after eligibility checks. The implementation emphasizes scalability: timer-driven spread scans, one-symbol-per-tick processing, instrument-aware pip/lot sizing, standardized CTrade execution, and a chart dashboard for transparency and diagnostics.
π Read | AppStore | @mql5dev
#MQL5 #MT5 #EA
Spreads are evaluated with both absolute limits and ATR-normalized thresholds, then symbols are ranked by a composite cost-efficiency score. Only the top set stays active, creating a smart routing layer that reallocates attention as liquidity changes and re-enables symbols when conditions recover.
Strategy logic remains simple (EMA crossover with RSI confirmation), but runs only after eligibility checks. The implementation emphasizes scalability: timer-driven spread scans, one-symbol-per-tick processing, instrument-aware pip/lot sizing, standardized CTrade execution, and a chart dashboard for transparency and diagnostics.
π Read | AppStore | @mql5dev
#MQL5 #MT5 #EA
β€31π€―1
NOA2 (NeuroBoids) blends classic Boids flocking with per-agent neural networks to solve continuous optimization. Agents still follow cohesion, separation, and alignment, but a small MLP learns from each agentβs own search history to adjust speed and dynamically reweight those rules.
The key idea is localized learning: agents near strong candidates naturally shift toward exploitation, while others remain exploratory. This produces heterogeneous behavior without centralized coordination, improving coverage early and refinement later.
The implementation defines an agent with position/velocity, an experience buffer, best-local tracking, and online weight updates. The NOA2 class adds configurable swarm distances/weights, speed limits, neural influence, and stagnation-aware exploration. Movement combines standard Boids forces with neural outputs, plus boundary...
π Read | Forum | @mql5dev
#MQL5 #MT5 #AlgoTrading
The key idea is localized learning: agents near strong candidates naturally shift toward exploitation, while others remain exploratory. This produces heterogeneous behavior without centralized coordination, improving coverage early and refinement later.
The implementation defines an agent with position/velocity, an experience buffer, best-local tracking, and online weight updates. The NOA2 class adds configurable swarm distances/weights, speed limits, neural influence, and stagnation-aware exploration. Movement combines standard Boids forces with neural outputs, plus boundary...
π Read | Forum | @mql5dev
#MQL5 #MT5 #AlgoTrading
β€21π6π3β2π2π2
Graph theory can be applied to price action by modeling swing highs/lows as nodes and chronological transitions as directed edges. Breadth-First Search (BFS) then traverses this structure level-order from a configurable historical root, keeping analysis time-consistent.
An EA design follows: detect swings, build an alternating high/low directed graph, run BFS to assign depth, classify nodes via higher-high/higher-low vs lower-high/lower-low logic, then aggregate a weighted bias score from -1 to +1 with recent levels prioritized.
Execution is gated by bias thresholds, optional swing-break confirmation, and CTrade-based order management. Modes cover bar lookback, multi-day context, or yesterday-only, with on-chart rendering of nodes, edges, levels, and current trade permission state.
π Read | Signals | @mql5dev
#MQL5 #MT5 #AlgoTrading
An EA design follows: detect swings, build an alternating high/low directed graph, run BFS to assign depth, classify nodes via higher-high/higher-low vs lower-high/lower-low logic, then aggregate a weighted bias score from -1 to +1 with recent levels prioritized.
Execution is gated by bias thresholds, optional swing-break confirmation, and CTrade-based order management. Modes cover bar lookback, multi-day context, or yesterday-only, with on-chart rendering of nodes, edges, levels, and current trade permission state.
π Read | Signals | @mql5dev
#MQL5 #MT5 #AlgoTrading
β€24β‘5π3
Socket-based IPC is being positioned as the next step for a MetaTrader 5 replay/simulator order system, keeping the design portable across apps and operating systems.
RTD/DDE with Excel is useful for teaching, but it is effectively one-way. A bidirectional channel enables calculations to run outside MQL5 and feed results back into an EA without recompilation.
A practical architecture places Python between MT5 and Excel. MT5 keeps client-side socket code in MQL5, while Python hosts the server side and can later swap Excel for other tooling.
Excel integration is handled via xlwings, which runs Python in place of some VBA workflows. Setup covers Python install with PATH, pip upgrades, installing xlwings, licensing for non-commercial use, and registering the Excel add-in via UI or xlwings CLI.
π Read | Forum | @mql5dev
#MQL5 #MT5 #Python
RTD/DDE with Excel is useful for teaching, but it is effectively one-way. A bidirectional channel enables calculations to run outside MQL5 and feed results back into an EA without recompilation.
A practical architecture places Python between MT5 and Excel. MT5 keeps client-side socket code in MQL5, while Python hosts the server side and can later swap Excel for other tooling.
Excel integration is handled via xlwings, which runs Python in place of some VBA workflows. Setup covers Python install with PATH, pip upgrades, installing xlwings, licensing for non-commercial use, and registering the Excel add-in via UI or xlwings CLI.
π Read | Forum | @mql5dev
#MQL5 #MT5 #Python
β€30π3π1
This article turns subjective supply/demand zone spotting into a reproducible workflow by quantifying the βimpulsive exitβ that signals imbalance.
The key simplification is modeling a zone with a single higher-timeframe candle and measuring momentum via an Impulse Ratio (close-open)/(high-low), paired with an absolute size filter normalized by ATR. This avoids fragile multi-candle base rules while keeping the structure tradable across timeframes.
A three-stage pipeline connects research to execution: an MQL5 scanner exports swing-point candle metrics to CSV, Python/Jupyter performs distribution and success-rate comparisons to optimize thresholds (e.g., impulse and ATR-scaled body size), then an MQL5 EA encodes the validated rules to project zones and support systematic retest strategies.
π Read | Freelance | @mql5dev
#MQL5 #MT5 #AlgoTrading
The key simplification is modeling a zone with a single higher-timeframe candle and measuring momentum via an Impulse Ratio (close-open)/(high-low), paired with an absolute size filter normalized by ATR. This avoids fragile multi-candle base rules while keeping the structure tradable across timeframes.
A three-stage pipeline connects research to execution: an MQL5 scanner exports swing-point candle metrics to CSV, Python/Jupyter performs distribution and success-rate comparisons to optimize thresholds (e.g., impulse and ATR-scaled body size), then an MQL5 EA encodes the validated rules to project zones and support systematic retest strategies.
π Read | Freelance | @mql5dev
#MQL5 #MT5 #AlgoTrading
β€33β2
ProjectTemplateGen.mq5 is an MT5 script utility that generates a standardized Expert Advisor project layout via MQL5 file system APIs, operating within the platform sandbox. It creates directories and writes ready-to-compile .mq5 sources with event handler skeletons, with runtime configuration through input parameters.
The implementation focuses on dynamic path construction using relative locations, comprehensive file-operation error handling with explicit error codes, and reliable cleanup via FileClose(). Output content is syntactically valid MQL5 and formatted consistently to support scaling.
Generated artifacts are placed under MQL5\Files\[ProjectName]\ due to security restrictions, requiring a manual move to MQL5\Experts\ before development continues.
Potential extensions include multi-file templates (indicators, libraries), emitting JSON/XML config file...
π Read | VPS | @mql5dev
#MQL5 #MT5 #script
The implementation focuses on dynamic path construction using relative locations, comprehensive file-operation error handling with explicit error codes, and reliable cleanup via FileClose(). Output content is syntactically valid MQL5 and formatted consistently to support scaling.
Generated artifacts are placed under MQL5\Files\[ProjectName]\ due to security restrictions, requiring a manual move to MQL5\Experts\ before development continues.
Potential extensions include multi-file templates (indicators, libraries), emitting JSON/XML config file...
π Read | VPS | @mql5dev
#MQL5 #MT5 #script
β€37π3β2
MQL5βs SQLite API is capable but forces manual SQL, repeated boilerplate, and fragile error handling. The article builds a lightweight ORM that moves SQL out of EA logic and replaces it with strongly-typed models and a fluent, reusable interface.
The framework is assembled from small components: a generic dictionary for named field access, an ORMField class that stores column metadata and values, a BaseModel that generates CREATE/INSERT/UPDATE queries and binds rows back into variables, and a database wrapper that centralizes core SQLite calls.
A DatabaseORM layer adds connection management, transactions, CRUD, selection helpers, and structured error reporting. Models can be defined manually, via reflection-style OnGet/OnSet binding, or through macros for fast Code-First table definitions.
Practical samples show storing and querying backtest reports with Sel...
π Read | Freelance | @mql5dev
#MQL5 #MT5 #EA
The framework is assembled from small components: a generic dictionary for named field access, an ORMField class that stores column metadata and values, a BaseModel that generates CREATE/INSERT/UPDATE queries and binds rows back into variables, and a database wrapper that centralizes core SQLite calls.
A DatabaseORM layer adds connection management, transactions, CRUD, selection helpers, and structured error reporting. Models can be defined manually, via reflection-style OnGet/OnSet binding, or through macros for fast Code-First table definitions.
Practical samples show storing and querying backtest reports with Sel...
π Read | Freelance | @mql5dev
#MQL5 #MT5 #EA
β€55π8β‘5π₯3π2π€©2
TelegramTradeNotify is a lightweight MT4 utility EA that pushes trade notifications to Telegram via the Bot API sendMessage endpoint.
MT4 has no deal events comparable to MT5, so detection is order-based. The EA periodically scans OrdersTotal() and OrdersHistoryTotal(); a new active order triggers an open alert, and a new history record triggers a close alert.
Configuration requires a Telegram bot token and a target Chat ID (user, group, or @channelusername). In MT4, enable βAllow WebRequest for listed URLβ and whitelist https://api.telegram.org, then attach the EA to any chart and set the inputs.
Supports optional BUY/SELL-only filtering, UTF-8 URL encoding for non-ASCII text, optional web page preview disable, configurable timeout, and message prefix. If WebRequest fails, validate firewall/DNS and note some VPS networks may block Telegram; a relay can be...
π Read | Docs | @mql5dev
#MQL4 #MT4 #EA
MT4 has no deal events comparable to MT5, so detection is order-based. The EA periodically scans OrdersTotal() and OrdersHistoryTotal(); a new active order triggers an open alert, and a new history record triggers a close alert.
Configuration requires a Telegram bot token and a target Chat ID (user, group, or @channelusername). In MT4, enable βAllow WebRequest for listed URLβ and whitelist https://api.telegram.org, then attach the EA to any chart and set the inputs.
Supports optional BUY/SELL-only filtering, UTF-8 URL encoding for non-ASCII text, optional web page preview disable, configurable timeout, and message prefix. If WebRequest fails, validate firewall/DNS and note some VPS networks may block Telegram; a relay can be...
π Read | Docs | @mql5dev
#MQL4 #MT4 #EA
β€31π6
A modified ZigZag indicator has been proposed with an alternative reversal condition. Instead of using a fixed percentage deviation to confirm a swing, the turning point is triggered when price reaches a defined ratio relative to the last confirmed local high or low.
This approach makes the threshold dependent on the prior extremum rather than an absolute percent move. It can change how frequently pivots are printed across different price levels and volatility regimes, and may reduce sensitivity to nominal price scale.
Use cases include swing structure tracking, adaptive pivot detection, and upstream signal generation for pattern or trend logic.
π Read | CodeBase | @mql5dev
#MQL4 #MT4 #Indicator
This approach makes the threshold dependent on the prior extremum rather than an absolute percent move. It can change how frequently pivots are printed across different price levels and volatility regimes, and may reduce sensitivity to nominal price scale.
Use cases include swing structure tracking, adaptive pivot detection, and upstream signal generation for pattern or trend logic.
π Read | CodeBase | @mql5dev
#MQL4 #MT4 #Indicator
β€39π3
Reversal patterns have weak formal definitions and no reliable math base beyond statistics. Practical validation comes from backtesting plus visual checks in the MetaTrader 5 Strategy Tester, prioritizing speed and sample size over perfect data.
Multiple Top is popular due to simple structure and frequent occurrence across instruments and timeframes. The concept extends beyond Double Top to Triple Top and Head and Shoulders, but consistent trading rules are rarely quantified, which makes algorithmic framing useful.
Implementation focus: bar-by-bar detection, custom top/bottom logic (not fractals), and a class-based βobserverβ that stores sequential steps. Workflow includes selecting relevant extrema near the current market, deciding pattern direction, filtering invalid selections, and defining a horizontal neckline between the first and last peak, ...
π Read | Forum | @mql5dev
#MQL5 #MT5 #AlgoTrading
Multiple Top is popular due to simple structure and frequent occurrence across instruments and timeframes. The concept extends beyond Double Top to Triple Top and Head and Shoulders, but consistent trading rules are rarely quantified, which makes algorithmic framing useful.
Implementation focus: bar-by-bar detection, custom top/bottom logic (not fractals), and a class-based βobserverβ that stores sequential steps. Workflow includes selecting relevant extrema near the current market, deciding pattern direction, filtering invalid selections, and defining a horizontal neckline between the first and last peak, ...
π Read | Forum | @mql5dev
#MQL5 #MT5 #AlgoTrading
β€69π6β1π1
βHeads or Tailsβ is a high-risk short-term trading approach used in equities and FX. Direction is selected randomly, commonly via a coin flip equivalent, while fundamental factors and objective signals are ignored.
Typical flow includes instrument selection, random buy/sell decision, and forced exit by time, take-profit, or stop-loss. The method is simple to implement but offers no basis for statistical edge and weakens risk control and capital allocation.
In automation, logic often checks that no positions are open (b + s = 0), then calls a pseudo-random generator (0β32767). Parity via modulo 2 selects direction: even opens a long position, odd opens a short position, each followed by an immediate return.
Use is mainly educational for platform mechanics or experimental testing, not for repeatable performance over long horizons.
π Read | Quotes | @mql5dev
#MQL4 #MT4 #AlgoTrading
Typical flow includes instrument selection, random buy/sell decision, and forced exit by time, take-profit, or stop-loss. The method is simple to implement but offers no basis for statistical edge and weakens risk control and capital allocation.
In automation, logic often checks that no positions are open (b + s = 0), then calls a pseudo-random generator (0β32767). Parity via modulo 2 selects direction: even opens a long position, odd opens a short position, each followed by an immediate return.
Use is mainly educational for platform mechanics or experimental testing, not for repeatable performance over long horizons.
π Read | Quotes | @mql5dev
#MQL4 #MT4 #AlgoTrading
β€36π€£6π2π₯1
Locking is a trade state where long and short positions of equal volume are held on the same instrument. Price movement impact is neutralized because gains on one side are offset by losses on the other, effectively freezing the net result until positions are modified or closed.
The VR Locker Lite approach begins by opening BUY and SELL immediately, then increases exposure on both sides through averaging, expanding the lock structure.
Common lock management paths include closing both legs and restarting the cycle, partially unlocking by holding one leg longer, applying trailing stops to one or both legs, shifting a leg to breakeven while keeping upside exposure, or creating additional locks on other symbols or via separate MagicNumber instances.
Key considerations include doubled commissions and potential swap costs, margin being tied up while the ...
π Read | Calendar | @mql5dev
#MQL4 #MT4 #AlgoTrading
The VR Locker Lite approach begins by opening BUY and SELL immediately, then increases exposure on both sides through averaging, expanding the lock structure.
Common lock management paths include closing both legs and restarting the cycle, partially unlocking by holding one leg longer, applying trailing stops to one or both legs, shifting a leg to breakeven while keeping upside exposure, or creating additional locks on other symbols or via separate MagicNumber instances.
Key considerations include doubled commissions and potential swap costs, margin being tied up while the ...
π Read | Calendar | @mql5dev
#MQL4 #MT4 #AlgoTrading
β€37π4
A practical control for MT4/MT5 Expert Advisors is the ability to detect duplicate instances on the same chart and react based on defined conditions. This can prevent double order placement, duplicated timers, and repeated event handling when templates are applied or charts are restored.
Using Expert.mqh from the referenced library, the EA can implement an instance check during initialization by scanning chart context and comparing identifiers such as symbol, timeframe, magic number, input signature, or a custom instance key. If a match is found, the EA can block startup, switch to read-only mode, or disable trading while continuing to monitor state changes.
π Read | AlgoBook | @mql5dev
#MQL5 #MT5 #EA
Using Expert.mqh from the referenced library, the EA can implement an instance check during initialization by scanning chart context and comparing identifiers such as symbol, timeframe, magic number, input signature, or a custom instance key. If a match is found, the EA can block startup, switch to read-only mode, or disable trading while continuing to monitor state changes.
π Read | AlgoBook | @mql5dev
#MQL5 #MT5 #EA
β€22β4π3π₯2
Locking is the simultaneous holding of a LONG and a SHORT position of equal volume on the same instrument. Price exposure is neutralized because gains on one leg are offset by losses on the other, keeping the net result largely unchanged while both legs remain open.
A typical implementation opens BUY and SELL immediately, then widens each side via averaging. Subsequent handling options include closing both legs and restarting, closing one leg and keeping the other running, applying trailing stops to one or both sides, or moving one leg to breakeven while keeping the other active. Parallel locks can be run on other instruments or isolated via separate MagicNumber values.
Key constraints remain: doubled commissions and potential negative swaps, margin still tied up, and higher decision complexity when selecting which leg to close and timing the exit.
π Read | AppStore | @mql5dev
#MQL5 #MT5 #EA
A typical implementation opens BUY and SELL immediately, then widens each side via averaging. Subsequent handling options include closing both legs and restarting, closing one leg and keeping the other running, applying trailing stops to one or both sides, or moving one leg to breakeven while keeping the other active. Parallel locks can be run on other instruments or isolated via separate MagicNumber values.
Key constraints remain: doubled commissions and potential negative swaps, margin still tied up, and higher decision complexity when selecting which leg to close and timing the exit.
π Read | AppStore | @mql5dev
#MQL5 #MT5 #EA
β€22β‘7β1π1