You should know that there are two types of MetaTrader 5 trading accounts: netting and hedge
Act | Netting | Hedge |
---|---|---|
BUY 1.0 | BUY 1.0 | BUY 1.0 |
SELL 1.0 | sell 1.0 position will close buy 1.0 position -> Result: zero positions | Result: two positions - buy 1.0 and sell 1.0 |
Many thanks for your answer. This explains that :)
It is sad it not mentioned in the position properties documentation section.
Is there any way to know in advance if an account is a neeting or hedging one? (Like without doing the little test I shared). I tried to look in MT5
options but couldn't find it.
Many thanks for your answer. This explains that :)
It is sad it not mentioned in the position properties documentation section.
Is there any way to know in advance if an account is a neeting or hedging one? (Like without doing the little test I shared). I tried to look
in MT5 options but couldn't find it.

- www.metatrader5.com
It's also important to understand why this is. No matter what, if you ever use one strategy to open offsetting orders then your strategy is fundamentally flawed. I never understood people who did this because it is literally the same thing as opening a position and then instantly closing it. The broker loves it when you do that because you just gave them risk free money and then they get to **** you again if you hold it thru the swap time. It's downright foolish, and the reason the CFTC banned "hedging" for retail accounts was to protect immature traders from themselves. The only argument for having a hedging account is if you're running several different concurrent strategies and you're ok paying more swaps/commissions/spreads for the convenience of doing it from a single account.
In summation, if the question is ever along the lines of, "how my EA open offsetting orders?" Then the answer is always, NO, STOPIT!
Many thanks for your answer. This explains that :)
It is sad it not mentioned in the position properties documentation section.
Is there any way to know in advance if an account is a neeting or hedging one? (Like without doing the little test I shared). I tried to look
in MT5 options but couldn't find it.
I don't know whether you can use MQL5 to find this information programmatically. But you can see it in the MetaTrader window title bar: this often states your account number, broker name, account type and whether it is a hedging/netting account. Otherwise you would need to log in at your broker and check your account information there.
The OP is sending 2 orders in the same direction, there is no problem with that, but of course you need a netting account if you want it to result in 1 position. On a hedging account it will be 2 positions.
Oh... I didn't parse OP's code... Whoops.
OP, you need to open a 2 lot position then set 2 separate 1 lot Stop orders and 2 separate 1 lot limit orders. It's the exact same strategy with better implantation because you won't risk the extra slippage waiting for the first market order to confirm. The original way only benefits if you need to send in the TP and SL on a pending order.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Dear all,
From MQL5 documentation about position properties, I can read this: For each financial security(symbol), only one open position is possible.
I have written the following code :
and I get the following results :
Does this mean that, there can be more than one position opened for one symbol (even though the documentation says the opposite)? Or is there antyhing I don't get?
Thank you very much.