
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
Thank you.
'SYMBOL_VOLUME_LIMIT' - undeclared identifier.............
'SymbolInfoDouble' - none of the overloads can be applied to the function call.............
Is it just me?
'SYMBOL_VOLUME_LIMIT' - undeclared identifier.............
'SymbolInfoDouble' - none of the overloads can be applied to the function call.............
Is it just me?
Can you do that?
One more question about the SeriesInfoInteger() function.
When creating the topic"AccountInfo... Information relevance", I learnt that there are functions that use data "cached in the software environment" and there are functions that always have "direct access to actual data".
Which category of functions does the SeriesInfoInteger() function belong to ?
The following code is used in the CheckVolumeValue function:
int ratio=(int)MathRound(volume/volume_step);
if(MathAbs(ratio*volume_step-volume)>0.0000001)
{
description=StringFormat("Объем не является кратным минимальной градации SYMBOL_VOLUME_STEP=%.2f, ближайший корректный объем %.2f",
volume_step,ratio*volume_step);
return(false);
}
But it is more correct:
int ratio = (int)MathRound((volume-min_volume)/volume_step);
if (MathAbs(ratio*volume_step+min_volume-volume)>0.0000001)
{
description=StringFormat("Объем не является кратным минимальной градации SYMBOL_VOLUME_STEP=%.2f, ближайший корректный объем %.2f",
volume_step,ratio*volume_step+min_volume);
return(false);
}
Because the minimum step of volume change must be counted from the minimum value.
And perhaps the code snippet
//--- вычислим значение маржи
bool check=OrderCalcMargin(type,Symbol(),lots,last_tick.ask,margin);
should be replaced with:
//--- вычислим значение маржи
double price = (type == ORDER_TYPE_BUY || type == ORDER_TYPE_BUY_LIMIT || type == ORDER_TYPE_BUY_STOP || type == ORDER_TYPE_BUY_STOP_LIMIT) ? last_tick.ask : last_tick.bid;
bool check=OrderCalcMargin(type,Symbol(),lots,price,margin);
Due to changes in MQL5, now the maximal overall volume allowed for one symbol can be obtained as following:
Do not use the old variant! It was like this:
The article has been corrected and the new Check_Order_And_Volume_Limits.mq5 expert code has been attached to it.Dear Admin
I try to use this function but it will return 0 in all cases.
My MT5 build is 2280
double orders_volume_on_symbol=PendingsVolume(symbol);
gives error, no such function
And after I modify function to not include pending orders, it gives 0
It is because max_volume is 0 and opened_volume is 0;
Why max volume is 0 if there is no opened positions?
Build 2715