Daily Loss Floor Guard MT5
- Utilitaires
- Version: 1.0
- Activations: 10
Daily Loss Floor Guard watches the whole trading account and enforces the loss and profit rules you set. It does not open trades and does not contain a trading strategy.
Attach it to one chart. It monitors all symbols, all Expert Advisors and manual trades, including trades placed from the mobile app.
What it does when a rule is reached
- Closes open positions. For the daily loss limit you can instead choose to keep open positions and only block new trades.
- Deletes pending orders (optional).
- Keeps closing any new position and deleting any new pending order until the lock ends.
- Optionally closes all other charts, which stops other Expert Advisors in the same terminal.
- Sends a terminal alert, a push notification or an email, using the terminal's own notification settings.
Rules you can set
- Daily loss limit measured on equity, so floating results, swap and commission are included.
- Reference: the balance, the equity, or the higher of the two at the daily reset.
- Allowance: a percent of initial capital, a percent of the reference, or a fixed amount.
- Daily reset at any hour and minute in broker server time, a fixed UTC offset, Central European time or New York time. Daylight saving time is handled automatically for the last two.
- Maximum loss floor, static or trailing. A trailing floor can follow the highest day-start balance, the highest closed balance or the highest equity, and can stop at the initial capital.
- Account profit target lock and daily profit lock.
- Maximum open positions, maximum total lots, maximum lots per trade and maximum new trades per day. A trade over a limit is closed or reduced right after it opens.
- Optional Friday close at a set server time, with a block until the next weekday.
- Rule templates for common calculation methods. A template sets only the methods; you enter the numbers.
How locks end
- Daily loss, daily profit and Friday locks end at the next daily reset. They cannot be removed earlier.
- Maximum loss and profit target locks stay active until you unlock them with two clicks on the panel.
- Restarting the terminal or changing inputs does not clear a lock. Lock state, day-start values and trailing levels are saved in terminal global variables.
Reliability details
- Checks run every 250 ms (adjustable) and on every trade event, independent of chart ticks.
- An optional safety margin triggers the lock before the exact floor, which leaves room for slippage. A warning is sent when a set share of an allowance has been used.
- If the tool is attached during the day, it rebuilds the day-start balance from the account history. Deposits and withdrawals are not counted as trading results.
- Positions are closed by ticket with retries and filling mode detection. Pending orders inside the freeze level are retried later instead of being rejected repeatedly.
- Hedging and netting accounts are supported.
- The panel shows a clear warning when Algo Trading is switched off, the terminal is disconnected or the account does not allow expert trading, because no tool can close trades in that state.
- Only one copy guards an account at a time. A second copy stays in standby and takes over if the first one stops.
- The panel shows balance, equity, day-start reference, daily floor and remaining room, maximum loss floor, target progress, exposure, trades today and time to the next reset. It scales on high-resolution screens and can be placed in any chart corner.
- An optional consistency monitor shows the best day's share of total closed profit.
How to use
1. Enable Algo Trading in the terminal and Allow Algo Trading in the tool's settings.
2. Attach the tool to any one chart.
3. Enter the initial capital (or leave 0 to use the balance when first attached) and your limits.
4. Keep the terminal running. A VPS is recommended if you need protection while your computer is off.
Limitations
- Protection works only while the terminal is running and the tool is attached.
- Closing happens at market prices, so the final result can differ from the floor during fast markets or gaps. Use the safety margin to account for this.
- If another Expert Advisor keeps opening trades while the account is locked, each of those trades is closed again and costs the spread. Use the option to close other charts for such Expert Advisors.
- In the Strategy Tester the daily reset always uses server time and no alerts are sent.
- Check your account provider's current rules before setting limits.
Support is provided through the Comments section of this page and MQL5 private messages.
