Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1673

 
MakarFX #:

Try this, remove bCheckOrders() from OnTick() and put it as highlighted.

I did. It had no effect.

I found function

voidSleep(
intmilliseconds// interval
);

is it possible to solve this problem?

 
Can't I check an input variable with an if statement for more/less or equal? It says input cannot be modified, but it's not!
 
pribludilsa an input variable with an if statement for more/less or equal? It says input cannot be modified, but it's not!
Inputs are constants. Externally apply or assign the input variable to another one.
 
законопослушный гражданин #:

I did. It had no effect.

I found a function

voidSleep(
intmilliseconds// interval
);

is it possible to use it to solve the problem?

It's better not to stop the process. Put everything back the way it was and add

//+-----------------------------------------------------------------------------------------------+
//|                                                            Функция открытия ордера на покупку |
//+-----------------------------------------------------------------------------------------------+
void vOrderOpenBuy()
  {
// Тикет ордера
   int iOTi = 0;   

   iOTi = OrderSend(Symbol(), OP_BUY, LOT(), Ask, Slippage, 0, 0, "", Magic, 0, clrNONE);
   Print(bCheckOrders());
// Проверим открылся ли ордер
   if(iOTi > 0)
// Есди да, то выставим уровни убытка и прибыли
      vOrderModify(iOTi);
   else
// Если нет, то получим ошибку
      vError(GetLastError());
  }
//+-----------------------------------------------------------------------------------------------+
//|                                                            Функция открытия ордера на продажу |
//+-----------------------------------------------------------------------------------------------+
void vOrderOpenSell()
  {
// Тикет ордера  
   int iOTi = 0;   

   iOTi = OrderSend(Symbol(), OP_SELL, LOT(), Bid, Slippage, 0, 0, "", Magic, 0, clrNONE);
   Print(bCheckOrders());
// Проверим открылся ли ордер
   if(iOTi > 0)
// Есди да, то выставим уровни убытка и прибыли
      vOrderModify(iOTi);
   else
// Если нет, то получим ошибку
      vError(GetLastError());
  }
//+-----------------------------------------------------------------------------------------------+

then see what the log prints.

 
Valeriy Yastremskiy #:
Inputs are constants. Extern apply or assign an instance variable to another instance.
Yes, I did, but it's just weird. Thanks.
 
pribludilsa an input variable with an if statement for more/less or equal? It says input cannot be modified, but it's not!
I've never had a problem with this. I do it regularly.
 
Nerd Trader #:
I've never had a problem with it. I do it regularly.
mql5 ?
 
MakarFX #:

It is better not to stop the process. Put everything back the way it was and add

then see what the magazine prints.

I did. It's exactly the same as the last one.

No errors, or anything else.

 
Nerd Trader #:
Never had a problem with that. I do it regularly.

And it shouldn't be!!! input can be compared. I think pribludilsa #: did not give out all the information

 
pribludilsa #:
mql5 ?
Maybe you are trying to do an assignment in a condition? x = 1 instead of x == 1?
Reason: