Prop Firm Risk Guardian Pro Auto Flatten
- Utilities
-
Yuki Nakayama
I am Yuki, an independent developer in Japan. I build indicators and utilities for MetaTrader 5 and publish them here on the MQL5 Market. Every tool has a free edition, so you can see how it behaves on your own charts before you consider the paid one. - Version: 1.17
- Updated: 5 October 2026
- Activations: 5
Helps you stay within the loss limits of a funded or challenge account — with a seatbelt that fastens itself. PRO automatically sends a close order for every open position on the chart symbol the instant a daily-loss or max-drawdown limit is breached, and refuses its own order buttons for as long as the account stays past the limit. Plus one-click BUY / SELL at the largest lot your own rules allow right now, with an arm-then-confirm so a single misclick never fires a trade.
Utility tool. No strategy, no profit promises, no martingale.
Why PRO (vs free Risk Guardian)
Free Risk Guardian shows you how close you are to breaching, in real time. PRO closes the loop.
Auto-flatten on breach: the moment daily loss or trailing high-water-mark drawdown is reached, a close order is sent for every open position on the chart symbol, including positions opened by hand or by other EAs on that symbol, and the panel's own BUY and SELL buttons are refused for as long as the account stays past the limit. Pending orders are left in place, positions on other symbols are not touched, and orders sent from other tools or by hand are not blocked, because MetaTrader offers no way to intercept them. No second-guessing in the heat of the moment. By default only the chart symbol is closed; since version 1.17 one input can widen the flatten to every symbol on the account, and another can set the daily loss limit as a percent of the initial balance instead of the day's starting balance.
One-click BUY / SELL at max lot: the panel back-solves the lot from the smaller of two amounts, your per-trade risk percent of balance and the buffer fraction of what is left before the binding limit, then caps it at your hard lot cap and rounds it down to your broker's lot step. PRO turns that number into a clickable BUY or SELL with the stop already attached.
Arm-then-confirm: first click arms (white outline plus a "tap to confirm" hint), second click within 2.6 seconds fires, otherwise it auto-disarms. And state-change alerts send a popup, and a push notification if you enable it, the instant SAFE, CAUTION or LOCKDOWN flips.
All free features included
Daily loss with remaining buffer and reset countdown, max drawdown on trailing high-water-mark or static-from-initial, profit-target progress, MAX LOT NOW back-solved with the platform's own profit calculation, and a SAFE / CAUTION / LOCKDOWN status that colours the status strip and the panel's accents so you feel the risk at a glance. Draggable rounded panel with four sizes, English / Japanese, amounts computed in your account currency. Four rule presets: 2-step (daily 5% / max 10%), 1-step (3% / 6%), instant (4% / 8%) and custom, plus an account-size input for the starting balance. Hover most elements for a one-line explanation.
How it works
MT5 has no pre-trade hook for manual orders, so the guard is reactive: it watches your equity tick by tick and auto-flattens the moment a limit is breached. Think of it as a seatbelt, not a lock that physically prevents you from clicking. In practice it takes the decision out of your hands: a close order goes out for you on the first tick after the limit is seen. Each close request is then checked by its result, positions still open are retried (5 more times by default, at least 2 seconds apart), and while the market is closed or the connection is down it keeps checking for up to 30 minutes; if positions still remain, the panel shows FLATTEN FAILED and an alert tells you. It cannot undo slippage, a gap over the weekend or a disconnection, so the account can still finish past the limit in those cases.
The one-click execution side does what it says: the lot is the largest the panel computes for your stop distance, rounded down to the broker's step and capped by your risk percent, buffer fraction and hard lot cap, with the SL attached at your panel stop distance and a magic number so the EA can tell its own positions apart. After firing, the auto-flatten guard keeps watching.
Compatibility
MT5, any broker, funded, challenge or personal accounts. Hedging and netting both supported. No DLLs, no external dependencies. Inputs cover language (EN / JP), panel corner and size, presets, daily-loss / max-DD / target percents, drawdown basis, reset hour, SL points, risk per trade, buffer fraction, hard lot cap, auto-flatten on / off, order TP distance, account size, flatten scope, daily-limit base, and e-mail and sound alerts.
What this is not
Not a trading strategy and not a profit guarantee — it is a discipline tool. Not a pre-trade lock: MT5 cannot block your finger before you click; the guard reacts at the next tick. Withdrawals and deposits: since version 1.17 a withdrawal made after the daily reset is left out of the daily loss, but the max drawdown and the target are still measured from the fall in equity, so a withdrawal still counts there and a deposit counts as a gain. On a day you withdraw, the drawdown can still reach LOCKDOWN and PRO then closes the positions in its flatten scope, so switch the auto-flatten input (Close all + block on breach) off before withdrawing, take a fresh baseline afterwards with the Re-take the account baseline now input in the Baseline group, and switch auto-flatten back on after that. No martingale, no grid.
Test it first
Run it on a demo prop-style account, set tight limits, deliberately push past them, and verify auto-flatten fires. Confirm the one-click side computes the lot you expect and attaches the SL. Then deploy to your challenge or funded account.
Trading involves risk. This tool helps you stay within your prop firm's rules; it cannot guarantee you pass a challenge or keep a funded account. If it saves you one breach, please leave a review — it helps me keep building utilities like this.
Shared foundation
Prop Firm Risk Guardian PRO builds directly on the free real-time panel, whose listing is public on this Market, and adds the auto-flatten and one-click execution described above. Every input and every row of the panel is explained in the user guide on the author's blog: Prop Firm Risk Guardian user guide
Buy once and every future version is yours for free. This tool is actively maintained, and its roadmap is shaped directly by user feedback, so the features keep growing after you buy. Tell me in the comments what you would add or change and it goes on the list.
Utility tool. No strategy, no profit promises, no martingale.
Why PRO (vs free Risk Guardian)
Free Risk Guardian shows you how close you are to breaching, in real time. PRO closes the loop.
Auto-flatten on breach: the moment daily loss or trailing high-water-mark drawdown is reached, a close order is sent for every open position on the chart symbol, including positions opened by hand or by other EAs on that symbol, and the panel's own BUY and SELL buttons are refused for as long as the account stays past the limit. Pending orders are left in place, positions on other symbols are not touched, and orders sent from other tools or by hand are not blocked, because MetaTrader offers no way to intercept them. No second-guessing in the heat of the moment. By default only the chart symbol is closed; since version 1.17 one input can widen the flatten to every symbol on the account, and another can set the daily loss limit as a percent of the initial balance instead of the day's starting balance.
One-click BUY / SELL at max lot: the panel back-solves the lot from the smaller of two amounts, your per-trade risk percent of balance and the buffer fraction of what is left before the binding limit, then caps it at your hard lot cap and rounds it down to your broker's lot step. PRO turns that number into a clickable BUY or SELL with the stop already attached.
Arm-then-confirm: first click arms (white outline plus a "tap to confirm" hint), second click within 2.6 seconds fires, otherwise it auto-disarms. And state-change alerts send a popup, and a push notification if you enable it, the instant SAFE, CAUTION or LOCKDOWN flips.
All free features included
Daily loss with remaining buffer and reset countdown, max drawdown on trailing high-water-mark or static-from-initial, profit-target progress, MAX LOT NOW back-solved with the platform's own profit calculation, and a SAFE / CAUTION / LOCKDOWN status that colours the status strip and the panel's accents so you feel the risk at a glance. Draggable rounded panel with four sizes, English / Japanese, amounts computed in your account currency. Four rule presets: 2-step (daily 5% / max 10%), 1-step (3% / 6%), instant (4% / 8%) and custom, plus an account-size input for the starting balance. Hover most elements for a one-line explanation.
How it works
MT5 has no pre-trade hook for manual orders, so the guard is reactive: it watches your equity tick by tick and auto-flattens the moment a limit is breached. Think of it as a seatbelt, not a lock that physically prevents you from clicking. In practice it takes the decision out of your hands: a close order goes out for you on the first tick after the limit is seen. Each close request is then checked by its result, positions still open are retried (5 more times by default, at least 2 seconds apart), and while the market is closed or the connection is down it keeps checking for up to 30 minutes; if positions still remain, the panel shows FLATTEN FAILED and an alert tells you. It cannot undo slippage, a gap over the weekend or a disconnection, so the account can still finish past the limit in those cases.
The one-click execution side does what it says: the lot is the largest the panel computes for your stop distance, rounded down to the broker's step and capped by your risk percent, buffer fraction and hard lot cap, with the SL attached at your panel stop distance and a magic number so the EA can tell its own positions apart. After firing, the auto-flatten guard keeps watching.
Compatibility
MT5, any broker, funded, challenge or personal accounts. Hedging and netting both supported. No DLLs, no external dependencies. Inputs cover language (EN / JP), panel corner and size, presets, daily-loss / max-DD / target percents, drawdown basis, reset hour, SL points, risk per trade, buffer fraction, hard lot cap, auto-flatten on / off, order TP distance, account size, flatten scope, daily-limit base, and e-mail and sound alerts.
What this is not
Not a trading strategy and not a profit guarantee — it is a discipline tool. Not a pre-trade lock: MT5 cannot block your finger before you click; the guard reacts at the next tick. Withdrawals and deposits: since version 1.17 a withdrawal made after the daily reset is left out of the daily loss, but the max drawdown and the target are still measured from the fall in equity, so a withdrawal still counts there and a deposit counts as a gain. On a day you withdraw, the drawdown can still reach LOCKDOWN and PRO then closes the positions in its flatten scope, so switch the auto-flatten input (Close all + block on breach) off before withdrawing, take a fresh baseline afterwards with the Re-take the account baseline now input in the Baseline group, and switch auto-flatten back on after that. No martingale, no grid.
Test it first
Run it on a demo prop-style account, set tight limits, deliberately push past them, and verify auto-flatten fires. Confirm the one-click side computes the lot you expect and attaches the SL. Then deploy to your challenge or funded account.
Trading involves risk. This tool helps you stay within your prop firm's rules; it cannot guarantee you pass a challenge or keep a funded account. If it saves you one breach, please leave a review — it helps me keep building utilities like this.
Shared foundation
Prop Firm Risk Guardian PRO builds directly on the free real-time panel, whose listing is public on this Market, and adds the auto-flatten and one-click execution described above. Every input and every row of the panel is explained in the user guide on the author's blog: Prop Firm Risk Guardian user guide
Buy once and every future version is yours for free. This tool is actively maintained, and its roadmap is shaped directly by user feedback, so the features keep growing after you buy. Tell me in the comments what you would add or change and it goes on the list.
