Errors, bugs, questions - page 266

 
mql5:

The problem with looping is not in the way the variable is changed (unless of course it is changed to zero), but in checking the value of that variable, which will never be less than zero.

I don't understand what you mean. To avoid the "problem", you can, for example, just add an additional condition to exit the loop

   uchar LastBarInd = 2;
   for (uchar i = LastBarInd; i >= 0; i--)
     {
      ................. // тело
      if (i == 0) break;
     }

or make the loop not based on for, but based on while...

 
AlexSTAL:

I don't understand what you are trying to say.

What he means is that the compiler can catch simple static comparisons at compile time, but is powerless against run-time control.
 
AlexSTAL:

I don't understand what you are trying to say. To avoid the "problem", you can, for example, simply add an additional condition to exit the loop

or make the loop not based on for, but based on while...


Yes, but you may replace the "i>=0" check in the for condition with "true" and the compiler will tell you about it (as a warning, in one of the next builds).
 
The test chart window does not show TP, SL, pending orders as it was in MT4. Can we add this in MT5?
Документация по MQL5: Стандартные константы, перечисления и структуры / Торговые константы / Свойства ордеров
Документация по MQL5: Стандартные константы, перечисления и структуры / Торговые константы / Свойства ордеров
  • www.mql5.com
Стандартные константы, перечисления и структуры / Торговые константы / Свойства ордеров - Документация по MQL5
 

The numbers are not rounded. Maybe I'm doing something wrong, please advise.

Here's the code:

   for(int e=1; e<=NSignalBuy; e++)
     {
   Print("OkruglyaemDo2[",e,"]=",NormalizeDouble(OkruglyaemDo2[e],2));
     }

This is the result:

2011.01.18 16:25:55 Core 1 2010.10.30 23:59:50 OkruglyaemDo2[19]=9.220000000000001
2011.01.18 16:25:55 Core 1 2010.10.30 23:59:50 OkruglyaemDo2[18]=6.29
2011.01.18 16:25:55 Core 1 2010.10.30 23:59:50 OkruglyaemDo2[17]=3.94
2011.01.18 16:25:55 Core 1 2010.10.30 23:59:50 OkruglyaemDo2[16]=7.54
2011.01.18 16:25:55 Core 1 2010.10.30 23:59:50 OkruglyaemDo2[15]=7.86
2011.01.18 16:25:55 Core 1 2010.10.30 23:59:50 OkruglyaemDo2[14]=13.71
2011.01.18 16:25:55 Core 1 2010.10.30 23:59:50 OkruglyaemDo2[13]=7.13
2011.01.18 16:25:55 Core 1 2010.10.30 23:59:50 OkruglyaemDo2[12]=8.3800000000001
2011.01.18 16:25:55 Core 1 2010.10.30 23:59:50 OkruglyaemDo2[11]=3.71
2011.01.18 16:25:55 Core 1 2010.10.30 23:59:50 OkruglyaemDo2[10]=5.52
2011.01.18 16:25:55 Core 1 2010.10.30 23:59:50 OkruglyaemDo2[9]=9.619999999999999
 
Jager:

The numbers are not rounded. Maybe I'm doing something wrong, please advise.

Here's the code:


Here's the result:

2011.01.18 16:25:55 Core 1 2010.10.30 23:59:50 OkruglyaemDo2[19]=9.220000000000001
2011.01.18 16:25:55 Core 1 2010.10.30 23:59:50 OkruglyaemDo2[18]=6.29
2011.01.18 16:25:55 Core 1 2010.10.30 23:59:50 OkruglyaemDo2[17]=3.94
2011.01.18 16:25:55 Core 1 2010.10.30 23:59:50 OkruglyaemDo2[16]=7.54
2011.01.18 16:25:55 Core 1 2010.10.30 23:59:50 OkruglyaemDo2[15]=7.86
2011.01.18 16:25:55 Core 1 2010.10.30 23:59:50 OkruglyaemDo2[14]=13.71
2011.01.18 16:25:55 Core 1 2010.10.30 23:59:50 OkruglyaemDo2[13]=7.13
2011.01.18 16:25:55 Core 1 2010.10.30 23:59:50 OkruglyaemDo2[12]=8.3800000000001
2011.01.18 16:25:55 Core 1 2010.10.30 23:59:50 OkruglyaemDo2[11]=3.71
2011.01.18 16:25:55 Core 1 2010.10.30 23:59:50 OkruglyaemDo2[10]=5.52
2011.01.18 16:25:55 Core 1 2010.10.30 23:59:50 OkruglyaemDo2[9]=9.619999999999999

1) Read: https://www.mql5.com/ru/docs/basis/types/double and https://www.mql5.com/ru/articles/1561

2) If you want rounding specifically when printing: DoubleToString

Документация по MQL5: Основы языка / Типы данных / Вещественные типы (double, float)
Документация по MQL5: Основы языка / Типы данных / Вещественные типы (double, float)
  • www.mql5.com
Основы языка / Типы данных / Вещественные типы (double, float) - Документация по MQL5
 
AlexSTAL:

1) Read: https://www.mql5.com/ru/docs/basis/types/double and https://www.mql5.com/ru/articles/1561

2) If you want rounding specifically when printing: DoubleToString

Thank you, it helped.

Here's another confusion with rounding profit and price points by GBPUSD symbol. Doesn't seem to be supposed to be like this.


 

what is the Automatic update available through the LiveUpdate system.

how to run it

terminal cannot update

Win 7 - 32 terminal is started by command "D:\MetaTrader 5\terminal.exe" /portable

S.I. Do I have to reinstall it every time?

 

I accidentally deleted the expert file from the navigator window. As it turned out, the .mq5 file of the same name was also deleted

Can you advise whether these files can be restored (found)?

I can't find a similar topic.

 
Yedelkin:

I accidentally deleted the expert file from the navigator window. As it turned out, the .mq5 file of the same name was also deleted

Can you advise whether these files can be restored (found)?

I can not find a similar theme.

they are in the windows trash (if it is not turned off)