I dont know if the issue has alrady been dealt with, however I have a problem with the following function calls
SymbolInfoDouble(sybl,SYMBOL_VOLUME_MAX);
SymbolInfoDouble(sybl,SYMBOL_VOLUME_LIMIT);
in an EA in a real account.
In practice, the functions return zero in the real account, but in the demo MetaTrader work properly.
Where am I wrong?
You can try this, Volume Limit is specified by a particular value, such as :
Vol_Max = 5;
Vol_Limit = 25;
Not
Vol_Max = SymbolInfoDouble(sybl,SYMBOL_VOLUME_MAX);;
Vol_Limit = SymbolInfoDouble(sybl,SYMBOL_VOLUME_LIMIT);
You can try this, Volume Limit is specified by a particular value, such as :
Vol_Max = 5;
Vol_Limit = 25;
Not
Vol_Max = SymbolInfoDouble(sybl,SYMBOL_VOLUME_MAX);;
Vol_Limit = SymbolInfoDouble(sybl,SYMBOL_VOLUME_LIMIT);
Thank you for your answer. I do already like you suggest.
My question was, what is wrong in the function call? If there is something wrong?
There is some reason we cant use this function call in real accounts?
Thank you for your answer. I do already like you suggest.
My question was, what is wrong in the function call? If there is something wrong?
There is some reason we cant use this function call in real accounts?
I think brokerage not specify a particular value for Vol_Limit while Vol_Max commonly specified.
May be there is a better answer from another forum's member or moderator.
Hi all,
i was hoping that this issue will not be present on real accounts.
This happens as broker didn't define a value.
I have seen on 3 different demo accounts different values not being defined.
So, this problem demands that in OnInit() you check all values you are going to use against not being defined.

- www.mql5.com
Hi all,
i was hoping that this issue will not be present on real accounts.
This happens as broker didn't define a value.
I have seen on 3 different demo accounts different values not being defined.
So, this problem demands that in OnInit() you check all values you are going to use against not being defined.
I solved the problem as you suggested.
Now my EA <edited> has been updated to work properly on any account.
Thank you.
You may not promote your product in forum, you will get a warning by moderator.
Edited. Thank you.
Serio:
It is as you say, problem is that there are many brokers that do not define these values.
I solved the problem as you suggested.
Now my EA <edited> has been updated to work properly on any account.
Thank you.
Serio, perhaps you'd like to show the mql5 code, how you solve this. After all you create this topic.
Serio, perhaps you'd like to show the mql5 code, how you solve this. After all you create this topic.
double position_max = SymbolInfoDouble(sym, SYMBOL_VOLUME_LIMIT); position_max = position_max == 0.0 ? SymbolInfoDouble(sym, SYMBOL_VOLUME_MAX) : position_max;
Edited. Thank you.
Serio, perhaps you'd like to show the mql5 code, how you solve this. After all you create this topic.
First I would like to apologize for posting the link. I'll never make this mistake.
Coming back to the issue at hand, as I said I followed the suggestions by achidayat and graziani.
My solution is:
... double Max_Lot, Tot_Max_Lot; ... if (SymbolInfoDouble(sybl,SYMBOL_VOLUME_MAX) > 0) Max_Lot = SymbolInfoDouble(sybl,SYMBOL_VOLUME_MAX); else Max_Lot = 5; if (SymbolInfoDouble(sybl,SYMBOL_VOLUME_LIMIT) > 0) Tot_Max_Lot = SymbolInfoDouble(sybl,SYMBOL_VOLUME_LIMIT); else Tot_Max_Lot = 15;
The limits of 5 and 15 are those of the championship.
Thanks again to all and forgive me again.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
SymbolInfoDouble(sybl,SYMBOL_VOLUME_MAX);
SymbolInfoDouble(sybl,SYMBOL_VOLUME_LIMIT);
in an EA in a real account.
In practice, the functions return zero in the real account, but in the demo MetaTrader work properly.
Where am I wrong?