Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 409

 
Link_x:
What is this operator or function or variable, in short, what is it?
How to enter it, so that the compiler doesn't throw an error:

variables have to be declared before they can be used.

 
Link_x:
What is this operator or function or variable, in short, what is it?
How to enter it, so the compiler won't generate an error:
?

Sort of here https://docs.mql4.com/ru/constants/errors


The ErrorDescription() function defined in stdlib.mqh should be used to output text messages.

#include <stderror.mqh>
#include <stdlib.mqh>
 
BeerGod:

Sort of here https://docs.mql4.com/ru/constants/errors


The ErrorDescription() function defined in stdlib.mqh should be used to output text messages.


Already done, but thanks anyway. :)
 
vadynik:
What are the reasons for the optimizer to really slow down? The first 2 runs take a few seconds, then it's like a jam, after 40 min one more run is added
Where a run goes fast is a fast drain. :)))
 
vadynik:
What are the reasons for the optimizer to really slow down? The first 2 runs take a few seconds, then it gets stuck, after 40 min one more run is added.

Maybe it skips useless variants with negative balance, but it takes time for them too.
 
Thank you so much evillive!!! I'll have a look and learn. I studied Basic and Fortran 25 years ago :), mql is not going well.
 
khorosh:
In the currency of the deposit.


Like this?
double FindRightLot (int otype) // функция поиска лота, необходимого для выхода из просадки после 
                               //закрытия сетки ордеров
{
  double Loss=0; double TotalLoss=0; double LotIneed=0; double TL=0;
  for (int i = OrdersTotal()-1; i>0; i--)
  {
    if (OrderSelect(i, SELECT_BY_POS,MODE_TRADES))
    {
       if (OrderSymbol()==Symbol() && OrderMagicNumber()==Magic && OrderType() == otype)
       {
         if (otype == OP_BUY)
         {
           if (OrderProfit()<0)
           {
              Loss = OrderProfit();
              TotalLoss +=Loss;
              TL = MathAbs(TotalLoss);
              LotIneed = NormalizeDouble (TL / TakeProfit,2);
           }
         }
           
       
         else if (otype == OP_SELL)
         {
           if (OrderProfit()<0)
           {
              Loss = OrderProfit();
              TotalLoss +=Loss;
              TL = MathAbs(TotalLoss);
              LotIneed = NormalizeDouble (TL / TakeProfit,2);
           }
         }
       }
     }
   }
   return (LotIneed);
   
 }
//+------------------------------------------------------------------+
 
Another question, the tester shows error 138 (ERR_REQUOTE) what does it mean?
 
Trader7777:
Another question, the tester shows error 138 (ERR_REQUOTE) what does it mean?


Error codes
 
Trader7777:
Another question, the tester shows error 138 (ERR_REQUOTE), what does it mean?
It means that there are no requotes in the tester. It means that there is an error in the trade order. Most likely, you are trying to open the market one as a pending one.
Reason: