Daily Loss Limit Lock MT5
- Utilità
- Versione: 1.0
Set a maximum daily loss for your whole MT5 account. When it is reached, the EA closes all positions, deletes pending orders and keeps trading locked until the next day. Free, one chart, works with manual trades and with any Expert Advisor.
Most big losses do not come from one bad trade. They come from what happens after it: revenge trades, bigger lots, "one more try". Daily Loss Limit Lock takes that decision out of your hands. You choose your limit when you are calm, and the EA applies it when you are not.
HOW IT WORKS
- You attach the EA to any one chart and set your daily loss limit, in money (for example 300 USD) or in percent (for example 5%).
- Every second, it calculates your result for the day: all trades closed today (swap and commission included) plus the floating profit or loss of open positions, on all symbols. Deposits and withdrawals are ignored.
- When the loss reaches the warning level (for example 80% of the limit), you get one alert.
- When the loss reaches the limit, all positions are closed, pending orders are deleted and the account is LOCKED.
- While locked, any new trade (manual, from the mobile app or from another EA) is closed right away.
- At the reset time (server time, 00:00 by default) a new day starts and the lock is removed.
FEATURES
- Daily loss limit in account currency or in % of the start-of-day balance, equity, or the higher of the two
- Early warning at the % of the limit you choose (0 = off)
- Optional daily profit target: lock the day after a good result, so you do not give it back
- Close all positions and delete pending orders when a limit is hit (each can be turned off)
- Close new trades opened while locked
- Pop-up alert and optional push notification to the MetaTrader 5 mobile app
- On-chart panel with status, today's P/L, the limit and how much you can still lose, in any chart corner
- The day start and the lock are saved, so they survive a terminal restart
THE PANEL ON THE CHART
- Status: ACTIVE - trading is allowed. "Can still lose" shows how much is left before the limit.
- Status: LOCKED - a limit was hit today. "Reason" shows if it was the loss limit or the profit target. Trading is closed until the reset time.
- Today P/L - closed trades of today plus open positions. After a lock, it can be a little lower than the limit because of spread, slippage and commission while closing.
WHO IT IS FOR
- Prop firm traders who must respect a daily loss rule
- Manual traders who want protection against revenge trading and overtrading
- Traders who run several Expert Advisors and want one safety limit for the whole account
SETUP
- Drag Daily Loss Limit Lock MT5 onto any one chart (any symbol, any timeframe).
- In the Common tab, tick "Allow Algo Trading". Make sure the Algo Trading button on the toolbar is on, otherwise the EA cannot close trades.
- In the Inputs tab, set your limit and press OK. The panel appears on the chart.
INPUTS
- Limit type: money (account currency) or percent of the start-of-day value
- Daily loss limit: the amount or the %
- Start-of-day value used for %: balance, equity, or the higher of the two at the start of the day
- Warning at % of the limit: one alert at this level (0 = off)
- Target type / Daily profit target: optional, 0 = off
- Close all positions when a limit is hit
- Delete pending orders when a limit is hit
- Close new trades opened while locked
- New trading day starts at: server time, HH:MM (00:00 by default)
- Pop-up alert / Push notification to the MT5 mobile app
- Show panel on chart / Panel corner / Panel X and Y offset
NOTES
- One chart is enough for the whole account. Attach it only once.
- The EA works only while MetaTrader 5 is running and connected. For full protection, run it on a VPS.
- If you change the settings while locked, the EA checks the day again with the new settings: the lock stays only if the result still breaks a limit.
- Push notifications need your MetaQuotes ID in Tools > Options > Notifications.
- The EA does not open trades. It only closes positions and deletes pending orders when a limit is hit.
Questions or suggestions? Send me a private message on MQL5. If the EA helps you, a short review is very much appreciated.
