// v передается в функцию как double-значение лота // сначала то что чаще всего встречается v = NormalizeDouble(v, 3); if(v < MarketInfo(symbol, MODE_MINLOT)) v = MarketInfo(symbol, MODE_MINLOT);
// затем рассчитать знаки после запятой для объема, которого не может быть но они фсе равно проверяют string volume_min = (string) SymbolInfoDouble(symbol, SYMBOL_VOLUME_MIN); int volume_digits = 0; int pos = StringFind(volume_min, ".", 0);
На прошлом уроке «Язык MQL — Урок 2» мы научили наш первый , написанный на языке MQL4 рассчитывать размер лота, а точнее запрашивать у нас размер средств которыми мы хотим рискнуть при торговле на форекс при помощи терминала Metatrader 4. В данном уроке я предлагаю заняться самим ! Для расчета желаемого лота, скрипту MT4 необходимо знать...
Evgeniy Scherbina: Ta e May. I don't use any risk, much less 100% (the lot has 100% ???) and pass the check.
The question was about where 100 comes from. The answer is not "from the ceiling". Who uses what is a tenth matter. The use of the "risk" indicator should not interfere with verification.
Your lotDigit is a tricky fool that always calculates 0. This is not in the example in the documentation. Apparently you like a lot of brackets?
Also this: FreeMg*Risk/100/Margin/Step... Where did 100 come from? Obviously from the ceiling.
That's a lot of strings. It's really a lot, what do you calculate?
in this case lotDigit counts the number of digits for rounding, you can check - this tricky fool will always be greater than zero (if fractional lot is allowed)
...looks like you don't use fractional lots either.
in this case lotDigit counts the number of digits for rounding, you can check - this tricky fool will always be greater than zero (if fractional lot is allowed)
...it looks like you don't use fractional lots either
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
That's the way to do it!!!
// сначала то что чаще всего встречается
v = NormalizeDouble(v, 3);
if(v < MarketInfo(symbol, MODE_MINLOT)) v = MarketInfo(symbol, MODE_MINLOT);
// затем рассчитать знаки после запятой для объема, которого не может быть но они фсе равно проверяют
string volume_min = (string) SymbolInfoDouble(symbol, SYMBOL_VOLUME_MIN);
int volume_digits = 0;
int pos = StringFind(volume_min, ".", 0);
if(pos > 0){
volume_min = StringSubstr(volume_min, pos+1, StringLen(volume_min)-pos);
volume_digits = StringLen(volume_min);
v = NormalizeDouble(v, volume_digits);
}
Your lotDigit is a tricky fool that always calculates 0. This is not in the example in the documentation. Apparently you like a lot of brackets?
Also this: FreeMg*Risk/100/Margin/Step... Where did 100 come from? Obviously from the ceiling.
That's a lot of strings. It's really a lot, but what are you calculating?
There it is.
http://mql4you.ru/mql-school/yazyk-mql-urok-3.html
Also this: FreeMg*Risk/100/Margin/Step... Where does 100 come from? Clearly from the ceiling.
100 is a conversion from percent ;-). That is, Risk/100 gives a value between 0 and 1.
Ta e May. I don't use any risk, much less 100% (the lot has 100% ???) and pass the check.
Your lotDigit is a tricky fool that always calculates 0. This is not in the example in the documentation. Apparently you like a lot of brackets?
Also this: FreeMg*Risk/100/Margin/Step... Where did 100 come from? Obviously from the ceiling.
That's a lot of strings. It's really a lot, what do you calculate?
in this case lotDigit counts the number of digits for rounding, you can check - this tricky fool will always be greater than zero (if fractional lot is allowed)
...looks like you don't use fractional lots either.
in this case lotDigit counts the number of digits for rounding, you can check - this tricky fool will always be greater than zero (if fractional lot is allowed)
...it looks like you don't use fractional lots either