Portfolio Peak2Valley Preserver
- Utilità
- Versione: 3.2
- Attivazioni: 10
SQXHK presents:
Take absolute control of your portfolio's exit strategy with Profit Taker EA. Designed as a utility expert advisor, this tool continuously monitors your account's aggregate open positions and pending orders, executing an institutional-grade, mathematical exit sequence based on your strategy's historical or desired MAE (Maximum Adverse Excursion) and MFE (Maximum Favorable Excursion) metrics.
Whether you trade manually or deploy multiple grid/martingale EAs, Profit Taker acts as your ultimate automated circuit breaker—securing profits precisely when your statistical targets are reached and safely flatlining the account.
💎 Key Features
-
Advanced MAE/MFE Exit Matrix: Calculates exact profit targets using the historical performance metrics of your strategy.
-
Auto or Custom Equity Baselines: Automatically locks in your starting equity at launch, or allows you to specify a fixed dollar baseline.
-
Smart Alert Throttling: Prompts real-time platform alerts if your running portfolio P/L breaches your specified MAE or MFE levels, using built-in timers to prevent alert flooding.
-
Full Housekeeping Control: Configurable choices to close all active open positions, purge left-over pending orders, or both.
-
Terminal Hard-Stop: Safely kills a global trading flag and shuts down the entire MetaTrader 5 terminal process after execution to prevent unwanted re-entries by other bots.
📐 The Execution Formula
The EA implements a strict statistical matrix. It treats both input metrics as absolute values to find your portfolio's expected volatility band, then applies an optional percentage buffer:
Once your account's running open P/L matches or exceeds this target, the exit routine triggers instantly.
⚙️ Input Parameters Explained
Core Settings & Housekeeping
-
Slippage / Deviation for Closes ( InpDeviationPoints ): Maximum allowed slippage (in points) when executing market closures.
-
Verbose Logging ( InpLogVerbose ): Enable detailed logs in the terminal experts tab for explicit tracking.
-
Delete Pending Orders ( InpDeletePendingOrders ): If true , all limits and stops are purged upon target hit.
-
Close Open Positions ( InpClosePositions ): If true , flattens all open exposure across the entire account.
-
Close Terminal After Action ( InpCloseTerminalAfterAction ): Sets a global variable ( GLOBAL_EA_TRADING = 0 ) and safely closes down the MT5 terminal completely.
-
MS to Wait After Global Flag ( InpWaitAfterFlagMs ): Brief delay to ensure database state writing before terminal termination.
Baselines & MAE / MFE Inputs
-
Custom Starting Equity ( InpCustomStartingEquity ): Define a fixed balance/equity starting line. Leave at 0.0 for automatic detection upon attachment.
-
Portfolio MAE ( InpPortfolioMAE ): Your maximum expected drawdown point from reports (inputted as a negative signed value).
-
Portfolio MFE ( InpPortfolioMFE ): Your maximum expected profit run-up value.
-
Enable Take Profit ( InpEnableMaeMfeTakeProfit ): Activates the automated formula-based mathematical exit loop.
-
Additional Percentage ( InpAdditionalPercent ): Add a padding percentage on top of the calculated MAE+MFE baseline target.
Timing & Loop Thresholds
-
Evaluation Interval ( InpCheckIntervalSeconds ): How frequently (in seconds) the EA recalculates the equity and profit math (Timer-based loop independent of tick volume).
-
Prompt Alert Interval ( InpAlertIntervalMinutes ): Throttling timer (in minutes) defining how often the EA is allowed to prompt visual alerts to the screen when limits are breached.
Useful for:
-
Prop Firm traders managing tight trailing drawdowns.
-
Portfolio managers supervising overlapping automated strategies.
-
Manual traders who want to eliminate psychological hesitation at profit targets.
Visit SQX.hk and join our Whatsapp community!
