Equity Target Closer is a utility EA designed to enforce an account-level profit target or loss limit by closing positions. It does not open trades and does not perform market analysis. Trading can remain manual or handled by other EAs, with this tool managing exits. Deployment requires attaching it to a single chart.
It evaluates watched positions on every tick and once per second. When floating P/L or todayβs P/L reaches the configured threshold, it closes all selected positions at market and can optionally delete pending orders. An optional lock can keep the day closed by immediately closing any new trades until the next trading day.
Configuration supports measuring open floating P/L or todayβs P/L (todayβs closed trades plus open positions), with deposits and withdrawals excluded. Targets can be set in account currency or as a percentage of balance, fil...
π Read | Calendar | @mql5dev
It evaluates watched positions on every tick and once per second. When floating P/L or todayβs P/L reaches the configured threshold, it closes all selected positions at market and can optionally delete pending orders. An optional lock can keep the day closed by immediately closing any new trades until the next trading day.
Configuration supports measuring open floating P/L or todayβs P/L (todayβs closed trades plus open positions), with deposits and withdrawals excluded. Targets can be set in account currency or as a percentage of balance, fil...
π Read | Calendar | @mql5dev
β€11π9π€©9π₯6π4β‘1
Execution Quality Logger tracks real execution quality per deal without affecting trading. It logs manual orders, EA activity, and SL/TP executions, then writes one CSV row per deal and shows a running on-chart summary.
Captured fields include requested price (send-time for market orders, level for SL/TP), filled price, slippage in points (positive or negative), fill delay in milliseconds, and spread at execution. Records also include symbol, side, volume, entry/exit, magic number, and execution reason (manual, expert, SL, TP, stop out). Rejected or requoted requests are reported in the Experts log with return codes.
Configuration supports Common\Files logging, symbol and magic filters, and summary metrics such as average/worst slippage, negative slippage rate, and average/max delay. Intended use is continuous logging on demo/live to compare brokers, sessio...
π Read | Calendar | @mql5dev
Captured fields include requested price (send-time for market orders, level for SL/TP), filled price, slippage in points (positive or negative), fill delay in milliseconds, and spread at execution. Records also include symbol, side, volume, entry/exit, magic number, and execution reason (manual, expert, SL, TP, stop out). Rejected or requoted requests are reported in the Experts log with return codes.
Configuration supports Common\Files logging, symbol and magic filters, and summary metrics such as average/worst slippage, negative slippage rate, and average/max delay. Intended use is continuous logging on demo/live to compare brokers, sessio...
π Read | Calendar | @mql5dev
π18β€11π€©9π₯2
Common Folder Copier synchronizes open positions between multiple MT5 terminals running on the same PC or VPS using a shared Common\Files file. Operation is handled by a single EA configured as Master or Slave. The Master writes position snapshots several times per second; each Slave reads the snapshot and mirrors positions on its own account. No DLLs, external services, or additional software are required.
Master mode records symbol, direction, volume, SL/TP, and optionally filters by a single magic number. Writes are performed via a temporary filename followed by replace, preventing partial reads.
Slave mode opens missing copies, adjusts volume on partial closes, keeps SL/TP aligned, and closes copies when the master closes. Master-to-slave mapping is stored via terminal global variables, surviving restarts. If the snapshot exceeds a configured age, the Sl...
π Read | AppStore | @mql5dev
Master mode records symbol, direction, volume, SL/TP, and optionally filters by a single magic number. Writes are performed via a temporary filename followed by replace, preventing partial reads.
Slave mode opens missing copies, adjusts volume on partial closes, keeps SL/TP aligned, and closes copies when the master closes. Master-to-slave mapping is stored via terminal global variables, surviving restarts. If the snapshot exceeds a configured age, the Sl...
π Read | AppStore | @mql5dev
π10β€9π₯8π€©7
Correlation Matrix Dashboard adds a live cross-symbol correlation grid directly on the chart to validate whether a basket is actually diversified. It calculates rolling Pearson correlations from closed-bar returns over a fixed lookback, updating once per new bar to avoid tick-by-tick CPU load on multi-chart setups.
The matrix lists basket symbols on rows and columns. Off-diagonal cells show coefficients from -1.00 to 1.00, with β--β on the diagonal. Shading ranges from neutral near zero to green for positive correlation and red for inverse correlation. Symmetry across the diagonal is expected and acts as a quick consistency check.
Optional alerts trigger when |correlation| crosses a threshold, then re-arm only after dropping back by a hysteresis margin to prevent repeated firing.
Key inputs cover symbol list, calculation timeframe, lookback bars, r...
π Read | AlgoBook | @mql5dev
The matrix lists basket symbols on rows and columns. Off-diagonal cells show coefficients from -1.00 to 1.00, with β--β on the diagonal. Shading ranges from neutral near zero to green for positive correlation and red for inverse correlation. Symmetry across the diagonal is expected and acts as a quick consistency check.
Optional alerts trigger when |correlation| crosses a threshold, then re-arm only after dropping back by a hysteresis margin to prevent repeated firing.
Key inputs cover symbol list, calculation timeframe, lookback bars, r...
π Read | AlgoBook | @mql5dev
β€15π10π₯8π€©6π2
A read-only terminal indicator adds an equity drawdown panel focused on current account state rather than balance. It tracks distance from the equity peak, the deepest drawdown recorded, closed P/L for today, week, and month, and attributes open floating results to the active Expert Advisor via magic numbers.
Rendering is done on a single canvas using the standard Canvas library, with antialiased shapes, smooth transitions, and 1 Hz equity sampling for the last 2.5 minutes. The header supports drag-to-move and a collapse button that reduces the view to drawdown and floating P/L.
Peak equity starts at attach time and updates on new highs. State persists via terminal global variables per account and server. Bonus credit is excluded. Deposits and withdrawals are detected from deal history and rescale the peak to keep drawdown percentage consistent acros...
π Read | VPS | @mql5dev
Rendering is done on a single canvas using the standard Canvas library, with antialiased shapes, smooth transitions, and 1 Hz equity sampling for the last 2.5 minutes. The header supports drag-to-move and a collapse button that reduces the view to drawdown and floating P/L.
Peak equity starts at attach time and updates on new highs. State persists via terminal global variables per account and server. Bonus credit is excluded. Deposits and withdrawals are detected from deal history and rescale the peak to keep drawdown percentage consistent acros...
π Read | VPS | @mql5dev
β€10π₯10π8π€©6
Trade Pad consolidates manual order entry into a single on-chart panel: BUY, SELL, lot control, and four management actions for open positions. UI feedback is immediate via canvas rendering, with each operation confirmed on the panel and written to the journal. The panel can be collapsed into a compact bar showing floating result and dragged by its header.
BUY/SELL place market orders at the current lot, with live Bid/Ask and spread shown. Lot step changes follow the symbolβs volume step and respect min/max, with margin and point value displayed. CLOSE ALL, CLOSE PROFIT, and CLOSE LOSS use a second-click confirmation that arms for three seconds. BREAKEVEN moves stop loss to entry for profitable positions.
Safety controls include click-only execution, disabled state when covered or outside the chart, broker stop-level validation, and terminal trading-stat...
π Read | Calendar | @mql5dev
BUY/SELL place market orders at the current lot, with live Bid/Ask and spread shown. Lot step changes follow the symbolβs volume step and respect min/max, with margin and point value displayed. CLOSE ALL, CLOSE PROFIT, and CLOSE LOSS use a second-click confirmation that arms for three seconds. BREAKEVEN moves stop loss to entry for profitable positions.
Safety controls include click-only execution, disabled state when covered or outside the chart, broker stop-level validation, and terminal trading-stat...
π Read | Calendar | @mql5dev
π17β€9π€©8π₯5π¨βπ»1π1
InfoPanel is a compact chart overlay for tracking key session stats at a glance. It displays the current symbol, time remaining to the close of the active candle, current spread in points, daily ATR in points, and todayβs range as a percentage of the daily ATR.
Visual cues are included: spread switches to red when it widens, and the range-used value switches to gold when it exceeds 100%. Inputs cover ATR period, chart corner selection, X/Y offsets, font size, and text color.
The indicator runs on any symbol and timeframe. Resource usage is minimal, using a 1-second timer and four text labels. It produces no signals and is intended for information only.
Deployment: copy InfoPanel.mq5 to MQL5\Indicators, compile in MetaEditor, then attach to a chart and adjust Inputs as needed.
π Read | Docs | @mql5dev
Visual cues are included: spread switches to red when it widens, and the range-used value switches to gold when it exceeds 100%. Inputs cover ATR period, chart corner selection, X/Y offsets, font size, and text color.
The indicator runs on any symbol and timeframe. Resource usage is minimal, using a 1-second timer and four text labels. It produces no signals and is intended for information only.
Deployment: copy InfoPanel.mq5 to MQL5\Indicators, compile in MetaEditor, then attach to a chart and adjust Inputs as needed.
π Read | Docs | @mql5dev
π10β€4π₯4π€©4
Session Clock is a compact chart panel that shows which major FX sessions are currently open, time until the next session opens, and the remaining time on the active candle. It uses a 24-hour GMT dial with Sydney, Tokyo, London, and New York rendered as arcs; open sessions are highlighted while closed sessions are dimmed, with a GMT-driven hand for current time.
The panel includes a central candle countdown with a progress ring, plus a per-session legend listing hours and live open/close countdowns. When the market is closed, the countdown switches to time until the next trading session for the symbol.
Additional readouts include current spread versus an average since load, todayβs range versus the 14-day average daily range, and GMT versus server time. Daylight saving time adjusts automatically per region (Europe, US, Australia; Tokyo fixed), verified ...
π Read | AppStore | @mql5dev
The panel includes a central candle countdown with a progress ring, plus a per-session legend listing hours and live open/close countdowns. When the market is closed, the countdown switches to time until the next trading session for the symbol.
Additional readouts include current spread versus an average since load, todayβs range versus the 14-day average daily range, and GMT versus server time. Daylight saving time adjusts automatically per region (Europe, US, Australia; Tokyo fixed), verified ...
π Read | AppStore | @mql5dev
β€12π9π€©9π₯8
Order blocks matter only while they hold. A static box does not show whether price already revisited it multiple times or closed through it. This indicator tracks each zone bar by bar, using the chart timeframe or a higher one, and marks zones as fresh, tested, or broken with an explicit visit count.
A zone starts βfreshβ in full color. The first return marks it βtestedβ and lightens the fill; each later return increments the count. A visit is one entry event, not per-bar time spent inside. Break rules are close-based: demand breaks on a close below the bottom, supply breaks on a close above the top; wicks alone do not break.
Block detection uses a block candle plus a run (default five candles), with minimum move and minimum real-body filters, and sizing normalized by average ranges to avoid symbol-specific tuning. Overlapping zones are merged per si...
π Read | AppStore | @mql5dev
A zone starts βfreshβ in full color. The first return marks it βtestedβ and lightens the fill; each later return increments the count. A visit is one entry event, not per-bar time spent inside. Break rules are close-based: demand breaks on a close below the bottom, supply breaks on a close above the top; wicks alone do not break.
Block detection uses a block candle plus a run (default five candles), with minimum move and minimum real-body filters, and sizing normalized by average ranges to avoid symbol-specific tuning. Overlapping zones are merged per si...
π Read | AppStore | @mql5dev
β€9π6π₯5π€©5
Framework updates extend the initial CAppliedPrice and CSma set with EMA, SMMA, and LWMA modules. CSma gets a boundary-condition fix for the βexactly N barsβ case that previously caused an array out of range on the next tick.
A common CSmoothingBase is introduced to unify buffers, period validation, and an onCalculate contract. The indicator now selects the smoothing method at runtime via an ENUM_MA_METHOD input, instantiating the chosen smoother dynamically through a base-class pointer.
EMA is added using the standard recurrence with a precomputed smoothing factor and a source-based seed. Plot labels are moved from compile-time properties to PlotIndexSetString, producing method-aware labels like EMA(14). SMMA is positioned as Wilder-style exponential smoothing with alpha = 1/period, alongside cost and weighting comparisons across methods.
π Read | Calendar | @mql5dev
A common CSmoothingBase is introduced to unify buffers, period validation, and an onCalculate contract. The indicator now selects the smoothing method at runtime via an ENUM_MA_METHOD input, instantiating the chosen smoother dynamically through a base-class pointer.
EMA is added using the standard recurrence with a precomputed smoothing factor and a source-based seed. Plot labels are moved from compile-time properties to PlotIndexSetString, producing method-aware labels like EMA(14). SMMA is positioned as Wilder-style exponential smoothing with alpha = 1/period, alongside cost and weighting comparisons across methods.
π Read | Calendar | @mql5dev
β€11π€©8π₯7π6
HistoryExportTester exports Strategy Tester price history to CSV: closed bars for any timeframe and optional tick-by-tick data.
Tester exports are useful because chart history is capped by the βMax bars in chartβ setting. The tester is not, allowing multi-year M1 bars or full real-tick periods in a single run.
Usage: select the EA in Strategy Tester, pick symbol and date range. The test timeframe is irrelevant; the export timeframe is an input. For bars, any model works and β1 minute OHLCβ is fastest. For ticks, use βEvery tick based on real ticksβ, otherwise ticks are generated. Output goes to Terminal\Common\Files, or the agentβs MQL5\Files if common folder is disabled.
Files: <symbol>_<timeframe>_bars.csv (time, OHLC, tick_volume, real_volume, spread), closed bars only. <symbol>_ticks.csv (time_msc, time, bid, ask, last, volume, flags).
A gap report lists g...
π Read | Quotes | @mql5dev
Tester exports are useful because chart history is capped by the βMax bars in chartβ setting. The tester is not, allowing multi-year M1 bars or full real-tick periods in a single run.
Usage: select the EA in Strategy Tester, pick symbol and date range. The test timeframe is irrelevant; the export timeframe is an input. For bars, any model works and β1 minute OHLCβ is fastest. For ticks, use βEvery tick based on real ticksβ, otherwise ticks are generated. Output goes to Terminal\Common\Files, or the agentβs MQL5\Files if common folder is disabled.
Files: <symbol>_<timeframe>_bars.csv (time, OHLC, tick_volume, real_volume, spread), closed bars only. <symbol>_ticks.csv (time_msc, time, bid, ask, last, volume, flags).
A gap report lists g...
π Read | Quotes | @mql5dev
β€7π₯6π€©4π1
Clipping was added as a first-class rendering constraint, targeting UI separation issues seen in dashboards: overflowing list rows, plot lines crossing axes, and text escaping button bounds. The mechanism limits drawing by a boundary owned by another widget, rather than modifying the shape.
The implementation reuses per-pixel coverage already produced by the rasterizer. Clip coverage and shape coverage are multiplied in the inner Fill loop, enabling anti-aliased rectangular and path clips, nesting via repeated multiplication, and predictable artifacts such as edge darkening from conflation in self-clips, thin geometry, and deep clip stacks.
Supporting pieces include SCairoRect for bounds, NaN-safe emptiness checks, half-open containment, rectangle intersection/union, exact path bounds from flattened vertices, and hit-testing using the same scanline crossing...
π Read | Freelance | @mql5dev
The implementation reuses per-pixel coverage already produced by the rasterizer. Clip coverage and shape coverage are multiplied in the inner Fill loop, enabling anti-aliased rectangular and path clips, nesting via repeated multiplication, and predictable artifacts such as edge darkening from conflation in self-clips, thin geometry, and deep clip stacks.
Supporting pieces include SCairoRect for bounds, NaN-safe emptiness checks, half-open containment, rectangle intersection/union, exact path bounds from flattened vertices, and hit-testing using the same scanline crossing...
π Read | Freelance | @mql5dev
β€15π₯9π7π€©4π¨βπ»1
An educational example implements an opening-candle setup around the New York session open. The EA waits for the M5 bar aligned to 09:30 New York time (often 16:30 server time on NY-close brokers). A trade triggers when the candle body exceeds total wick size and tick volume is above 1.5x the 20-bar average, then a single position is opened in the candle direction.
Risk controls are straightforward: one trade per day, at most one open position, fixed SL/TP in price units (defaults 30/120, scaled by symbol price), and a time-based forced close. Position sizing can be risk-based via stop distance or fixed-lot, with margin-aware downscaling. No martingale, grid, averaging, or hedging logic is used.
Backtest notes: Strategy Tester results on USTEC M5 (every tick, 2025) show 91 trades, net +2,559 on 10,000 deposit with 100 risk per trade, PF 1.41, 29.7% win rate...
π Read | Docs | @mql5dev
Risk controls are straightforward: one trade per day, at most one open position, fixed SL/TP in price units (defaults 30/120, scaled by symbol price), and a time-based forced close. Position sizing can be risk-based via stop distance or fixed-lot, with margin-aware downscaling. No martingale, grid, averaging, or hedging logic is used.
Backtest notes: Strategy Tester results on USTEC M5 (every tick, 2025) show 91 trades, net +2,559 on 10,000 deposit with 100 risk per trade, PF 1.41, 29.7% win rate...
π Read | Docs | @mql5dev
π9β€7π₯5π€©3π2
Multi-currency EAs are not a βtrade more symbolsβ problem. Concurrent EURUSD and GBPUSD exposure concentrates USD risk, so portfolio allocation, correlation control, and unified limits become mandatory.
MetaTrader 5 build 6060 adds an AI Assistant in MetaEditor with MCP support. It can generate MQL5, compile, fix errors, and run Strategy Tester passes, turning EA prototyping into an iterative research loop with logged decisions.
A prototype portfolio EA was assembled: S1 breakout, S2 mean-reversion, and an experimental S6 pair module (disabled). Supporting scripts computed correlations, regime stats, and spread screening. Backtests produced mixed results, with the assistant rejecting weak configurations and fixing self-introduced defects.
Key outcome: a reproducible framework with risk layers and audit requirements, not a verified profitable system.
π Read | Docs | @mql5dev
MetaTrader 5 build 6060 adds an AI Assistant in MetaEditor with MCP support. It can generate MQL5, compile, fix errors, and run Strategy Tester passes, turning EA prototyping into an iterative research loop with logged decisions.
A prototype portfolio EA was assembled: S1 breakout, S2 mean-reversion, and an experimental S6 pair module (disabled). Supporting scripts computed correlations, regime stats, and spread screening. Backtests produced mixed results, with the assistant rejecting weak configurations and fixing self-introduced defects.
Key outcome: a reproducible framework with risk layers and audit requirements, not a verified profitable system.
π Read | Docs | @mql5dev
π13β€12π€©6π₯5π2
RoundNumbers plots horizontal price levels at round-number increments around the current visible range, such as 1.1000/1.1050 on EUR/USD, 2650.00 on gold, or 30500 on an index. These levels often align with clustered orders and can highlight areas where price action changes pace.
The indicator renders a dotted minor grid line at each step and a thicker solid line at every tenth step for major figures. Step size can be fixed or calculated automatically from the chart zoom, keeping the number of lines on screen under control. Levels update with scrolling and rescaling, and only the visible area is processed to limit resource use.
Configuration includes fixed step (0 for automatic), maximum on-screen lines for auto mode, and styling for minor/major lines. Installation: copy RoundNumbers.mq5 to MQL5\Indicators, compile, then attach to a chart. This is a ...
π Read | Freelance | @mql5dev
The indicator renders a dotted minor grid line at each step and a thicker solid line at every tenth step for major figures. Step size can be fixed or calculated automatically from the chart zoom, keeping the number of lines on screen under control. Levels update with scrolling and rescaling, and only the visible area is processed to limit resource use.
Configuration includes fixed step (0 for automatic), maximum on-screen lines for auto mode, and styling for minor/major lines. Installation: copy RoundNumbers.mq5 to MQL5\Indicators, compile, then attach to a chart. This is a ...
π Read | Freelance | @mql5dev
π9β€4π₯2π€©1π1
Part 3 adds an alert layer to the existing managed-trendline lifecycle, reusing state transitions instead of re-detecting market events. Touch, bounce, break, and resurrection alerts are emitted only when the state machine moves between specific states, keeping lifecycle logic as the single source of truth.
The design records transitions inside CManagedTrendline (previous state + pending-change flag), then CTrendlineManager translates supported transitions into alert events and forwards them to a dedicated CTrendlineAlert component.
CTrendlineAlert focuses on filtering and delivery: per-event toggles, separate switches for manual vs auto-generated lines, and independent popup/push channels. Messages are standardized with symbol, timeframe, source, direction from slope, price context at dispatch, and object name, enabling actionable notifications w...
π Read | NeuroBook | @mql5dev
The design records transitions inside CManagedTrendline (previous state + pending-change flag), then CTrendlineManager translates supported transitions into alert events and forwards them to a dedicated CTrendlineAlert component.
CTrendlineAlert focuses on filtering and delivery: per-event toggles, separate switches for manual vs auto-generated lines, and independent popup/push channels. Messages are standardized with symbol, timeframe, source, direction from slope, price context at dispatch, and object name, enabling actionable notifications w...
π Read | NeuroBook | @mql5dev
β€13π9π€©5π₯4
MA Toolkit provides a reference implementation of SMA, EMA, and LWMA with explicit calculations instead of relying on built-in averaging calls. SMA uses the arithmetic mean of the last N prices, EMA applies the smoothing factor 2/(N+1) and initializes from the first historical price, and LWMA weights the newest bar at N down to 1 for the oldest.
Two lines are plotted simultaneously: a configurable fast MA and a slow MA. The fast line is slope-colored with a flat-threshold option, while the slow line can be hidden without disabling crossover logic. Crossover arrows mark fast/slow intersections, and an optional alert triggers once per bar based on the last closed candle only.
Computation is optimized to update only new and forming bars. Inputs cover MA types, periods, applied price, arrow offset, panel text, and display toggles. Notes include EMA histo...
π Read | Freelance | @mql5dev
Two lines are plotted simultaneously: a configurable fast MA and a slow MA. The fast line is slope-colored with a flat-threshold option, while the slow line can be hidden without disabling crossover logic. Crossover arrows mark fast/slow intersections, and an optional alert triggers once per bar based on the last closed candle only.
Computation is optimized to update only new and forming bars. Inputs cover MA types, periods, applied price, arrow offset, panel text, and display toggles. Notes include EMA histo...
π Read | Freelance | @mql5dev
π7β€5π€©5π₯3
CDropList implements a drop-down list for MQL5 charts as a composite control, wrapping multiple chart objects behind a single API. It coordinates creation, positioning, visibility, and deletion for the main block (border, background, label, chosen item, button) and the opened list (background, arrows, item cells).
Lifecycle is handled via Create() and Destroy(), with CreateDrop()/DestroyDrop() controlling the opened state. Object naming is isolated through a required unique prefix to avoid collisions across instances.
Item management keeps m_items_names and m_current_mode consistent through AddItem(), DeleteItem(), and SelectedItem(). Layout and appearance changes go through Refresh(), which updates only changed properties and closes any open list to avoid stale geometry.
ChartEvents() integrates with OnChartEvent(), returning explicit action codes fo...
π Read | Signals | @mql5dev
Lifecycle is handled via Create() and Destroy(), with CreateDrop()/DestroyDrop() controlling the opened state. Object naming is isolated through a required unique prefix to avoid collisions across instances.
Item management keeps m_items_names and m_current_mode consistent through AddItem(), DeleteItem(), and SelectedItem(). Layout and appearance changes go through Refresh(), which updates only changed properties and closes any open list to avoid stale geometry.
ChartEvents() integrates with OnChartEvent(), returning explicit action codes fo...
π Read | Signals | @mql5dev
π13π€©12β€7π₯5
Position Tool adds a Long/Short Position drawing to MetaTrader 5 with visual trade planning and automatic position sizing. It renders entry, stop, and target zones and recalculates risk metrics on every mouse drag, including lot size, cash risk, projected reward, reward-to-risk, point distance, and margin impact.
P/L per lot is derived from OrderCalcProfit(), keeping calculations consistent across Forex, metals, indices, and crypto CFDs, regardless of account currency. Volume is rounded down to the symbolβs step to prevent configured risk from being exceeded, with a MIN LOT > RISK warning when applicable.
On attach, it initializes at current price with a 1x ATR(14) stop and a 2:1 target. Entry moves the whole structure; entry endpoints adjust width. Dragging target across entry flips Long/Short automatically. Controls include mirror (Long/Short) and ...
π Read | CodeBase | @mql5dev
P/L per lot is derived from OrderCalcProfit(), keeping calculations consistent across Forex, metals, indices, and crypto CFDs, regardless of account currency. Volume is rounded down to the symbolβs step to prevent configured risk from being exceeded, with a MIN LOT > RISK warning when applicable.
On attach, it initializes at current price with a 1x ATR(14) stop and a 2:1 target. Entry moves the whole structure; entry endpoints adjust width. Dragging target across entry flips Long/Short automatically. Controls include mirror (Long/Short) and ...
π Read | CodeBase | @mql5dev
β€6π₯6π5π€©4π€2
Stop-out risk is the one exit an EA cannot control when stop loss is missing or distant. The margin level is visible, but the price distance to stop-out and the effect of a new order are not. Grid and averaging systems need that threshold, and common linear estimates break on FX conversion and on margin behavior.
CStopOutGuard models positions for one symbol and computes the first tick-grid bid where the account model reaches the stop-out level. It uses OrderCalcProfit() and OrderCalcMargin(), scans within Β±50% of current bid, then refines with bisection. Results include SOG_OUT_OF_RANGE and SOG_ALREADY_BELOW.
Tester runs on MetaQuotes-Demo showed key details: USDJPY profit conversion depends on the valuation price, margin tiers increase per-lot cost with total side volume, and Strategy Tester kept margin fixed at fill-time for open positions. A recorder...
π Read | Forum | @mql5dev
CStopOutGuard models positions for one symbol and computes the first tick-grid bid where the account model reaches the stop-out level. It uses OrderCalcProfit() and OrderCalcMargin(), scans within Β±50% of current bid, then refines with bisection. Results include SOG_OUT_OF_RANGE and SOG_ALREADY_BELOW.
Tester runs on MetaQuotes-Demo showed key details: USDJPY profit conversion depends on the valuation price, margin tiers increase per-lot cost with total side volume, and Strategy Tester kept margin fixed at fill-time for open positions. A recorder...
π Read | Forum | @mql5dev
β€14π7π€©6π₯5