In short: Netting keeps one position per symbol, hedging keeps every order separate. A grid EA needs a hedging account.

Hedging and netting are two ways MetaTrader 5 keeps your trades. On a netting account each symbol has one position, and every new deal merges into it. On a hedging account every order is its own position, and buys and sells can be open at once. A grid EA that tracks each order needs hedging.
"Hedging" here describes bookkeeping, not protection: a hedging account hedges nothing by itself. The numbers below are arithmetic of the settings, not a forecast.
On this page (9)
What is the difference between hedging and netting?
The difference between hedging and netting in MT5 is how open trades are kept: a netting account holds one position per symbol and every new deal merges into it, while a hedging account keeps every order as its own position, so buys and sells on one symbol can be open together.
MetaTrader 5 has two position accounting systems, and the account decides which one applies. MetaQuotes added hedging as the second system in build 1295, released on 1 April 2016 (release notes); the notes for build 1325 say the new system is similar to the one used in MetaTrader 4.
- Netting: only one position per symbol can exist at a time. A deal in the same direction adds to it. An opposite deal reduces it, closes it, or, if the opposite volume is larger, reverses it (MetaTrader 5 Help).
- Hedging: several positions on one symbol are allowed, opposite ones included. A new deal opens a separate position and leaves the others unchanged (same Help page).
| Netting | Hedging | |
|---|---|---|
| Positions per symbol | One | Several, opposite ones included |
| A deal in the same direction | Adds to the position | Opens a separate position |
| An opposite deal | Reduces, closes or reverses the position | Opens a separate position and leaves the others unchanged |
| A grid EA that tracks each order | Orders merge, so it cannot close one order on its own | Each order stays its own position |
| A lock (an opposite order of the same size) | Reduces the buys instead of sitting next to them | Sits next to the buys |
Think of a bank balance against a stack of receipts. A deposit and a withdrawal net to one number, and you can no longer point at the deposit. Receipts stay separate slips, and you can pull out any one of them.
The broker sets the mode for each account; it is not a terminal setting, and one terminal can hold both kinds (MetaQuotes article). MQL5 also has an exchange mode with one net position per symbol (MQL5 Reference), which for an EA behaves like netting.
Which MT5 account type does a grid EA need, and why?
A grid EA that tracks each order needs a hedging account, because netting merges all orders on a symbol into one position, so the EA cannot close one order at its own price or hold an opposite order beside the others.
A grid opens more orders at set steps when price moves against the first one, with each order carrying its own volume, price and exit. Netting breaks three things that bookkeeping relies on:
- One order, one position. The orders merge. The EA can shrink the total but cannot close "the third order" at the third order's price.
- Opposite orders side by side. A lock is an opposite order of the same size. On netting it reduces the buys instead of sitting next to them. See locking a position.
- Exits per position. Stop-loss and take-profit belong to the single position, and MT5 Help says a later order on it replaces the earlier levels.
Midas, an MT5 Expert Advisor that trades gold with a grid and an optional one-order lock, runs on hedging cent accounts. Its FAQ lists netting accounts as not supported, because the lock relies on opposite positions held at the same time; the open-account guide says what to choose.
Mini example: three buys
Take the first three orders of a doubling grid: 0.01 lot at 4170.00, 0.02 at 4168.05 and 0.04 at 4166.10 (start 0.01, ×2, $1.95 step, the Midas defaults in the grid calculator). Spread, swap and commission are left out. A cent account shows money in USC, 100 USC = $1, and the USC figures assume the usual cent contract, where 0.01 lot moves the balance by 1 USC per $1 of gold.
MT5 Help describes the price of a position built from several deals as their weighted average (Executing Trades). Here: (0.01 × 4170 + 0.02 × 4168.05 + 0.04 × 4166.10) ÷ 0.07 = 4167.2143, shown as 4167.21. For the netting column we measure the closed part from this average price; your broker's history shows the exact figures.
| With gold at 4166.10 | Hedging account | Netting account |
|---|---|---|
| Trade tab | 3 positions: 0.01 @ 4170.00, 0.02 @ 4168.05, 0.04 @ 4166.10 | 1 position: 0.07 @ 4167.21 |
| Floating result | −7.8 USC | −7.8 USC |
| Whole basket breaks even at | 4167.21 | 4167.21 |
| Close the 0.04 part with gold at 4167.00 | That position closes: +3.6 USC. Left: 0.03 lot, average 4168.70, floating −5.1 USC | The position shrinks by 0.04: −0.86 USC realized. Left: 0.03 lot @ 4167.21, floating −0.64 USC |
| Open a sell of 0.07 (a full lock) | A 4th position opens; −7.8 USC stays open and stops growing | The position closes; −7.8 USC is realized, nothing is left |
The totals match: −1.5 USC in the fourth row either way (+3.6 − 5.1 on hedging, −0.86 − 0.64 on netting). What differs is which part is realized and where the remainder sits. On hedging, the last order is in profit above 4166.10. On netting, selling that 0.04 realizes a profit only above 4167.21.
How do you check whether an MT5 account is hedging or netting? Three ways
You can check an MT5 account's type three ways: read the label in the terminal header and the Journal, run a two-order test on a demo of the same type, or run a short script that prints the margin mode.
Use the account you plan to fund; a demo account of the same broker can differ from the live one.
1. The label. MetaQuotes says the accounting type is shown in the terminal window header and in the Journal, as set out in the build 1295 notes linked above. Look for the word Hedge by the account number and server, and in the first Journal lines after login. The notes do not print the exact label, and a localized terminal may word it differently, so this is a quick look, not proof. If you see no label, do not assume netting or hedging; use test 3.
2. The two-order test, on a demo of the same type. Buy 0.01 lot of gold, then sell 0.01 lot. On hedging the Trade tab shows two open positions. On netting the sell closes the buy and the tab is empty. If the second order is refused, read the message in the Journal: code 10046 means opposite positions are disabled on that account. The test costs two spreads of play money.
3. The script. It only reads, it never trades. In MetaEditor (F4) choose File → New → Script, paste this, press F7, drag it from the Navigator onto any chart and read the Experts tab (Ctrl+T):
void OnStart()
{
ENUM_ACCOUNT_MARGIN_MODE mode = (ENUM_ACCOUNT_MARGIN_MODE)AccountInfoInteger(ACCOUNT_MARGIN_MODE);
Print("Account ", AccountInfoInteger(ACCOUNT_LOGIN), " on ", AccountInfoString(ACCOUNT_SERVER));
Print("Margin mode: ", EnumToString(mode), " (", (int)mode, ")");
Print("Opposite positions allowed: ", (bool)AccountInfoInteger(ACCOUNT_HEDGE_ALLOWED));
}
We compiled it in MetaEditor with 0 errors and 0 warnings on 8 October 2026 but have not run it on a broker account. A hedging account prints ACCOUNT_MARGIN_MODE_RETAIL_HEDGING; a netting one prints ACCOUNT_MARGIN_MODE_RETAIL_NETTING; an exchange one prints ACCOUNT_MARGIN_MODE_EXCHANGE (MQL5 Reference). Go by the name; the reference lists no numbers, so we do not quote them. The last line comes from a separate property, ACCOUNT_HEDGE_ALLOWED, described in the reference as allowed opposite positions on a single symbol; false means they are not allowed, whatever the mode. If MetaEditor does not know that constant, delete the line.
Can a netting account in MT5 be converted to hedging?
Whether a netting MT5 account can be switched to hedging is the broker's decision, so ask and do not assume. MT5 Help says the system "depends on the account and is set by the broker", so the terminal cannot change it. MetaQuotes' own advice is to contact the broker to open a hedging account. Get the answer in writing before you fund the account or bind a licence; a Midas plan is bound to one MT5 account, and support is the Telegram bot @MidasGridBot.
Rules differ by country. In the US, NFA Compliance Rule 2-43(b) says forex dealer members may not carry offsetting positions in a customer account and must offset them first-in, first-out (NFA Rulebook). Check that the broker accepts clients from your country and which account types it offers there.
Are cent and hedging the same thing?
No: in MT5 a hedging account and a cent account are separate properties. A cent account is about the size of the numbers: usually the same lot is priced about 100 times smaller and the balance is shown in USC. Hedging is about how positions are kept. In principle a broker can offer a cent account in either mode, so check both. Midas needs both; the cent account guide covers the first. A cent account makes numbers small, not risk.
What happens if a hedging-only EA runs on netting?
It depends on the code, and we cannot speak for every EA. Midas is documented as not supported on netting. In general there are three outcomes:
- The EA checks the margin mode at start and refuses to run. That is the good outcome.
- The EA runs, but the terminal holds one merged position while the EA still counts several orders. Its exits and its lock then act on the wrong thing, as in the table.
- The server refuses some requests. Return code 10046 means opposite positions on a symbol are disabled (MQL5 Reference).
The second outcome is the hardest to notice, because nothing looks broken. Check before the first run, not after the first basket. An EA that is attached but silent may have another cause; see automated trading is disabled in MT5.
What can go wrong
- Hedging mode, opposite positions off. The MQL5 reference lists
ACCOUNT_HEDGE_ALLOWEDas a property of its own, apart from the margin mode, and code 10046 for orders refused under that rule. So a hedging mode alone does not promise that a lock order will be accepted. - FIFO closing. Code 10045 means the account allows closing only by the first-in, first-out rule, so an EA that closes a chosen ticket out of order is refused.
- Hedged margin. For opposite positions the broker picks a margin method, and the covered volume may still need margin (MT5 Help). A lock may cost margin.
- False comfort. Hedging mode does not lower risk. On any account type, a martingale grid can hit a stop-out if the deposit is too small. Size your deposit with a safety margin.
This page explains an account setting. It is not a forecast and not individual investment advice. Martingale-style grid trading can lose part or all of the deposit; see Risk, plainly. Check that the broker accepts clients from your country.
Midas · published 8 October 2026 · updated 8 October 2026 · figures calculated on 8 October 2026. After the check, the install guide covers the first run of Midas.
FAQ
What does netting mean in MT5?
Netting means the account keeps one position per symbol. Two gold buys merge into one position at their weighted average price, and a later sell reduces, closes or reverses it instead of opening a second one. A buy and a sell cannot stay open together on the same symbol. The broker sets the mode for each account.
Is a hedging account in MT5 the same as a cent account?
No. Hedging describes how MT5 keeps positions, as separate ones that can be opposite on one symbol, and it is no protection against loss. A cent account describes the size of the numbers: usually the same lot is priced about 100 times smaller and the balance is shown in USC. A broker can in principle offer a cent account in either mode, so check both. Midas needs both.
Which MT5 account type does an expert advisor need?
It depends on the EA, so read its documentation. An EA that holds several orders or opposite positions on one symbol, such as a grid with a lock, needs hedging. One that keeps a single position per symbol may work on both. Midas needs a hedging cent account.
How do I check if my MT5 account is hedging or netting?
Look for the mode in the terminal header and the Journal, then confirm it with a short script that prints the margin mode by name. Or buy and sell 0.01 lot on a demo of the same type: two open positions mean hedging, an empty Trade tab means netting. Check the live account too.
Can my broker switch a netting MT5 account to hedging?
Only the broker decides, and the terminal cannot change it: MT5 Help says the accounting system depends on the account and is set by the broker. MetaQuotes advises contacting the broker to open a hedging account. Ask whether an existing netting account can be switched, get the answer in writing before you fund it or bind a licence, and check that the broker accepts clients from your country.
Why does my EA say it needs a hedging account?
Most likely the EA read the margin mode and found netting or exchange. Its logic relies on separate positions, so it stops or warns. The fix is on the account side: ask the broker whether the account can be changed, or open a hedging account, and check that the broker accepts clients from your country. Do not run the EA on netting to see what happens.