Explore the latest free tools from the MQL5 community. Here's a new indicator, expert advisor, or script for MetaTrader.

An account guard for prop-firm challenges and funded accounts. It does not open trades: it watches the whole account (manual trades and any other EA) and closes everything before the firm's limits are broken.
How it works
Trade the powerful Traders Dynamic Index strategy automatically with this dedicated TDI Expert Advisor. More details.
- Daily loss limit - today's loss is measured from the day's starting balance (or equity). When it reaches the limit minus a safety buffer, all positions are closed, pending orders are deleted and trading stays blocked until the next day.
- Max drawdown - static (from the starting balance) or trailing (from the highest equity). The trailing floor can lock at the starting balance, as most firms do. At the floor plus the buffer everything is closed and the account stays locked.
- Profit target (optional) - closes everything when equity reaches start + target, so a passed challenge is not given back.
- Exposure limits (optional) - maximum total lots and maximum open positions; the newest positions are closed first.
- Friday close (optional) - closes everything at a set server time to avoid weekend gaps.
- Panel and alerts - equity, today's P/L, daily room left, drawdown floor and room left; phone push notifications.
- Restart-safe - the equity peak and the lock are saved per account in Global Variables, so a terminal or VPS restart does not reset the protection.
Inputs
- StartBalance - challenge starting balance.
- DailyLossUSD, DailyFromEquity, DayResetHour, DailyBufferUSD - daily loss rule (check whether your firm measures from balance or equity at the day start).
- DDMode, MaxDDUSD, LockAtStart, MaxDDBufferUSD - overall drawdown rule (static or trailing).
- TargetUSD - profit target lock (0 = off).
- MaxOpenLots, MaxOpenPositions - exposure limits (0 = off).
- FridayCloseOn, FridayCloseHHMM - weekend protection (server time).
- Push, ShowPanel - notifications and panel.
- ResetLock - set to true once when starting a new challenge to clear a saved lock.
Usage: attach to any one chart (any symbol, any timeframe) and keep Algo Trading enabled so the EA can close positions. Set the limits slightly tighter than your firm's real limits. It works alongside any other EA or manual trading on the same account.
Thanks for reading. Discover premium MetaTrader solutions at RobotFX.
80254