Setting position mode to hedging or netting

 
Is it possible to set the Position mode either in "Hedging" or "Netting" by code statements in Expert System (or fixing it in the setting of options for MT5 )  or it is something that is defined by the  Provider only (es. MetaQuotes-Demo)?  It results that presently I have an edging account but I would like to have a netting one with only one position that is updated based on orders/deals done. It is for  dem and debugging code purpose.
 
Marco Capacci: Is it possible to set the Position mode either in "Hedging" or "Netting" by code statements in Expert System (or fixing it in the setting of options for MT5 )  or it is something that is defined by the  Provider only (es. MetaQuotes-Demo)?  It results that presently I have an hedging account but I would like to have a netting one with only one position that is updated based on orders/deals done. It is for  dem and debugging code purpose.

No. It is set at the account level by the broker when you open the account.

So, if you want a "netting" account, select that option when you create/open the account the first time.

 
Fernando Carreiro #:

No. It is set at the account level by the broker when you open the account.

So, if you want a "netting" account, select that option when you create/open the account the first time.

thank you Fernando for the clarification; the fact was that I reinstalled recently MetaTrader after reinstalling Windows and it automatically Opened me a Demo account on the  MetaQuotes-Demo and selected the edging/netting option on edging: now I see.

So in case of an hedging account if we want to mantain  one single position and modifying it in successive trades the only possibility is to set, at each Order, the property 

Struttura Trade Request

MqlTradeRequest.position =to the first value to which a position has been opened (first position ticket) ?.

 
Marco Capacci #: thank you Fernando for the clarification; the fact was that I reinstalled recently MetaTrader after reinstalling Windows and it automatically Opened me a Demo account on the  MetaQuotes-Demo and selected the edging/netting option on edging: now I see. So in case of an hedging account if we want to mantain  one single position and modifying it in successive trades the only possibility is to set, at each Order, the property Struttura Trade Request MqlTradeRequest.position =to the first value to which a position has been opened (first position ticket) ?.

It's "Hedging" not "Edging". I even corrected your original text for you.

On a "Hedging" account it's not possible to "modify it". Only the stop-loss and take profit can be modified. You can't add volume to it or have the opening price adjust accordingly in the way it works on a "netting" account.

Just create a new demo account and select "not hedging".


Reason: