Netting account or hedging account?

To add comments, please log in or register
Lumy
142
Lumy  
Hello everyone, 

Sorry to bother with such a simple question but how can I check inside the mt5 platform if an account is netting or hedging, regardless if it's a real account or a demo account? 

Thank you very much for your help. 
Jose Francisco Casado Fernandez
5159
Jose Francisco Casado Fernandez  

When you connect to a broker server, it will show you a message in Journal, as you can see in the picture below:





Regards.

Jose Francisco Casado Fernandez
5159
Jose Francisco Casado Fernandez  

You can use this simple script when you want, as well.  It will print a message in Experts Tab.


//+------------------------------------------------------------------+
//|                                                  Margin Mode.mq5 |
//|                               Copyright ©2016, Robertomar Trader |
//|                            https://robertomartrader.blogspot.com |
//|                                       robertomartrader@gmail.com |
//+------------------------------------------------------------------+
#property copyright "Copyright ©2016, Robertomar Trader"
#property link      "https://robertomartrader.blogspot.com"
#property version   "1.00"
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
  {
//---
    ENUM_ACCOUNT_MARGIN_MODE margin_mode;
    string hedge = IsHedging(margin_mode) ? "allowed" : "not allowed";
    
    PrintFormat("Margin Mode: %s.  Hedging %s", EnumToString(margin_mode), hedge);
   
  }
  
//+------------------------------------------------------------------+

bool IsHedging(ENUM_ACCOUNT_MARGIN_MODE &margmod) 
{ 
  
  margmod = (ENUM_ACCOUNT_MARGIN_MODE)AccountInfoInteger(ACCOUNT_MARGIN_MODE);
  return(margmod==ACCOUNT_MARGIN_MODE_RETAIL_HEDGING); 

}

//+------------------------------------------------------------------+



Regards.

To add comments, please log in or register