Automatic check on the marketplace - page 7

 

That's the way to do it!!!

// 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);


if(pos > 0){
  volume_min = StringSubstr(volume_min, pos+1, StringLen(volume_min)-pos);
  volume_digits = StringLen(volume_min);
  v = NormalizeDouble(v, volume_digits);
}
 
Evgeniy Scherbina:

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

Язык MQL — Урок 3 «расчет лота» | MQL для тебя
Язык MQL — Урок 3 «расчет лота» | MQL для тебя
  • mql4you.ru
На прошлом уроке «Язык MQL — Урок 2» мы научили наш первый , написанный на языке MQL4 рассчитывать размер лота, а точнее запрашивать у нас размер средств которыми мы хотим рискнуть при торговле на форекс при помощи терминала Metatrader 4. В данном уроке я предлагаю заняться самим ! Для расчета желаемого лота, скрипту MT4 необходимо знать...
 
Evgeniy Scherbina:

Also this: FreeMg*Risk/100/Margin/Step... Where does 100 come from? Clearly from the ceiling.

100 is a conversion from percent ;-). So Risk/100 gives a value between 0 and 1.
 
Stanislav Korotky:
100 is a conversion from percent ;-). That is, Risk/100 gives a value between 0 and 1.
That's May. I don't use either Risk, much less 100% (the lot has 100% ???) and pass the check.
 
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.
 
Evgeniy Scherbina:

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.

 
Taras Slobodyanik:

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

Uh-huh, but I pass the check easily
 
my test passed the problem was the complexity of the unindicating internal for EA algorithm