Guarda come scaricare robot di trading gratuitamente
Ci trovi su Telegram!
Unisciti alla nostra fan page
Script interessante?
Pubblica il link!
lasciare che altri lo valutino
Ti è piaciuto lo script? Provalo nel Terminale MetaTrader 5
Sistemi Esperti

Equity Guard - daily loss, max drawdown and profit target lock - sistema esperto per MetaTrader 5

Muhammad Muqeem Korejo
Muhammad Muqeem Korejo
Hi, I'm Muhammad Muqeem Korejo, an MQL4/MQL5 developer from Pakistan with 1.5 years of trading experience.
I build and fix trading tools for MetaTrader 4 and MetaTrader 5:
• Expert Advisors (EAs) built from your strategy rules
• Custom indicators, alerts and on-chart panels
Visualizzazioni:
51
Valutazioni:
(1)
Pubblicato:
Freelance MQL5 Hai bisogno di un robot o indicatore basato su questo codice? Ordinalo su Freelance Vai a Freelance

Equity Guard is a risk-management Expert Advisor for MetaTrader 5. It does not open trades. It watches the account equity and acts when one of your limits is reached:

  • Daily loss limit: a percentage of the day-start base and/or a fixed amount in the account currency (the stricter one is used).
  • Maximum drawdown: a percentage from the initial balance (static) or from the highest equity (trailing).
  • Daily profit target (optional): locks in the profit of the day.

Equity Guard panel on a EURUSD H4 chart (demo account)

Equity Guard panel on a EURUSD H4 chart (demo account, Algo Trading off)

When a limit is hit, the EA closes the open positions, deletes the pending orders, sends an alert (and a push notification if enabled) and keeps closing any new trades until the next trading day (daily limits) or until you reset the saved state (maximum drawdown).

Features

  • Day-start base: balance, equity, or the higher of the two, as many prop firms use.
  • The new trading day starts at any server hour.
  • The state is kept in terminal global variables, so a terminal restart does not reset the day.
  • When the EA starts during the day, the day-start balance is rebuilt from the deals closed today.
  • Optional filters: one magic number, or the chart symbol only.
  • Panel: status, equity, today's result, remaining daily loss, distance to the drawdown floor and the next reset time.
  • The panel warns when Algo Trading is off, because the EA cannot close trades then.

How to use

Attach the EA to one chart of the account (any symbol, any timeframe) and turn on Algo Trading. Set the limits to match your rules and test on a demo account first.

Inputs

Input Default Meaning
Max daily loss, % of day-start base 4.0 0 = off
Max daily loss, account currency 0 0 = off
Max overall drawdown, % 8.0 0 = off
Drawdown measured From initial balance or from the highest equity (trailing)
Initial balance 0 0 = balance when the EA first starts
Daily profit target, % 0 0 = off
Daily loss measured from Higher of balance and equity or balance, or equity
New day starts at server hour 0 0-23
Close open positions / Delete pending orders true / true action when a limit is hit
Keep closing new trades until reset true keeps the account flat while locked
Only this magic number -1 -1 = all trades
Only the chart symbol false
Pop-up alert / Push notification true / false
Panel settings corner, offsets, font size, colours
Reset saved state on start false set to true once to clear a lock, then back to false

Notes

  • An EA can only act while the terminal is running and connected. For 24/5 protection, run it on a VPS.
  • Positions are closed at market and can slip in fast markets, so set the limits slightly tighter than your hard rule.
Smart Money Concept Expert Advisor - Market Strucutre, FVG, Pullback Smart Money Concept Expert Advisor - Market Strucutre, FVG, Pullback

This Expert Advisor trades fair value gaps in the direction of market structure, the way Smart Money Concepts describes it. It is the third step of a series that has been built one piece at a time: In previous shared codes, the SMC Pullback Indicator decided which highs and lows matter, the SMC Market Structure indicator turned those swings into a trend with BoS, CHoCH, IDM and liquidity sweeps, and this EA trades the result.

Trend Finder Scanner Trend Finder Scanner

A quick market scan to identify sustainable trends. The script analyses all symbols from the ‘Market Overview’ in a matter of seconds and identifies instruments with the clearest and strongest price movements using R² linear regression and the ADX indicator.

Telegram Trade Notifier - opens, closes, pending orders and daily summary Telegram Trade Notifier - opens, closes, pending orders and daily summary

Sends every opened and closed position, pending orders and a daily account summary to your Telegram chat. It never trades on your account.

Basket Break-Even Lines - buy, sell and net break-even with target price Basket Break-Even Lines - buy, sell and net break-even with target price

Several buys and sells open on one symbol? The indicator draws where all buys, all sells and the whole basket break even, and the price for a profit target. Planned entries can be added to see the break-even before you trade.