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
β€24
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
Pair trading remains a practical market-neutral technique when implemented with basic statistics and strict controls. The core requirement is a stationary spread or ratio between correlated instruments, with signals derived from Z-score deviations from the mean.
An EA-style architecture typically includes data normalization, ratio/Z-score and rolling correlation, entry/exit logic, and risk controls. Parameter drift is handled via periodic re-optimization of the Z-score window and thresholds, with out-of-sample checks and coarse step sizes to reduce overfitting.
Risk handling extends beyond lot sizing. Correlation-aware position adjustments, protective stops/targets, and consecutive-loss limits help address regime shifts where correlation breaks.
Backtests cited for correlated FX pairs report mid-teens returns with sub-0.5% drawdowns and multi-hour...
π Read | Forum | @mql5dev
#MQL5 #MT5 #AlgoTrading
An EA-style architecture typically includes data normalization, ratio/Z-score and rolling correlation, entry/exit logic, and risk controls. Parameter drift is handled via periodic re-optimization of the Z-score window and thresholds, with out-of-sample checks and coarse step sizes to reduce overfitting.
Risk handling extends beyond lot sizing. Correlation-aware position adjustments, protective stops/targets, and consecutive-loss limits help address regime shifts where correlation breaks.
Backtests cited for correlated FX pairs report mid-teens returns with sub-0.5% drawdowns and multi-hour...
π Read | Forum | @mql5dev
#MQL5 #MT5 #AlgoTrading
β€36π12π2π€‘1
Market microstructure continues to show liquidity as a key driver of short-term price behavior. Obvious swing highs and lows often accumulate clustered stop orders, creating liquidity pools that get cleared before directional continuation.
SMC Liquidity Sweep Detector is built to flag these events in real time by focusing on rejection, not simple level breaks. A sweep is signaled when price breaches a prior structural high or low but fails to hold, then closes back inside the range, indicating a fakeout rather than acceptance.
Core logic includes precision labeling of raids above Swing Highs and below Swing Lows, a wick-based rejection filter to reduce noise, and non-repainting signals based on closed candles for consistent review. Alert routing is modular, providing terminal notifications when a sweep is confirmed.
Key inputs cover SwingLookback, M...
π Read | Freelance | @mql5dev
#MQL5 #MT5 #Indicator
SMC Liquidity Sweep Detector is built to flag these events in real time by focusing on rejection, not simple level breaks. A sweep is signaled when price breaches a prior structural high or low but fails to hold, then closes back inside the range, indicating a fakeout rather than acceptance.
Core logic includes precision labeling of raids above Swing Highs and below Swing Lows, a wick-based rejection filter to reduce noise, and non-repainting signals based on closed candles for consistent review. Alert routing is modular, providing terminal notifications when a sweep is confirmed.
Key inputs cover SwingLookback, M...
π Read | Freelance | @mql5dev
#MQL5 #MT5 #Indicator
β€31π6π2π1
Batch Normalization is added to an MT5 OpenCL neural-network library to reduce internal covariate shift, stabilizing layer-to-layer data distributions and enabling higher learning rates without slowing training.
The article implements a CNeuronBatchNormOCL layer that keeps per-neuron statistics plus trainable scale/shift (gamma, beta). To cut memory and compute overhead, moving mean/variance are approximated with exponential averages, avoiding full-batch storage.
Feed-forward runs an OpenCL kernel per neuron: compute EMA mean/variance, normalize, apply gamma/beta, then optionally apply activation (with guidance on placing normalization before or after activations). Backprop updates gamma/beta and propagates gradients through normalization and activation, with special handling to bypass work when batch size is 1.
π Read | Docs | @mql5dev
#MQL5 #MT5 #AI
The article implements a CNeuronBatchNormOCL layer that keeps per-neuron statistics plus trainable scale/shift (gamma, beta). To cut memory and compute overhead, moving mean/variance are approximated with exponential averages, avoiding full-batch storage.
Feed-forward runs an OpenCL kernel per neuron: compute EMA mean/variance, normalize, apply gamma/beta, then optionally apply activation (with guidance on placing normalization before or after activations). Backprop updates gamma/beta and propagates gradients through normalization and activation, with special handling to bypass work when batch size is 1.
π Read | Docs | @mql5dev
#MQL5 #MT5 #AI
β€56π10π4π3
MetaTrader 4 remains a stable execution terminal, but built-in risk controls are limited. For funded account workflows, manual lot sizing and daily drawdown tracking can introduce avoidable execution mistakes and compliance violations.
Prop Firm Risk Monitor is a lightweight MQL4 chart-based dashboard focused on two areas: daily loss control and position sizing. It reads open positions plus todayβs closed trades, including commissions and swaps, to compute precise Daily PnL and align it with common daily loss rules such as 5%.
The utility also calculates lot size from a configured risk percentage and stop-loss distance in pips, using the symbol tick value and handling 4-digit and 5-digit pricing. It is indicator-only, does not place orders, and relies on native terminal logic.
Key inputs: InpRiskPercent, InpStopLossPips, InpMaxDailyDD with an on-chart war...
π Read | VPS | @mql5dev
#MQL4 #MT4 #EA
Prop Firm Risk Monitor is a lightweight MQL4 chart-based dashboard focused on two areas: daily loss control and position sizing. It reads open positions plus todayβs closed trades, including commissions and swaps, to compute precise Daily PnL and align it with common daily loss rules such as 5%.
The utility also calculates lot size from a configured risk percentage and stop-loss distance in pips, using the symbol tick value and handling 4-digit and 5-digit pricing. It is indicator-only, does not place orders, and relies on native terminal logic.
Key inputs: InpRiskPercent, InpStopLossPips, InpMaxDailyDD with an on-chart war...
π Read | VPS | @mql5dev
#MQL4 #MT4 #EA
β€32π2π2β‘1
Institutional trading workflows often treat the True Daily, Weekly, and Monthly Open as primary reference levels. These opens are commonly used to frame the PO3 cycle: accumulation near the open, a liquidity run above or below the open, then directional expansion away from it.
The ICT True Open & PO3 Lines indicator calculates and plots the current period opens without lag, keeping execution charts aligned on M1, M5, and M15.
Key behavior includes clear separation of premium (above open) and discount (below open) zones, plus simultaneous Daily (midnight), Weekly, and Monthly anchors on lower timeframes. The implementation focuses on static horizontal levels for the active period, avoiding heavy historical loops and keeping platform overhead minimal.
Configuration offers independent toggles for each open level, along with customizable colors and line...
π Read | Freelance | @mql5dev
#MQL5 #MT5 #Indicator
The ICT True Open & PO3 Lines indicator calculates and plots the current period opens without lag, keeping execution charts aligned on M1, M5, and M15.
Key behavior includes clear separation of premium (above open) and discount (below open) zones, plus simultaneous Daily (midnight), Weekly, and Monthly anchors on lower timeframes. The implementation focuses on static horizontal levels for the active period, avoiding heavy historical loops and keeping platform overhead minimal.
Configuration offers independent toggles for each open level, along with customizable colors and line...
π Read | Freelance | @mql5dev
#MQL5 #MT5 #Indicator
β€35π1
This article shifts from socket-based MT5/Excel exchange to building the SQL foundation needed for reliable data workflows in algorithmic trading.
It compares practical ways to run SQL: command line, MySQL Workbench, MetaEditor, embedded MQL5, or sending SQL via sockets to a server. The key constraint is portability: stick to standard SQL to avoid vendor-specific features that break across engines.
Core setup focuses on CREATE DATABASE and USE, plus Workbench execution mechanics (run selection vs current statement). For repeatable scripts, it recommends conditional creation (IF/EXISTS patterns) instead of failing on reruns.
Table design is treated as the real challenge: data types and schema planning matter more than column order. A quotes example shows why a βprice-onlyβ table cannot store history, then uses ALTER TABLE to add a date field, emphasizing c...
π Read | Docs | @mql5dev
#MQL5 #MT5 #SQL
It compares practical ways to run SQL: command line, MySQL Workbench, MetaEditor, embedded MQL5, or sending SQL via sockets to a server. The key constraint is portability: stick to standard SQL to avoid vendor-specific features that break across engines.
Core setup focuses on CREATE DATABASE and USE, plus Workbench execution mechanics (run selection vs current statement). For repeatable scripts, it recommends conditional creation (IF/EXISTS patterns) instead of failing on reruns.
Table design is treated as the real challenge: data types and schema planning matter more than column order. A quotes example shows why a βprice-onlyβ table cannot store history, then uses ALTER TABLE to add a date field, emphasizing c...
π Read | Docs | @mql5dev
#MQL5 #MT5 #SQL
β€22π3π1
Inheritance in MQL5 is not limited to classes. Structs can share a base struct to remove duplicated fields and functions, such as a common k_value and Get_K logic across st_Reg and st_Bio.
Refactoring to a st_Base struct and inheriting publicly centralizes behavior. Updates to shared members then propagate to all derived structs, reducing maintenance risk and inconsistent behavior.
The next step combines structs, templates, and inheritance. A templated base forces derived structs to also become templates, enabling type-specific instantiations generated by the compiler and allowing a reusable list-like container with overloads.
π Read | Forum | @mql5dev
#MQL5 #MT5 #AlgoTrading
Refactoring to a st_Base struct and inheriting publicly centralizes behavior. Updates to shared members then propagate to all derived structs, reducing maintenance risk and inconsistent behavior.
The next step combines structs, templates, and inheritance. A templated base forces derived structs to also become templates, enabling type-specific instantiations generated by the compiler and allowing a reusable list-like container with overloads.
π Read | Forum | @mql5dev
#MQL5 #MT5 #AlgoTrading
β€42π6π€―3β‘2
ICT-style time segmentation keeps algorithmic price delivery tied to specific operating windows. Liquidity often accumulates during Asia, gets engineered around the London open, and sees distribution during the New York kill window. Time alignment is treated as a primary variable alongside price.
MT4 provides limited native support for consistent session visualization, so ranges and windows are often marked manually, with additional effort spent converting broker server time to market time.
An ICT Killzones indicator automates the session map. It draws the Asian range from the session high/low to frame liquidity pools, shades the London and New York high-volatility windows, and includes a broker GMT shift input so windows line up with institutional timing across GMT+2, GMT+3, EST, and other feeds.
Execution is kept lightweight by limiting calculations to...
π Read | Forum | @mql5dev
#MQL4 #MT4 #Indicator
MT4 provides limited native support for consistent session visualization, so ranges and windows are often marked manually, with additional effort spent converting broker server time to market time.
An ICT Killzones indicator automates the session map. It draws the Asian range from the session high/low to frame liquidity pools, shades the London and New York high-volatility windows, and includes a broker GMT shift input so windows line up with institutional timing across GMT+2, GMT+3, EST, and other feeds.
Execution is kept lightweight by limiting calculations to...
π Read | Forum | @mql5dev
#MQL4 #MT4 #Indicator
β€20π3π1
Moving averages remain common at the retail level, while many execution systems benchmark fills against VWAP. Large order execution is typically evaluated versus the volume-weighted average price, with accumulation more likely below VWAP and distribution more likely above it.
An anchored VWAP implementation for MT4 is positioned to address the lack of a native session-based VWAP. The calculation anchors to the start of a selected session (Daily, Weekly, Monthly) and maintains a cumulative VWAP without repainting on subsequent bars.
The VWAP line is derived from Typical Price (H+L+C)/3 weighted by tick volume to approximate session βfair valueβ. Standard deviation bands are added above and below VWAP to highlight statistically stretched conditions; touches near the second deviation are commonly treated as overextension in quantitative workflows.
Configur...
π Read | Docs | @mql5dev
#MQL4 #MT4 #VWAP
An anchored VWAP implementation for MT4 is positioned to address the lack of a native session-based VWAP. The calculation anchors to the start of a selected session (Daily, Weekly, Monthly) and maintains a cumulative VWAP without repainting on subsequent bars.
The VWAP line is derived from Typical Price (H+L+C)/3 weighted by tick volume to approximate session βfair valueβ. Standard deviation bands are added above and below VWAP to highlight statistically stretched conditions; touches near the second deviation are commonly treated as overextension in quantitative workflows.
Configur...
π Read | Docs | @mql5dev
#MQL4 #MT4 #VWAP
β€21π2π1
Institutional execution logic often clusters around round-number levels where liquidity is consistently available. These zones commonly become reference points for block placement, order matching, and risk management, especially during macro-driven sessions.
The Institutional Psychological Levels indicator renders these levels directly on MT4, replacing the default grid with structured round-number mapping. It emphasizes major 1000 and 500-point levels (BRN) and keeps the layout adaptive to the symbolβs price scale across FX, metals, and indices.
Implementation details focus on terminal stability: optimized MQL4, zero-lag rendering, and calculations limited to the visible chart range to reduce overhead during volatility spikes.
Operational use cases include profit targets and protective stop placement around 000/500 areas. Low-volume approaches o...
π Read | AppStore | @mql5dev
#MQL4 #MT4 #Indicator
The Institutional Psychological Levels indicator renders these levels directly on MT4, replacing the default grid with structured round-number mapping. It emphasizes major 1000 and 500-point levels (BRN) and keeps the layout adaptive to the symbolβs price scale across FX, metals, and indices.
Implementation details focus on terminal stability: optimized MQL4, zero-lag rendering, and calculations limited to the visible chart range to reduce overhead during volatility spikes.
Operational use cases include profit targets and protective stop placement around 000/500 areas. Low-volume approaches o...
π Read | AppStore | @mql5dev
#MQL4 #MT4 #Indicator
β€23π1
MetaTrader 4βs built-in trailing stop uses a fixed pip distance. In changing volatility regimes, fixed offsets create inconsistent risk: stops can be oversized in quiet markets and overly tight during fast moves, increasing early stop-outs.
A volatility-based alternative is to trail using Average True Range (ATR). The stop distance is recalculated from current ATR and applied as ATR Γ multiplier, adjusting to current conditions while tightening as price advances.
Operational features typically include auto-breakeven logic, moving Stop Loss to entry plus a small buffer once a defined profit threshold is reached. Trade coverage can be configured to manage manual orders on the symbol or positions opened by other EAs via Magic Number filtering.
Common inputs: ATR period (often 14), multiplier (commonly 2.0β3.0), breakeven enablement and activation pips, and Magic N...
π Read | Signals | @mql5dev
#MQL4 #MT4 #EA
A volatility-based alternative is to trail using Average True Range (ATR). The stop distance is recalculated from current ATR and applied as ATR Γ multiplier, adjusting to current conditions while tightening as price advances.
Operational features typically include auto-breakeven logic, moving Stop Loss to entry plus a small buffer once a defined profit threshold is reached. Trade coverage can be configured to manage manual orders on the symbol or positions opened by other EAs via Magic Number filtering.
Common inputs: ATR period (often 14), multiplier (commonly 2.0β3.0), breakeven enablement and activation pips, and Magic N...
π Read | Signals | @mql5dev
#MQL4 #MT4 #EA
β€18π2π1
Intermarket analysis remains a core workflow in quantitative and institutional trading, where cross-asset correlation helps infer liquidity conditions. The US Dollar Index (DXY) is often monitored as a proxy for broad USD strength and its impact across FX and metals.
An Institutional DXY Overlay consolidates this view by plotting the Dollar Index directly on the active chart, reducing reliance on multi-window layouts and enabling faster correlation checks during execution.
Key capabilities include multi-symbol synchronization via iClose-based data requests, with alignment to the current chart timeframe. Dynamic scaling adjusts the plotted index to the visible price range for clearer comparison across instruments with different magnitudes.
SMT divergence spotting focuses on correlation breaks, such as DXY printing a higher high while a related pair fail...
π Read | AppStore | @mql5dev
#MQL5 #MT5 #AlgoTrading
An Institutional DXY Overlay consolidates this view by plotting the Dollar Index directly on the active chart, reducing reliance on multi-window layouts and enabling faster correlation checks during execution.
Key capabilities include multi-symbol synchronization via iClose-based data requests, with alignment to the current chart timeframe. Dynamic scaling adjusts the plotted index to the visible price range for clearer comparison across instruments with different magnitudes.
SMT divergence spotting focuses on correlation breaks, such as DXY printing a higher high while a related pair fail...
π Read | AppStore | @mql5dev
#MQL5 #MT5 #AlgoTrading
β€21π2
MetaTrader 5 uses SQLite, so standard SQL fits naturally inside MQL5 executables. One exception is execution from MetaEditor: it blocks DROP DATABASE for safety, even though DROP TABLE works. The takeaway is to treat destructive statements as production-grade risks.
The article then builds a clean workflow for quote storage: always modify data via SQL, not manual file edits. INSERT INTO is order-sensitive between column lists and VALUES, and careless table design permits unlimited duplicates.
To enforce consistency, define a PRIMARY KEY (e.g., trading day for daily bars). INSERT always creates rows; to change existing rows, use UPDATE ... SET ... WHERE keyed by the primary key. This pattern enables reliable incremental writes for trading data pipelines.
π Read | Calendar | @mql5dev
#MQL5 #MT5 #SQL
The article then builds a clean workflow for quote storage: always modify data via SQL, not manual file edits. INSERT INTO is order-sensitive between column lists and VALUES, and careless table design permits unlimited duplicates.
To enforce consistency, define a PRIMARY KEY (e.g., trading day for daily bars). INSERT always creates rows; to change existing rows, use UPDATE ... SET ... WHERE keyed by the primary key. This pattern enables reliable incremental writes for trading data pipelines.
π Read | Calendar | @mql5dev
#MQL5 #MT5 #SQL
β€28
Naive sizing breaks in ML trading because it ignores confidence, overlaps trades into accidental leverage, and forces constant rebalancing that turns edge into fees. It also misses payoff asymmetry, where the same win rate can justify different risk.
The AFML Chapter 10 toolkit in afml.bet_sizing implements four complementary sizers. bet_size_probability turns classifier probabilities into bounded signals via a z-score-to-normal-CDF mapping, then fixes triple-barrier overlap by averaging concurrently active bets and discretizing changes to reduce churn.
For non-probabilistic models, bet_size_dynamic sizes from forecast-vs-market divergence using calibrated sigmoid/power curves and can output limit prices for execution. bet_size_budget and bet_size_reserve handle directional-only signals, with the reserve method learning a sizing curve from empirica...
π Read | CodeBase | @mql5dev
#MQL5 #MT5 #AlgoTrading
The AFML Chapter 10 toolkit in afml.bet_sizing implements four complementary sizers. bet_size_probability turns classifier probabilities into bounded signals via a z-score-to-normal-CDF mapping, then fixes triple-barrier overlap by averaging concurrently active bets and discretizing changes to reduce churn.
For non-probabilistic models, bet_size_dynamic sizes from forecast-vs-market divergence using calibrated sigmoid/power curves and can output limit prices for execution. bet_size_budget and bet_size_reserve handle directional-only signals, with the reserve method learning a sizing curve from empirica...
π Read | CodeBase | @mql5dev
#MQL5 #MT5 #AlgoTrading
π9β€8π₯2
Market structure logic that relies on higher highs and lower lows treats every extreme as equal, which increases false signals during consolidation, minor retracements, and liquidity grabs.
A five-layer EA design addresses this with raw swing candidates plus a Structural Validation Engine. Swings become valid only with Break of Structure, displacement, liquidity sweep behavior, or time-based respect.
A Liquidity Interaction Layer tracks equal highs/lows and untouched validated swings, marking whether liquidity is taken. A state machine classifies phases as accumulation, expansion, distribution, or reversal based on validated swings and liquidity behavior.
Execution requires confluence: validated structure, liquidity interaction, and state alignment. Stops anchor to validated structure; targets use fixed risk:reward or next liquidity/structure level.
π Read | Docs | @mql5dev
#MQL5 #MT5 #AlgoTrading
A five-layer EA design addresses this with raw swing candidates plus a Structural Validation Engine. Swings become valid only with Break of Structure, displacement, liquidity sweep behavior, or time-based respect.
A Liquidity Interaction Layer tracks equal highs/lows and untouched validated swings, marking whether liquidity is taken. A state machine classifies phases as accumulation, expansion, distribution, or reversal based on validated swings and liquidity behavior.
Execution requires confluence: validated structure, liquidity interaction, and state alignment. Stops anchor to validated structure; targets use fixed risk:reward or next liquidity/structure level.
π Read | Docs | @mql5dev
#MQL5 #MT5 #AlgoTrading
β€25π8π2β‘1
This part shows a practical path from raw MT5 tick exports to queryable data: request ticks in MetaTrader 5, save to CSV, then import the file into a clean .db using MetaEditorβs table import. Key details are choosing the correct delimiter (MT5 uses tabs by default) and naming the new table so the CSV header becomes the table schema.
With the data structured as a real table, SQL becomes usable for analysis and simulation. The article introduces SELECT as the core inspection tool, then moves to filtering with a WHERE clause, using column criteria (e.g., FLAGS = 88) to reduce large result sets.
MetaEditorβs result paging (blocks of 1,000 rows) is highlighted as a simple way to navigate big tick datasets during exploration.
π Read | VPS | @mql5dev
#MQL5 #MT5 #SQL
With the data structured as a real table, SQL becomes usable for analysis and simulation. The article introduces SELECT as the core inspection tool, then moves to filtering with a WHERE clause, using column criteria (e.g., FLAGS = 88) to reduce large result sets.
MetaEditorβs result paging (blocks of 1,000 rows) is highlighted as a simple way to navigate big tick datasets during exploration.
π Read | VPS | @mql5dev
#MQL5 #MT5 #SQL
β€24