Watch how to download trading robots for free
Find us on Twitter!
Join our fan page
Interesting script?
So post a link to it -
let others appraise it
You liked the script? Try it in the MetaTrader 5 terminal
Experts

Prop-Firm Equity Guard - daily and max drawdown protection (FTMO-style) - expert for MetaTrader 5

Cristian Ciunae
Cristian Ciunae
Trader for 8 years & MQL5 Developer. Specializing in Prop Firm Risk Management.
My Core Focus: I build MQL5 tools and Expert Advisors designed for the realities of live trading: strict drawdown limits, hidden swap/commission costs, and news slippage.
What I Do:
| English Русский 中文 Español Deutsch 日本語 Português 한국어 Français Italiano Türkçe
Views:
1498
Rating:
(1)
Published:
Updated:
MQL5 Freelance Need a robot or indicator based on this code? Order it on Freelance Go to Freelance

Prop-Firm Equity Guard: Stop blowing funded accounts over silly mistakes

Let’s be honest. Passing a prop firm challenge is hard enough without losing it to a sudden news spike, a bad spread, or just a moment of revenge trading.

I coded this utility because I needed a strict, emotionless risk manager for my own evaluations. You attach it to just one chart, and it quietly watches your entire account in the background. If you get too close to the daily or max drawdown rules, it pulls the plug before the prop firm terminates your account.

What it actually does:

  • Stops Revenge Trading (Daily Limit): Set your firm's daily loss limit. If your equity drops near it, the tool closes everything and locks you out for the day. You live to trade tomorrow.

  • Max Drawdown Protection: Monitors your absolute account limit to make sure you never lose the initial evaluation fee.

  • The Slippage Buffer: Prop firms don't care if slippage or a news spike ruined your trade. This tool lets you set a safety buffer (like stopping 1% before the actual limit) so spread manipulation doesn't fail your challenge.

  • The Kill-Switch: When a limit is hit, it doesn't just close open positions. It instantly deletes all pending orders across all pairs so nothing triggers by accident.

  • Plug & Play: No coding or complicated setups. Drop it on a single chart and it protects all symbols and timeframes automatically.

It’s simple, it’s lightweight, and it does exactly what it says. The daily limit resets automatically based on your broker's server time.

Protect your evaluation fees and keep your funded accounts safe.

For developers: the tool sets a global flag your own EA can check in one line, so your strategies stop trading too.
  • Version 1.10 - the breach state and the day-start snapshot are now persisted to Terminal\Common\Files (one file per account), so a terminal restart, a VPS reboot, a recompile or a re-attach can no longer clear a halt or re-anchor the daily limit to the reduced equity. New input InpResetState clears a stored halt for a new challenge. Thanks to Valerii Sakara for reporting the bug.

Version history:

v1.12 - File renamed to PropFirmEquityGuard.mq5. Protection logic unchanged.

v1.10 - Breach state and day-start snapshot are saved per account, so a restart can no longer clear a halt.

v1.00 - First release.


An extended version with additional features, Prop Firm Equity Guard Pro, is available in the Market.


MSB Pro ALGO Position Risk Monitor for MT5 MSB Pro ALGO Position Risk Monitor for MT5

Free MT5 position risk monitor displaying stop-loss risk, account risk percentage, positions without SL and individual position risk directly on the chart.

MSB Pro Algo Neon Account Dashboard for MT5 MSB Pro Algo Neon Account Dashboard for MT5

Free neon-style MT5 account dashboard displaying balance, equity, floating P/L, daily realized P/L, win rate and open positions directly on the chart.

Risk Guard — risk-based lot size, daily loss lock, max positions, oversized-trade trim, forced stop-loss Risk Guard — risk-based lot size, daily loss lock, max positions, oversized-trade trim, forced stop-loss

Enforces your own risk rules on every position, whether opened by hand or by another EA: shows the lot size that matches your risk, locks the account for the day after a set loss, caps open positions, trims positions that risk more than allowed, and adds a stop-loss to any position opened without one.

Smart Loss Exit — early exit for losing positions (ATR adverse excursion, time in trade, EMA invalidation, RSI, money cap) with a CSV journal Smart Loss Exit — early exit for losing positions (ATR adverse excursion, time in trade, EMA invalidation, RSI, money cap) with a CSV journal

Closes losing positions early, before the full stop-loss, when a rule says the trade is not coming back: adverse move beyond N x ATR, too long in loss, EMA trend flipped, RSI against the position, or a money cap. Never touches a position in profit. Observe-only mode journals what would be closed without closing anything. Every exit is written to CSV with the rule, the age and the maximum adverse excursion, so the rules can be tuned from data.