MT4 and MT5 software · tutorial

Equity Sentry EA: protect your MT4 and MT5 account from drawdowns

Equity Sentry EA by Algonexis Technologies is an Expert Advisor that watches your MetaTrader account and acts when a limit you set is reached. It closes your trades, deletes pending orders and switches off AutoTrading, so no Expert Advisor can open new trades. We call this “Close & Stop”.

This guide covers version 1.9.7: how the EA works, how to install it, real use cases and every input.

What it does

What Equity Sentry EA does

Equity Sentry EA is a risk-control add-on for MetaTrader 4 and MetaTrader 5. It doesn’t open trades. It monitors the account 24/7 and runs the safety actions you choose when a trigger fires.

  • Sets a hard stop for the whole account: an equity or balance level, or a % drop from the highest level.
  • Watches floating loss and profit in %, in deposit currency or in pips.
  • Stops after a set number of losing trades in a row.
  • Closes trades, deletes pending orders, disables AutoTrading, closes other charts or closes the terminal.
  • Sends a pop-up alert, an email and a push notification to the MetaTrader mobile app.
  • Runs “On Timer” actions once at a date and time you choose.

It works with manual trading, with other Expert Advisors and with copied trades. One copy of the EA on one chart protects the whole account.

How it works

How Equity Sentry EA works

How Equity Sentry EA works: trade filter, security triggers, actions
The trade filter picks the trades, a security trigger fires, and the EA runs your actions.

1. Trade filter

MagicNumber picks the trades the EA counts. The default, -1, means any magic number, including manual trades (magic number 0). SymbolScanningMode counts all symbols or only the symbol of the chart the EA runs on.

2. Security triggers

Triggers in group #1 look at the whole account: equity or balance below or above a level, or equity below the “Highest Balance Level” (HBL) or “Highest Equity Level” (HEL) by X%. The EA records the highest balance and equity for each account number and keeps them after a restart.

Triggers in group #2 look only at the trades that pass the trade filter: floating loss or profit in % of the balance, in money or in pips, and the number of consecutive losing trades. Each trigger is off when its value is 0.

Equity Sentry EA trailing drawdown: equity below Highest Equity Level by 5%
Example: with a 5% HEL trigger, the stop level follows each new equity high. At a 10,500 high, Close & Stop fires at 9,975.

3. Actions

When a trigger fires, the EA sends the alert, closes trades and/or deletes pending orders, and disables AutoTrading for all EAs. If you enable it, the EA first closes every other chart window, so the Expert Advisors on those charts are removed before any trade is closed. It can also close the terminal completely.

Each trigger fires once per start of the EA. If you set Disable Autotrading for All EAs to No, other EAs keep trading after the trades are closed. MetaTrader closes trades one at a time, so the final loss can be a little bigger or smaller than the level you set. Leave a safety margin.

Installation

Install and set up Equity Sentry EA on MT4 and MT5

Install and start Equity Sentry EA on MT4 or MT5
Six steps from download to a running EA. Test every new setting on a demo account first.
  1. Buy a plan on the Equity Sentry EA pricing page. You’ll get an email with access to your member’s area, where you download the software and find your license key.
  2. In MetaTrader, open File → Open Data Folder. Put the EA into MQL4\Experts (MT4) or MQL5\Experts (MT5), and its DLL library into the Libraries folder next to it.
  3. Restart the terminal. Equity Sentry appears under Navigator → Expert Advisors.
  4. Turn on AutoTrading in the toolbar (Algo Trading in MT5). The EA won’t start while it’s off.
  5. Drag the EA onto one chart. On the Common tab (MT4) tick Allow live trading and Allow DLL imports. In MT5, allow Algo Trading and allow DLL imports in the EA’s settings.
  6. On the Inputs tab, paste your key into LicenseKey, then set your triggers and actions. Click OK. The EA checks the license and shows a dashboard on the chart that lists your active triggers.

For email alerts, set up your mail server in Tools → Options → Email. For push alerts, enter your MetaQuotes ID in Tools → Options → Notifications; the EA won’t start with SendMobileNotifications on until notifications are enabled.

If a trigger is already met when you attach the EA and trades are open, it asks first. Click Yes to close the trades, or No to remove the EA and fix your settings.

Use cases

How traders use Equity Sentry EA

Prop firm maximum and daily drawdown

For a static maximum loss, set Equity drops below to your account’s floor, for example 90,000 on a 100,000 account with a 10% limit. For a trailing limit, use Equity drops below “Highest Equity Level” by X% or the HBL version, whichever matches your firm’s rule. Version 1.9.7 has no automatic daily reset, so for a daily loss limit set Equity drops below to today’s starting balance minus the daily limit, and update it before each session. Set every level slightly inside the firm’s limit.

Retail account protection

Pick the most you’re willing to lose, set it as an equity level or a % below HBL, and keep Disable Autotrading for All EAs on Yes. Add email or mobile alerts so you know what happened while you were away.

Stopping a misbehaving EA

Set MagicNumber to the EA’s magic number and use a group #2 trigger, such as a floating loss in money or Consecutive LOSS trade count reaches 5. Set CustomAccountHistoryStart to the day you started the EA, so older losses don’t count. Turn on Close other chart windows to remove the robot before its trades are closed.

Locking in a profit target

Use Equity reaches above, Balance reaches above or a floating profit trigger. When your target is reached, Equity Sentry closes everything and stops trading, so the profit isn’t given back.

News releases and weekends

Turn on the On Timer function and set a date and time, for example Friday 21:00 broker time or a few minutes before a major release. At that moment the EA closes trades and/or deletes orders, disables AutoTrading or closes the terminal, once.

Parameters

Equity Sentry EA parameter walkthrough

Inputs in the order they appear in version 1.9.7, with labels slightly shortened. A value of 0 switches a trigger off.

Trade filter

InputDefaultWhat it does
Magic Number-1Magic number of the trades to count. -1 means any.
Symbol scanning modeAll symbolsCount all symbols, or the current chart symbol only.

Security triggers #1 (whole account)

InputDefaultWhat it does
Use Trade Filter when closing tradesNoNo closes every trade on the account. Yes closes only filtered trades.
Equity drops below0Fires when equity falls below this amount.
Equity reaches above0Fires when equity rises above this amount.
Balance drops below0Fires when balance falls below this amount.
Balance reaches above0Fires when balance rises above this amount.
Equity below “Highest Balance Level” by X%0Trailing stop on the highest balance reached (max 99).
Equity below “Highest Equity Level” by X%0Trailing stop on the highest equity reached (max 99).

Security triggers #2 (filtered trades)

InputDefaultWhat it does
Use Trade Filter when closing tradesYesClose only the trades that pass the filter.
Floating LOSS reaches X%0Floating loss as % of the balance.
Floating LOSS reaches X money0Floating loss in deposit currency.
Floating LOSS reaches X pips0Sum of the floating pips of all filtered trades.
Floating PROFIT reaches X% / money / pips0The same three triggers for profit.
Consecutive LOSS trade count reaches0Losing trades in a row in the closed history.

Trigger actions

InputDefaultWhat it does
Send AlertYesUse the channels in the alert settings.
Close and Delete orders?Close Open Trades & Delete Pending OrdersOr close trades only, delete pending orders only, or leave everything open.
Disable Autotrading for All EAsYesClicks the AutoTrading button for you, which stops every EA, Equity Sentry included.
Close other chart windowsNoCloses every chart except Equity Sentry’s.
Close MT4 platform completelyNoShuts down the terminal.

On Timer, alerts and other settings

InputDefaultWhat it does
Enable “On Timer” function?NoRuns the timer actions once at the date and time below.
At date & time of2024.01.01 17:00Broker server time. Set a future time.
Close and Delete orders? / Disable Autotrading / Close other chart windows / Close MT4 platformDon’t close / NoTimer actions, same as above.
Play sound alert + popupYesPop-up alert in MetaTrader.
Send alerts by emailNoUses the terminal’s email settings.
Send alerts to MT4 Mobile appNoPush notifications via MetaQuotes ID.
Trailing Stop activates at X Pips0When a trade is X pips in profit, its stop loss follows the price X pips behind.
BreakEven activates at X Pips / BreakEven move X Pips in profit0 / 0At X pips of profit, move the stop loss to entry plus Y pips.
CustomPipSizesemptyYour own pip sizes, e.g. XAUUSD=0.1,US30=1.
IncludeCommissionsAndSwaptrueCount commission and swap in floating P/L.
DashboardDisplay / DashboardColor2 / blue0 shows only a “running” line; higher values show the full dashboard.
CustomAccountHistoryStart2010.01.01Closed trades before this date are ignored.
HideInputBoxesNoHides the profit-target boxes on the chart dashboard.

FAQ

Equity Sentry EA FAQ

Does Equity Sentry EA work on MT4 and MT5?

Yes. Equity Sentry EA by Algonexis Technologies runs on MetaTrader 4 and MetaTrader 5 on Windows, on your own PC or VPS.

Does Equity Sentry EA open trades?

No. It never opens trades. It only monitors the account, closes trades, deletes orders, disables AutoTrading and sends alerts.

Can it stop other Expert Advisors from opening new trades?

Yes. When a trigger fires, it can disable AutoTrading for all EAs and close every other chart, so no EA on the terminal can open new trades.

Can I use Equity Sentry EA on a prop firm account?

Yes. Use an equity level for a static maximum loss, the Highest Equity or Highest Balance Level % trigger for a trailing limit, and set levels slightly inside your firm’s limits.

Can it protect only one EA or one symbol?

Yes. Set MagicNumber to that EA’s magic number and/or set Symbol scanning mode to the current symbol, then use the group #2 triggers.

Does it need the computer to stay on?

Yes. It runs inside MetaTrader, so the terminal must be running and connected. A VPS keeps it running 24/7.

How many accounts can I protect?

The Personal plans cover unlimited real and demo accounts on 1 PC or VPS at a time. Run one copy of the EA in each terminal.

Where can I buy Equity Sentry EA?

At equitysentryea.com. Monthly and annual Personal plans are on the pricing page, with a 30-day money-back guarantee.

Get Equity Sentry EA

Download Equity Sentry EA, see the plans and read the full feature list at equitysentryea.com.