Software

A risk manager advisor for MT4: calculation and limit utilities

A risk manager advisor for mt4 closes two gaps the terminal leaves to the trader: converting the risk percentage into lots and stopping trading after the daily limit of losses. Both tasks are solved by code that lives inside the terminal and works while the terminal is open. We take apart which programs of this class exist, what exactly they do with your account and which checks are mandatory before someone else's code gets access to your orders.

Programs inside MetaTrader are an add-on: they do not replace the terminal but add to it what it does not have. Size calculation for a percentage, an automatic stop together with the entry, a hard ceiling on the loss for the day and a ban on trading after a streak of stops.

Tool classadd-on
Where it runsMT4 and MT5 on a PC
Access modelthe store and your own files
Main taskautomating the rules

Four types of program inside the terminal

Four different entities live in MetaTrader, and confusing them is expensive: they have different rights and different behaviour on a restart. A loss limiter written as a script will not protect the account — a script runs once and exits.

01A script

Runs once on launch and finishes. Suitable for one-off actions: placing stops on all open positions, closing everything at market, moving stops to break-even.

a one-off action
02An indicator panel

Draws an interface on the chart and computes values, but may have no trading rights. It shows the size for your percentage and the price of the stop in money, while you send the order yourself.

calculation and prompting
03An assistant advisor

Runs constantly on the chart and can send orders. It opens a position with the calculated size, immediately places the stop and the take and runs a trailing stop by a set rule.

execution on command
04A limiter advisor

It opens nothing, it only forbids. It watches the equity and the number of trades, closes positions and blocks trading when the daily loss limit is reached.

prohibition and protection

The first three save time and reduce the chance of an arithmetic error. The fourth type saves the account: it is the only one that intervenes at the moment when the trader is no longer reasoning soberly.

Trade Assistant MT4 and size calculation panels

Utilities of the trade assistant mt4 class are all built the same way: a panel on the chart, a field for the risk percentage, a field for the stop level and a button to send the order. The value is not in the button but in the fact that the size is recalculated at every shift of the stop — and people stop doing it by hand.

Panel fieldWhat the trader setsWhat the program calculates
Riska percentage of funds or an amountthe risk in the account currency
Stop-lossthe price of the level or the distancethe distance in pips
Sizenothinglots for the risk and the stop, rounded down
Take-profita price or a multiple of the riskthe target at the set ratio
Marginnothingthe collateral for the calculated size
Spreadnothinga correction to the actual entry price

Such a panel has to be checked once and on a demo: open a trade with the minimum size, wait for the stop to trigger and compare the actual loss with the declared risk. A discrepancy of more than a tenth of a percent means the program counts from the balance instead of equity or does not account for the spread.

Risk manager ea mt5: a loss limiter advisor

A limiter is the most useful and the most underrated program of the class. It does not improve the entry and does not increase the profit: it turns a soft rule into a hard one, taking the decision away from the trader at the moment when they are in no state to decide.

trading stops: equity ≤ equity at the start of the day × (1 − the limit)

RestrictionHow it is setWhat it does when it fires
The daily loss limita percentage or an amountcloses the positions, cancels the pending orders, blocks new ones
A loss limit for the weeka percentage of Monday's equitythe same over several days
A streak of stops in a rowa number of tradesa pause until the end of the day
A maximum number of tradesper daya ban on opening beyond the limit
A maximum total sizelotsdoes not let the position be built up
A ban on trading by timehours and newsblocking in the set intervals

A practical nuance: the limit has to be counted from equity rather than from the balance, and the reference point has to be fixed at the start of the day. Otherwise, after a losing streak the limit is recalculated from the shrunken account and allows you to lose again and again — a little less in money each time, but just as much in percent.

What to check before installing someone else's advisor

Any expert advisor is someone else's code with access to your orders. The five checks below take one evening and separate a useful utility from a nuisance.

01Run it on a demo

The same broker, the same account type, the same symbols. A demo differs from a live account in execution, but it shows the program's logic in full.

the first evening
02Check the arithmetic by hand

Open a trade and compare the calculated volume with the formula. A match down to the volume step is the only proof that the program counts correctly.

the first evening
03Check the behaviour on a restart

Close and reopen the terminal: the limiter has to remember the day's reference point instead of starting the limit over.

compulsory
04Look at what a lost connection does

The program works only while the terminal is running. If the protection has to be permanent, the terminal is kept on a server rather than on a home computer.

before going live
05Restrict the permissions

Algorithmic trading is enabled selectively, and the trading password to the account is never handed to anyone.

continuously

Why advisors are dangerous

Complaints about programs of this class almost always come down to four situations. None of them has anything to do with an error in the volume formula.

riskyMartingale disguised as a risk managerSome off-the-shelf advisors increase volume after a loss and look beautiful on history. Such logic does not manage risk — it postpones its arrival until one large trade.
riskyAccess to the trading passwordTo do its job the program only needs to be running in your terminal. The password that allows trading from the outside is not needed by any utility.
attentionWorks only while the terminal is switched onA switched-off computer removes the protection: the limiter will not close positions or stop trading until the platform is running again.
attentionDifferent specifications at different brokersA program tuned for five-digit quotes and a standard lot may count the pip differently at another broker. A check on a demo is mandatory every time you change accounts.

Advisors and utilities: short answers

Do you need an advisor if you calculate the volume yourself
Not necessarily. A utility saves seconds and removes input errors, but it runs the same formula. A loss limiter is more useful: it does what a person in drawdown does badly.
Where to get these programs
The terminal's built-in market, the developer's own site, or your own code. Market products usually come with a demo version for the tester.
Do advisors work in the mobile terminal
No. Mobile versions of MetaTrader do not execute program code: utilities and limiters live only on a computer or a server.
Can you write such programs yourself
Yes, the MQL language was made for it. A daily limit guard is a typical first program: a few dozen lines and straightforward logic.
Can an advisor be checked in the strategy tester
The entry and management logic — yes. The limiter's behaviour at the boundary of the day and on a terminal restart is not reproduced by the tester.
What to do when the volume does not match
Compare three things: the calculation base, the pip value and the rounding rule. The error is almost always in one of those three places.

Frequently asked questions

How an expert advisor differs from a script in MetaTrader

A script runs once and finishes, an advisor works continuously as long as it is on the chart and the terminal is running. A loss limiter is possible only as an advisor: it has to watch the account without a break.

How a limiter advisor counts the daily limit

It remembers equity at the start of the trading day and compares the current value with it. When the drop reaches the set percentage, positions are closed, pending orders are removed and new trades are blocked until the next day.

Why the limit is counted from equity and not from the balance

The balance does not see floating loss: an open position in the red will not change it until it is closed. A limiter tied to the balance fires too late.

Is it safe to buy an advisor in the terminal's market

Buying is safer than downloading a file from the side: the product is tied to the account and comes with a demo version for the tester. But the code stays closed, so checking the behaviour on a demo is still needed.

Can a lot-size utility be wrong

It can, and there are three typical reasons: counting from the balance instead of equity, a wrong pip value on cross pairs, and rounding up. Each of them gives more risk than was planned.

Do you need a VPS for a limiter advisor

If the protection has to work at all times — yes. The utility does nothing while the terminal is off, and that is exactly when an open position goes against you.

Does a trailing stop in an advisor replace manual management

It makes management mechanical and identical every time, which is usually better than doing it by hand. But the rule for moving the stop is set by you, and a bad rule is executed by the advisor just as precisely as a good one.

Can several advisors be placed on one chart

On one chart — no, MetaTrader runs one advisor per window. A limiter is usually attached to a separate chart, because it is not tied to a specific symbol.

How to tell that an advisor increases volume after a loss

Check it in the tester: if after a losing trade the next volume is larger than the previous one at the same distance to the stop, it is a martingale, whatever the description calls it.

What to do if the advisor has stopped opening trades

Check that algorithmic trading is allowed, that the licence is still valid, that the symbol matches, and whether the program's own limit has fired. After firing, a limiter stays silent on purpose.

Is it worth trusting an advisor with the choice of an entry

That is no longer risk management but a trading system, and it has to be judged by statistics over the distance rather than by its description. Such an advisor has nothing to do with managing risk.

How many programs make sense at the same time

Usually two: a volume calculation panel and a loss limiter. Every further one adds a point of failure and reduces your understanding of what is happening to the account.

ARMF logo
The ARMF editorial teamWe take apart forex risk management where it is actually calculated: the size in lots from the stop distance and the pip value, the required margin, the price of a drawdown and the break-even win rate. We give the formulas in full so that the calculation can be repeated in your own spreadsheet.Who writes and how we check the dataData checked: 04.09.2026