Account Protection System
- Утилиты
-
Fadi Matti
My name is Fadi Matti, and I'm an independent developer with a strong interest in algorithmic trading and financial markets. Alongside developing trading systems, I'm currently studying Industrial Engineering, combining my technical and business interests. I'm passionate about building reliable - Версия: 1.0
Account Protection System is a risk management utility for MetaTrader 5 that watches your entire account and steps in before a bad day turns into a blown account.
It does not open any trades and does not interfere with your strategy. Attach it to one chart, set your limits, and it guards your account in the background, whether you trade manually or with other Expert Advisors.
What it does
Daily Loss Limit
- Set your maximum daily loss as a percentage or a fixed amount.
- Realized and floating profit/loss are both included (optional).
- Deposits and withdrawals do not distort the calculation.
- The trading day reset time is freely adjustable (server time).
Maximum Overall Drawdown
- Trailing mode based on peak equity, or static mode based on a fixed start balance.
- Works for prop-firm style rules as well as personal risk limits.
Automatic Protection
- Closes all open positions when a limit is reached.
- Deletes pending orders.
- Locks trading until the next trading day (daily limit) or until you unlock manually (drawdown limit).
- The lock survives terminal restarts and chart changes.
Protection Against Accidental Trading
- Any position or order opened during a lock is closed or deleted immediately.
- Unlocking requires a double confirmation. If the limit is still breached, the lock returns immediately.
- By default, limits can only be tightened in the panel, not loosened, so you cannot talk yourself out of your own rules.
Warnings
- Two warning levels (default 70% and 90% of the limit used).
- Warning for unusually high lot sizes: fixed maximum, multiple of your average lot size, or total open lots.
- Optional hard lot limit that closes oversized positions automatically.
- Warning when the stop-loss risk of your open trades exceeds your remaining daily risk.
- Popup, sound, and push notification alerts.
Interactive Dashboard
- Remaining daily risk in money and percent
- Color-coded progress bars for daily loss and drawdown
- Status badge: ACTIVE, WARNING, LOCKED
- Countdown to the next trading day
- Open positions, total lots, risk at SL, largest lot
- Clickable buttons: Close All, Lock Now / Unlock, Reset DD Base
- Editable limit fields directly in the panel
- Minimize/maximize button
Installation
- Attach the EA to one chart (any symbol, any timeframe).
- Enable Algo Trading in the terminal toolbar.
- Allow automated trading in the EA properties.
The dashboard shows a warning if Algo Trading is disabled, since the EA cannot close positions without it.
Key Settings
| Group | Parameters |
|---|---|
| Daily Loss Limit | Enable, mode (% / money), value, include floating P/L, reset hour |
| Overall Drawdown | Enable, mode (% / money), value, reference (peak equity / start balance), fixed base |
| Protection Actions | Close all on limit, delete pendings, allow manual unlock, allow loosening limits |
| Warnings | Warning levels, max lot, average-lot factor, max total lots, hard max lot |
| Alerts | Popup, sound, push |
| Dashboard | Show/hide, X/Y position |
Important Notes
- This is a risk management tool, not a trading strategy. It does not generate profits and cannot guarantee that losses stay below your limits.
- In fast markets, with gaps or slippage, the actual loss can exceed the configured limit. Leave a safety margin.
- The EA works account-wide and manages all positions and pending orders on the account, not only those of one symbol or Magic Number.
- Closing positions requires an active connection to the broker and an open market.
- Keep only one instance running per account.
Who is it for?
- Discretionary traders who want protection from tilt and revenge trading
- Prop firm challenge traders with daily loss and max drawdown rules
- Traders running multiple EAs who want one central safety net
