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.
- Subscription to FX signal
- MT5 Hedge/Netting
- How to use PositionGetDouble(POSITION_VOLUME) correctly?
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.
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register