Discussion of article "MetaTrader 5 features hedging position accounting system" - page 5

 
Such a question: is there a property that allows to programmatically determine the type of account (netting or hedge)? After all, if we write a hedge Expert Advisor, we need to prohibit its work immediately when loading it on a netting account. The ACCOUNT_MARGIN_MODE property has appeared, but it is still unclear which one to use to find out the account type.
 
Ihor Herasko:
Such a question: is there a property that allows to programmatically determine the type of account (netting or hedge)? After all, if we write a hedge Expert Advisor, we need to prohibit its work immediately when loading it on a netting account. The ACCOUNT_MARGIN_MODE property has appeared, but it is still unclear which one to use to find out the account type.

ACCOUNT_MARGIN_MODE_RETAIL_HEDGING

https://www.mql5.com/ru/forum/23/page18#comment_2379483

Список изменений в билдах MetaTrader 5 Client Terminal
Список изменений в билдах MetaTrader 5 Client Terminal
  • www.mql5.com
Автоматическое обновление доступно через систему LiveUpdate:. - Страница 18 - Категория: общее обсуждение
 
Alexey:

ACCOUNT_MARGIN_MODE_RETAIL_HEDGING

https://www.mql5.com/ru/forum/23/page18#comment_2379483

I apologise. I didn't realise at once that this is a value. For some reason I thought it was an identifier to be passed to AccountInfoInteger, and the function will return the margin size. It is a bit confusing in the help:"allows you to get the margin calculation mode". As a result, the continuation"and accounting of positions on the account" is no longer readable.
 

any idea When it will be delivered for production ?

does it require some change in the broker ?

 
Diogo Seca:
There's something I must not be grasping here. I don't see any overall benefit when it comes to hedging this way.
I mean, as I see it, the reason MQL5 never allowed hedging like this in the first place was because hedging a position by opening an opposite position is the same thing as simply closing the first one.

Why would a user prefer the "hedging system" to the "netting system"?

The only reason I could see for this implementation is more compatibility with brokers, somehow. Any insights here?

yes, the definition of hedging is exactly that one... but this does not mean that you are going to use it that way

there are many strategies you may set up via hedging

and I think this is the reason why many people will never be so willing to switch

 

All these lines cause an error:

ENUM_ACCOUNT_INFO_INTEGER account_type=(ENUM_ACCOUNT_INFO_INTEGER)AccountInfoInteger(ACCOUNT_MARGIN_MODE);
Print(AccountInfoString(ACCOUNT_MARGIN_MODE));
Print(AccountInfoInteger(ACCOUNT_MARGIN_MODE));

ACCOUNT_MARGIN_MODE is not highlighted in blue in the editor. Am I doing something wrong? Or do I have an old build MT5? (Version 5 build 1241 dated 22 dec 2015.) Then how can I forcibly update to the new one?

 
Alain Verleyen:
Most MT4 traders are highly tied to the "hedging system", that's the only reason. (Just my own opinion).
I see one great advantage when trading different time frames. On the netting system it was necessary to keep virtual positions on each time frame, virtual stop loss and take profit orders, etc. That was a lot of work. I could be long on EURUSD on H1, short on H8 and long on D1 all with different stop loss levels and there was no easy way to handle that with the netting system. With the possibility of closing different positions on the same currency that problem is solved and trading on the way I described on the same currency is a lot easier.
[Deleted]  
Oksana Berenko:

All these lines cause an error:

ACCOUNT_MARGIN_MODE is not highlighted in blue in the editor. Am I doing something wrong? Or do I have an old build MT5? (Version 5 build 1241 dated 22 dec 2015.) Then how can I forcibly update to a new one?

The old one. You can download the new one from MetaQuotes-Demo server. The current version, as far as I know, is already 1301 (beta). You can read about updates here.

https://www.mql5.com/ru/forum/23/page18 

Список изменений в билдах MetaTrader 5 Client Terminal
Список изменений в билдах MetaTrader 5 Client Terminal
  • www.mql5.com
Автоматическое обновление доступно через систему LiveUpdate:. - Страница 18 - Категория: общее обсуждение
 
Rodrigo Silva Cosme:
I see one great advantage when trading different time frames. On the netting system it was necessary to keep virtual positions on each time frame, virtual stop loss and take profit orders, etc. That was a lot of work. I could be long on EURUSD on H1, short on H8 and long on D1 all with different stop loss levels and there was no easy way to handle that with the netting system. With the possibility of closing different positions on the same currency that problem is solved and trading on the way I described on the same currency is a lot easier.
Of course, that's a lot easier.
 
Oksana Berenko:

All these lines cause an error:

ACCOUNT_MARGIN_MODE is not highlighted in blue in the editor. Am I doing something wrong?

ENUM_ACCOUNT_INFO_INTEGER account_type=(ENUM_ACCOUNT_INFO_INTEGER)AccountInfoInteger(ACCOUNT_MARGIN_MODE);

Wrong type-receiver, you need:

ENUM_ACCOUNT_MARGIN_MODE mode = (ENUM_ACCOUNT_MARGIN_MODE)AccountInfoInteger(ACCOUNT_MARGIN_MODE);

Learn programming.

Or do I have an old build MT5? (Version 5 build 1241 dated 22 dec 2015.) Then how do I force an update to the new one?

Your build is also outdated. It does not have the requested modifiers yet. You need to update your MetaTrader 5 by connecting to the MetaQuotes-Demo server.