Yes, it's all right. Also, you can use a separate function like this:
int OnInit() { if (!IsHedging) { Print("This is not a hedging account. This EA can only be run on hedging accounts!"); return (INIT_FAILED); } return(INIT_SUCCEEDED); } //+------------------------------------------------------------------+ bool IsHedging() { ENUM_ACCOUNT_MARGIN_MODE margmod = (ENUM_ACCOUNT_MARGIN_MODE)AccountInfoInteger(ACCOUNT_MARGIN_MODE); return(margmod==ACCOUNT_MARGIN_MODE_RETAIL_HEDGING); } //+------------------------------------------------------------------+
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
Hello folks,
I want my EA to only run on hedging accounts. Is this the right way to check it?
Thank you very much in advance.
Greetings
Chris