Возникает ошибка invalid lots amount for FreeMarginCheck function

 

Приветствую

Возникает ошибка:

invalid lots amount for FreeMarginCheck function

Не могу разобраться что к чему

if (totb > 0)
   {
    if ((UseNewBar && NewBar_B != iTime(Symbol(), UNB_TF, 0)) || !UseNewBar)
     {
      if (Ask <= openpricebuy - MathFloor(step * MathPow(Step_coef, totb - 1)) * Point && totb < MaxTrades)
       {
        double lotsbuy2 = lastlotbuy * mult;
        
        NewBar_B = iTime(Symbol(), UNB_TF, 0);
        
        if (AccountFreeMarginCheck(Symbol(), OP_BUY, lotsbuy2) > 0)
         ОткрытьОрдер(OP_BUY, lotsbuy2,StringConcatenate("",totb + 1, "-й ордер Buy, ", magicbuy), magicbuy);
       }
     }
   }
  
  //=================================================== Усреднение позиций SELL =======================================
  if (tots > 0)
   {
    if ((UseNewBar && NewBar_S != iTime(Symbol(), UNB_TF, 0)) || !UseNewBar)
     {
      if (Bid >= openpricesell + MathFloor(step * MathPow(Step_coef, tots - 1)) * Point && tots < MaxTrades)
       {
        double lotssell2 = lastlotsell * mult;
        
        NewBar_S = iTime(Symbol(), UNB_TF, 0);
        
        if (AccountFreeMarginCheck(Symbol(), OP_SELL,lotssell2) > 0)
         ОткрытьОрдер(OP_SELL, lotssell2, StringConcatenate("",tots + 1, "-й ордер Sell, " ,magicsell), magicsell);
       }
     }
   }
 
ohr:

Приветствую

Возникает ошибка:

invalid lots amount for FreeMarginCheck function

Не могу разобраться что к чему

double lotsbuy2 = NormalizeDouble(lastlotbuy * mult,2);
double lotssell2 = NormalizeDouble(lastlotsell * mult,2);
 
ohr:

Приветствую

Возникает ошибка:

invalid lots amount for FreeMarginCheck function

Не могу разобраться что к чему

int    lotdig;

if(MarketInfo(Symbol(),MODE_LOTSTEP)==0.01)lotdig=2; else lotdig=1; 

double lotsbuy2 = NormalizeDouble(lastlotbuy * mult,lotdig);
double lotssell2 = NormalizeDouble(lastlotsell * mult,lotdig);
Причина обращения: