A custom MACD implementation for MQL5 extends functionality beyond the standard indicator. The code mirrors the calculation logic and feature set found in the Pine Script version, keeping outputs consistent across platforms.
This approach can add configuration options and signal behavior not present in the built-in MQL5 MACD, while retaining expected MACD line, signal line, and histogram behavior. It also supports closer parity for teams maintaining strategies that need matching indicator semantics between TradingView studies and MT5 execution code.
π Read | Freelance | @mql5dev
#MQL5 #MT5 #Indicator
This approach can add configuration options and signal behavior not present in the built-in MQL5 MACD, while retaining expected MACD line, signal line, and histogram behavior. It also supports closer parity for teams maintaining strategies that need matching indicator semantics between TradingView studies and MT5 execution code.
π Read | Freelance | @mql5dev
#MQL5 #MT5 #Indicator
β€22π3
A price-action indicator for Smart Money Concepts workflows automates detection and plotting of Fair Value Gaps (FVGs) in real time. An FVG is defined as a three-candle sequence where the wick range of the first and third candles does not overlap, leaving an imbalance across the second candle.
Bullish (demand) and bearish (supply) zones are marked on the close of the third candle. The calculation is based only on closed bars, so plotted zones do not repaint or shift after confirmation.
Performance is kept predictable by scanning a user-defined history window. Parameters include HistoryBars (default 500), plus separate color settings for bullish and bearish zones. Typical use is M5/M15 for execution-level entries and H1/H4 for broader liquidity targets and mitigation levels.
π Read | Docs | @mql5dev
#MQL5 #MT5 #Indicator
Bullish (demand) and bearish (supply) zones are marked on the close of the third candle. The calculation is based only on closed bars, so plotted zones do not repaint or shift after confirmation.
Performance is kept predictable by scanning a user-defined history window. Parameters include HistoryBars (default 500), plus separate color settings for bullish and bearish zones. Typical use is M5/M15 for execution-level entries and H1/H4 for broader liquidity targets and mitigation levels.
π Read | Docs | @mql5dev
#MQL5 #MT5 #Indicator
β€37β2π2
DoEasyβs chart handling is consolidated into a chart object collection, giving structured access to every open MT5 chart, its subwindows, and attached indicators. The design targets safer iteration and selection across charts by exposing searchable, sortable lists keyed by chart properties.
Change detection avoids relying on CHARTEVENT_CHART_CHANGE (too generic) and instead uses a timer: twice per second it compares the current count of open charts and chart windows to cached values, rebuilding lists only when counts differ. This reduces event noise while keeping state consistent.
The update logic rebuilds window lists when indices shift, fixes loops to use list sizes (not terminal counts), and prevents leaks when list insertion fails. The collection enumerates charts via ChartFirst/ChartNext, supports add/remove sync, and refreshes each chart object to re...
π Read | CodeBase | @mql5dev
#MQL5 #MT5 #EA
Change detection avoids relying on CHARTEVENT_CHART_CHANGE (too generic) and instead uses a timer: twice per second it compares the current count of open charts and chart windows to cached values, rebuilding lists only when counts differ. This reduces event noise while keeping state consistent.
The update logic rebuilds window lists when indices shift, fixes loops to use list sizes (not terminal counts), and prevents leaks when list insertion fails. The collection enumerates charts via ChartFirst/ChartNext, supports add/remove sync, and refreshes each chart object to re...
π Read | CodeBase | @mql5dev
#MQL5 #MT5 #EA
β€64π7
An Expert Advisor runs DOOM (1993) inside a MetaTrader 5 chart by rendering frames into a bitmap label created with ObjectCreate and updated via ResourceCreate. Keyboard input is handled through OnChartEvent and forwarded to a DOOM engine hosted in a custom Windows DLL.
The EA file alone is insufficient. Deployment requires a package containing doomlib.dll and the shareware doom1.wad. Without these files in MQL5\Libraries and MQL5\Experts\Doom, initialization fails. DLL imports must be enabled.
Implementation uses a DLL wrapper around PureDOOM (single-header C port). The game loop runs on a background thread with double-buffered 320x200 ARGB output. The EA triggers updates about every 33ms using EventSetMillisecondTimer, copies the framebuffer to a chart bitmap, and handles key-up by polling GetAsyncKeyState due to missing CHARTEVENT_KEYUP support.
π Read | Quotes | @mql5dev
#MQL5 #MT5 #EA
The EA file alone is insufficient. Deployment requires a package containing doomlib.dll and the shareware doom1.wad. Without these files in MQL5\Libraries and MQL5\Experts\Doom, initialization fails. DLL imports must be enabled.
Implementation uses a DLL wrapper around PureDOOM (single-header C port). The game loop runs on a background thread with double-buffered 320x200 ARGB output. The EA triggers updates about every 33ms using EventSetMillisecondTimer, copies the framebuffer to a chart bitmap, and handles key-up by polling GetAsyncKeyState due to missing CHARTEVENT_KEYUP support.
π Read | Quotes | @mql5dev
#MQL5 #MT5 #EA
β€29π€£12π₯11π4π±2π2
Chart object work in MQL5 is being extended with a window layer and indicator descriptors.
Two new classes are added in ChartWnd.mqh: CWndInd for an indicator attached to a window, and CChartWnd for a chart window that stores size and a list of attached indicators. CWndInd keeps chart ID, window index, short name, and handle, with comparison logic based on handle/window index or short name.
CChartWnd manages per-window properties previously skipped at chart level: Y-distance to main window and window height, plus height changes via ChartSetInteger with forced redraw and event-queue checks.
Indicator enumeration uses ChartIndicatorGet by short name, with immediate handle release to avoid leaking usage counters. The window object can build/sync its indicator list, verify real presence, and remove stale entries.
π Read | NeuroBook | @mql5dev
#MQL5 #MT5 #Indicator
Two new classes are added in ChartWnd.mqh: CWndInd for an indicator attached to a window, and CChartWnd for a chart window that stores size and a list of attached indicators. CWndInd keeps chart ID, window index, short name, and handle, with comparison logic based on handle/window index or short name.
CChartWnd manages per-window properties previously skipped at chart level: Y-distance to main window and window height, plus height changes via ChartSetInteger with forced redraw and event-queue checks.
Indicator enumeration uses ChartIndicatorGet by short name, with immediate handle release to avoid leaking usage counters. The window object can build/sync its indicator list, verify real presence, and remove stale entries.
π Read | NeuroBook | @mql5dev
#MQL5 #MT5 #Indicator
β€66π6π3π₯2π€£2
In live execution, entry logic alone does not control risk. Broker microstructure, order book visibility, and short-lived price spikes can make visible Stop Loss and Take Profit levels predictable and vulnerable.
Stealth Trade Manager is a protection utility that manages existing positions rather than opening trades. It keeps SL/TP virtual: the broker sees positions without attached stops, while the local terminal tracks real thresholds and closes at market only when levels are breached.
Core functions include Virtual SL/TP and a Spread Protector. If a virtual stop is reached during abnormal spread expansion, such as news events or server rollover, the position is held until spreads normalize, reducing exits caused by artificial widening.
Key inputs: Virtual_SL_Points, Virtual_TP_Points, Max_Spread_To_Close, and Magic_Number for managing manual trades or se...
π Read | Calendar | @mql5dev
#MQL5 #MT5 #EA
Stealth Trade Manager is a protection utility that manages existing positions rather than opening trades. It keeps SL/TP virtual: the broker sees positions without attached stops, while the local terminal tracks real thresholds and closes at market only when levels are breached.
Core functions include Virtual SL/TP and a Spread Protector. If a virtual stop is reached during abnormal spread expansion, such as news events or server rollover, the position is held until spreads normalize, reducing exits caused by artificial widening.
Key inputs: Virtual_SL_Points, Virtual_TP_Points, Max_Spread_To_Close, and Magic_Number for managing manual trades or se...
π Read | Calendar | @mql5dev
#MQL5 #MT5 #EA
β€40
CRT Indicator (MTF): Explorer extends a single-timeframe CRT implementation into a multi-timeframe indicator for MQL5, aligning higher timeframe structure with lower timeframe execution on one chart.
The logic monitors a user-selected HTF, validates bullish and bearish CRT conditions with strict price-action rules, then projects the resulting CRH/CRL zones onto the active LTF. Zones are rendered with standard library Fibonacci objects via CChartObjectFibo, providing labeled, color-coded levels for quick context around macro-defined areas.
Updates are event-driven: CRT evaluation and redraw occur only on formation of a new HTF bar. This reduces redundant recalculation while keeping the overlay responsive. The design stays compact (under 130 lines) and focuses on deterministic synchronization between HTF data and LTF visualization.
π Read | Signals | @mql5dev
#MQL5 #MT5 #Indicator
The logic monitors a user-selected HTF, validates bullish and bearish CRT conditions with strict price-action rules, then projects the resulting CRH/CRL zones onto the active LTF. Zones are rendered with standard library Fibonacci objects via CChartObjectFibo, providing labeled, color-coded levels for quick context around macro-defined areas.
Updates are event-driven: CRT evaluation and redraw occur only on formation of a new HTF bar. This reduces redundant recalculation while keeping the overlay responsive. The design stays compact (under 130 lines) and focuses on deterministic synchronization between HTF data and LTF visualization.
π Read | Signals | @mql5dev
#MQL5 #MT5 #Indicator
β€36π4
An Expert Advisor targets swing highs and lows confirmed on the H4 timeframe, then watches the M15 chart for liquidity sweeps. A sweep is detected when price temporarily breaches a swing level and the closing price resolves beyond that level, triggering an automatic buy or sell entry.
Position sizing is derived from a fixed monetary risk, stop-loss distance in points, and tick value. This keeps per-trade risk consistent regardless of volatility or instrument specifics. Executed signals are annotated on-chart with arrows for audit and review.
Swing levels are stored in arrays and updated continuously. New H4 candles can confirm additional swing points, while M15 sweep events can invalidate existing levels. Helper routines handle candle data retrieval, array maintenance, and lot-size calculation. Example settings referenced include EUR/USD with range 21, SL 1...
π Read | Quotes | @mql5dev
#MQL5 #MT5 #EA
Position sizing is derived from a fixed monetary risk, stop-loss distance in points, and tick value. This keeps per-trade risk consistent regardless of volatility or instrument specifics. Executed signals are annotated on-chart with arrows for audit and review.
Swing levels are stored in arrays and updated continuously. New H4 candles can confirm additional swing points, while M15 sweep events can invalidate existing levels. Helper routines handle candle data retrieval, array maintenance, and lot-size calculation. Example settings referenced include EUR/USD with range 21, SL 1...
π Read | Quotes | @mql5dev
#MQL5 #MT5 #EA
β€45π5π3β2β‘1
An Expert Advisor implements a moving average crossover with close-based confirmation. Long entries trigger when the fast MA crosses above the slow MA and the bar closes above the fast MA. Short entries trigger when the fast MA crosses below the slow MA and the bar closes below the fast MA.
Execution is evaluated on new bars to limit noise-driven churn. An optional multi-timeframe MA filter can be enabled to align entries with a higher-timeframe trend and reduce false positives.
Risk controls include configurable take profit and stop loss (both optional), a maximum lot cap, and an equity threshold gate. Exit logic can optionally close positions when price crosses back over the fast MA for adaptive trade management. Trades are isolated via a MagicNumber.
Backtests referenced EURUSD on D1 with fast/slow periods of 100/200, showing comparatively stable result...
π Read | Calendar | @mql5dev
#MQL5 #MT5 #EA
Execution is evaluated on new bars to limit noise-driven churn. An optional multi-timeframe MA filter can be enabled to align entries with a higher-timeframe trend and reduce false positives.
Risk controls include configurable take profit and stop loss (both optional), a maximum lot cap, and an equity threshold gate. Exit logic can optionally close positions when price crosses back over the fast MA for adaptive trade management. Trades are isolated via a MagicNumber.
Backtests referenced EURUSD on D1 with fast/slow periods of 100/200, showing comparatively stable result...
π Read | Calendar | @mql5dev
#MQL5 #MT5 #EA
β€38π3
ZigZag-based SNR Detection calculates support and resistance from confirmed pivot highs and lows. Levels are derived from ZigZag extremes and plotted as horizontal references to outline recent market structure.
Configuration covers Lookback bars and the core ZigZag settings: Depth, Deviation, and Backstep. Optional rendering includes broken (closed) levels for historical context, open levels extending to the current bar, the ZigZag line, and per-level labels.
Labels mark level type (S/R) and the active chart timeframe. The tool runs across standard symbols and timeframes from intraday through daily, and is intended to highlight pivot clusters where multiple levels align into practical zones for further analysis.
π Read | Quotes | @mql5dev
#MQL5 #MT5 #Indicator
Configuration covers Lookback bars and the core ZigZag settings: Depth, Deviation, and Backstep. Optional rendering includes broken (closed) levels for historical context, open levels extending to the current bar, the ZigZag line, and per-level labels.
Labels mark level type (S/R) and the active chart timeframe. The tool runs across standard symbols and timeframes from intraday through daily, and is intended to highlight pivot clusters where multiple levels align into practical zones for further analysis.
π Read | Quotes | @mql5dev
#MQL5 #MT5 #Indicator
β€28π6π₯1
Manual Fibonacci retracements stay discretionary, but their monitoring can be automated without losing context. This EA detects manually drawn OBJ_FIBO objects, extracts each retracement level, converts them into fixed price references, and tracks them independently.
An event-driven workflow avoids noisy auto-detection: the trader draws, then explicitly syncs and converts levels for monitoring. Internally, each level is stored with state so interactions are interpreted over time, not as one-off checks.
On every tick, a state machine classifies approach, touch, breakout, and post-touch reversal using configurable tolerances, instrument-aware pip scaling, and level-mapping options. Alerts and a compact panel provide persistent awareness across charts, while lifecycle handling keeps monitored structures aligned with edits and deletions.
π Read | AppStore | @mql5dev
#MQL5 #MT5 #AlgoTrading
An event-driven workflow avoids noisy auto-detection: the trader draws, then explicitly syncs and converts levels for monitoring. Internally, each level is stored with state so interactions are interpreted over time, not as one-off checks.
On every tick, a state machine classifies approach, touch, breakout, and post-touch reversal using configurable tolerances, instrument-aware pip scaling, and level-mapping options. Alerts and a compact panel provide persistent awareness across charts, while lifecycle handling keeps monitored structures aligned with edits and deletions.
π Read | AppStore | @mql5dev
#MQL5 #MT5 #AlgoTrading
β€27π4π3π1
Liquidity zones and flips can be identified accurately in MQL5, yet many trades fail because risk is applied mechanically instead of modeling how price sweeps liquidity around those levels.
The article proposes an engineered, reproducible risk framework implemented as an MT5 Expert Advisor that manages the full trade lifecycle: pre-trade zone qualification (impulse/base quality, size constraints, higher-timeframe alignment), context-aware stop placement with buffers beyond expected sweep areas, and dynamic position sizing from a fixed account risk percent and actual stop distance.
Key implementation details include a LiquidityZone state model (triggered, flipped, expiry), ATR-based normalization to reject weak zones, pending limits for fresh zones, and confirmation-based market entries for flipped zones with reduced risk. Zones are monitored for expiry, ord...
π Read | NeuroBook | @mql5dev
#MQL5 #MT5 #EA
The article proposes an engineered, reproducible risk framework implemented as an MT5 Expert Advisor that manages the full trade lifecycle: pre-trade zone qualification (impulse/base quality, size constraints, higher-timeframe alignment), context-aware stop placement with buffers beyond expected sweep areas, and dynamic position sizing from a fixed account risk percent and actual stop distance.
Key implementation details include a LiquidityZone state model (triggered, flipped, expiry), ATR-based normalization to reject weak zones, pending limits for fresh zones, and confirmation-based market entries for flipped zones with reduced risk. Zones are monitored for expiry, ord...
π Read | NeuroBook | @mql5dev
#MQL5 #MT5 #EA
β€22π10β2π1
MQL5 Algo Trading
This media is not supported in the widget
VIEW IN TELEGRAM
β€90π30π17π17β‘6π€4π3
This part completes the ExcelβPythonβMetaTrader 5 bridge by moving the MT5 side into MQL5 as a Service, avoiding the βscript must stay on a chartβ limitation. Running as a service keeps the connector independent of charts while still able to open/close charts and control terminal state.
The system is deliberately split into three cooperating processes: a Python socket server, VBA in Excel, and an MQL5 client. The recommended workflow is incremental testing: validate Python first, then Excelβserver messaging, then attach MT5.
On the MQL5 side, the core is a persistent TCP client loop with explicit socket cleanup on failed connects, configurable host/port parameters, and a defensive receive buffer strategy to prevent losing data when reads arrive in bursts.
A simple text protocol is parsed character-by-character to extract a symbol and a command, return...
π Read | Quotes | @mql5dev
#MQL5 #MT5 #AlgoTrading
The system is deliberately split into three cooperating processes: a Python socket server, VBA in Excel, and an MQL5 client. The recommended workflow is incremental testing: validate Python first, then Excelβserver messaging, then attach MT5.
On the MQL5 side, the core is a persistent TCP client loop with explicit socket cleanup on failed connects, configurable host/port parameters, and a defensive receive buffer strategy to prevent losing data when reads arrive in bursts.
A simple text protocol is parsed character-by-character to extract a symbol and a command, return...
π Read | Quotes | @mql5dev
#MQL5 #MT5 #AlgoTrading
β€32π7π2
Nested structs in MQL5 were extended from a fixed double payload to a more reusable mapping pattern, similar to key-to-value translation used in database indexing.
A practical issue surfaced: compiler warnings that can mask real defects later. The immediate fix is explicit conversion, which keeps builds clean without changing behavior.
The main refactor is separation of concerns. Set/Get were moved out of the payload struct and placed into the registry layer, enabling st_Data to store st_Reg elements without hard coupling.
Because MQL5 cannot return pointers or null, the Set logic reserves a sentinel slot to represent βnot foundβ. st_Data then becomes a template over type T, with a remaining dependency through Get_K, which can later be overloaded for flexible key extraction.
π Read | AppStore | @mql5dev
#MQL5 #MT5 #AlgoTrading
A practical issue surfaced: compiler warnings that can mask real defects later. The immediate fix is explicit conversion, which keeps builds clean without changing behavior.
The main refactor is separation of concerns. Set/Get were moved out of the payload struct and placed into the registry layer, enabling st_Data to store st_Reg elements without hard coupling.
Because MQL5 cannot return pointers or null, the Set logic reserves a sentinel slot to represent βnot foundβ. st_Data then becomes a template over type T, with a remaining dependency through Get_K, which can later be overloaded for flexible key extraction.
π Read | AppStore | @mql5dev
#MQL5 #MT5 #AlgoTrading
β€19π1
Trend detection gets a practical upgrade by reworking the Abbe criterion for market data. The core idea is comparing dispersion of prices with dispersion of bar-to-bar changes: trends inflate overall spread while short-step movement stays relatively stable.
To reduce spike sensitivity on short windows, variance is replaced with robust estimates: median, MAD, and absolute differences. Trend βstrengthβ is then ranked using historical distributions (CDF), turning raw deviations into comparable probabilities.
Direction is handled separately with a Kendall-based measure, then combined with the robust Abbe signals for entry/exit rules. Further variants address edge anomalies, add a linearity ratio (net move vs total path), and explore hybrid non-parametric criteria using sorting and SMA-order comparisons to capture both direction and magnitude.
π Read | Calendar | @mql5dev
#MQL5 #MT5 #Strategy
To reduce spike sensitivity on short windows, variance is replaced with robust estimates: median, MAD, and absolute differences. Trend βstrengthβ is then ranked using historical distributions (CDF), turning raw deviations into comparable probabilities.
Direction is handled separately with a Kendall-based measure, then combined with the robust Abbe signals for entry/exit rules. Further variants address edge anomalies, add a linearity ratio (net move vs total path), and explore hybrid non-parametric criteria using sorting and SMA-order comparisons to capture both direction and magnitude.
π Read | Calendar | @mql5dev
#MQL5 #MT5 #Strategy
β€34π5π4β‘3π3
TradeCloserLib is an MQL5 library aimed at automated trading systems that need consistent position shutdown logic. It provides routines to close open positions by symbol, across all symbols, or filtered by magic number.
ClosePositions(symbol) closes all open positions for a given symbol, defaulting to the current chart symbol when no parameter is supplied.
CloseAllPositions() closes positions across every symbol with open trades. It first builds a unique symbol list to prevent duplicate processing during iteration.
CloseByMagic(magic) closes positions matching a specified magic number, supporting segregated operation in multi-EA deployments.
π Read | Calendar | @mql5dev
#MQL5 #MT5 #EA
ClosePositions(symbol) closes all open positions for a given symbol, defaulting to the current chart symbol when no parameter is supplied.
CloseAllPositions() closes positions across every symbol with open trades. It first builds a unique symbol list to prevent duplicate processing during iteration.
CloseByMagic(magic) closes positions matching a specified magic number, supporting segregated operation in multi-EA deployments.
π Read | Calendar | @mql5dev
#MQL5 #MT5 #EA
β€25
Quantitative FX portfolios often fail on systemic correlation rather than individual trade logic. Trading multiple USD-cross pairs can concentrate risk on USD even when each setup appears independent. A single USD event can trigger clustered stop-outs across the book.
The Institutional Currency Exposure Monitor is an on-chart dashboard that aggregates every open position, decomposes each pair into base and quote legs, and computes true net exposure per currency in lots. Example: Long 1.0 EURUSD and Short 0.5 USDJPY yields separate net direction for EUR, USD, and JPY.
The display flags concentration risk by showing net long as positive and net short as negative. A configurable warning state highlights currencies exceeding a lot-based threshold.
Compatible with manual and automated positions, and supports both netting and hedging account modes. Dashbo...
π Read | Quotes | @mql5dev
#MQL5 #MT5 #Strategy
The Institutional Currency Exposure Monitor is an on-chart dashboard that aggregates every open position, decomposes each pair into base and quote legs, and computes true net exposure per currency in lots. Example: Long 1.0 EURUSD and Short 0.5 USDJPY yields separate net direction for EUR, USD, and JPY.
The display flags concentration risk by showing net long as positive and net short as negative. A configurable warning state highlights currencies exceeding a lot-based threshold.
Compatible with manual and automated positions, and supports both netting and hedging account modes. Dashbo...
π Read | Quotes | @mql5dev
#MQL5 #MT5 #Strategy
β€28π4π€―2π1
Jardineβs Gate adds a six-stage validation pipeline between LSTM predictions and execution in a multi-account MT5 crypto CFD engine. Instead of trading 43,200 minute-by-minute signals, it answers the harder question: whether conditions justify trading at all.
Signals are filtered across independent dimensions: price-action structure via zlib compression (entropy), consensus across 50 LSTM βexpertsβ (interference), softmax conviction (confidence), regime-adjusted edge with calibrated multipliers (probability), EMA(200) trend alignment with a high-confidence reversal override, and a loss-streak kill switch with cooldown.
Implemented as a persistent MQL5 class (QuantumEdgeFilter) with sequential, cost-aware ordering and per-gate statistics, it reduced a month to 127 trades (0.29%) with minimal drawdown in testingβuseful for prop constraints where sel...
π Read | Docs | @mql5dev
#MQL5 #MT5 #AlgoTrading
Signals are filtered across independent dimensions: price-action structure via zlib compression (entropy), consensus across 50 LSTM βexpertsβ (interference), softmax conviction (confidence), regime-adjusted edge with calibrated multipliers (probability), EMA(200) trend alignment with a high-confidence reversal override, and a loss-streak kill switch with cooldown.
Implemented as a persistent MQL5 class (QuantumEdgeFilter) with sequential, cost-aware ordering and per-gate statistics, it reduced a month to 127 trades (0.29%) with minimal drawdown in testingβuseful for prop constraints where sel...
π Read | Docs | @mql5dev
#MQL5 #MT5 #AlgoTrading
β€26
A frequency analysis add-on for MQL5 is being built to operate on live close data instead of synthetic samples. It bins closes into a histogram, then computes Shannon entropy and a chi-square goodness-of-fit statistic to quantify clustering versus uniformity.
The implementation defines enums for log types and compute modes (per-bar, per-tick), plus inputs for bin count, lookback window, and feature toggles. Data structures store per-bin ranges/counts/frequencies and timestamped log entries, backed by a capped FIFO queue with optional auto-scroll.
Core routines load closes, compute min/max, assign bins, calculate relative frequencies and the mode. Additional functions calculate mean, standard deviation, skewness, entropy, chi-square, and lag-1 autocorrelation, then render a histogram and a supersampled scrollable log panel with color-coded entries.
π Read | Quotes | @mql5dev
#MQL5 #MT5 #EA
The implementation defines enums for log types and compute modes (per-bar, per-tick), plus inputs for bin count, lookback window, and feature toggles. Data structures store per-bin ranges/counts/frequencies and timestamped log entries, backed by a capped FIFO queue with optional auto-scroll.
Core routines load closes, compute min/max, assign bins, calculate relative frequencies and the mode. Additional functions calculate mean, standard deviation, skewness, entropy, chi-square, and lag-1 autocorrelation, then render a histogram and a supersampled scrollable log panel with color-coded entries.
π Read | Quotes | @mql5dev
#MQL5 #MT5 #EA
β€18β1
This article fixes a critical edge case in MT5 news filters: SL/TP suspension state stored only in memory is lost after a restart or recompile, leaving positions without protection and no reliable way to know what must be restored.
The solution adds a persistent state layer using terminal Global Variables. It stores a suspension flag, a count of affected positions, and per-position snapshots (ticket, original SL, original TP) using a predictable naming scheme. Tickets are safely stored as doubles.
Three functions define the recovery contract: save immediately after removing stops, load during OnInit to rebuild internal arrays without restoring prematurely, and clear after restoration to prevent stale recovery. This keeps behavior deterministic across restarts and supports multi-instance setups via unique prefixes or magic numbers.
π Read | NeuroBook | @mql5dev
#MQL5 #MT5 #AlgoTrading
The solution adds a persistent state layer using terminal Global Variables. It stores a suspension flag, a count of affected positions, and per-position snapshots (ticket, original SL, original TP) using a predictable naming scheme. Tickets are safely stored as doubles.
Three functions define the recovery contract: save immediately after removing stops, load during OnInit to rebuild internal arrays without restoring prematurely, and clear after restoration to prevent stale recovery. This keeps behavior deterministic across restarts and supports multi-instance setups via unique prefixes or magic numbers.
π Read | NeuroBook | @mql5dev
#MQL5 #MT5 #AlgoTrading
β€27π2π2π1