Errors, bugs, questions - page 2592

 
Artyom Trishkin:

Found the highlighted constant SYMBOL_CHART_MODE_OLD in the editor.

Of course it is not in ENUM_SYMBOL_CHART_MODE.

What is it?

Prehistoric chart mode.

Hasn't been used for a long time

 
Slava:

A prehistoric mode of chart formation.

Hasn't been used for a long time

Got it, thanks.

 
It would be better if instead of the banner at the top of the page the time after which the site will be updated would be shown .... An hour spent on the design was just lost because the site was being updated...
 

I've run into this problem:

condition

         if(a4 > upper_channel_line_a4 && a4 < upper_channel_line_a4 + indent_channel_line_a4 &&
            a0 < lower_channel_line_a0 && a0 > lower_channel_line_a0 - indent_channel_line_a0 && a3 < a2)
         {
            Print("*-* "+string(a4)+" > "+string(upper_channel_line_a4)+" && "+string(a4)+" < "+string(upper_channel_line_a4 - indent_channel_line_a4));
            Print("*-* "+string(a0)+" < "+string(lower_channel_line_a0)+" && "+string(a0)+" > "+string(lower_channel_line_a0 + indent_channel_line_a0));
            Print("*-* "+string(a3)+" < "+string(a2));

print

*-* 0.1151219 > -0.5 && 0.1151219 < -5.5
*-* 1.78309976 < 3.5 && 1.78309976 > 7.5
*-* -0.06357424 < 0.12727985

What the ...? How is this possible? Why does the condition hold?

P.S.

input    double            lower_channel_line_a0   = 0.0;                  // Порог принятия решения для А0 (низ канала)
input    double            indent_channel_line_a0  = 0.0;                  // Отступ для верхней границы канала А0 (0 - канал не использовать)
input    double            upper_channel_line_a4   = 1.0;                  // Порог принятия решения для А4 (верх канала)
input    double            indent_channel_line_a4  = 0.0;                  // Отступ для нижней границы канала А4 (0 - канал не использовать)
..........
   double            a0=0.0,a1=0.0,a2=0.0,a3=0.0,a4=0.0;
 
Сергей Таболин:

I've run into this problem:

condition

print

What the ...? How is this possible? Why does the condition hold?

P.S.

What about...

a4 < ( upper_channel_line_a4 + indent_channel_line_a4)

?

 
Vladimir Karputov:

How about...

?

Holy crap!

It's so much easier to screw up on the simplest of things. )))))))))))

Thank you. (chuckles)

 
Сергей Таболин:

Holy crap!

It's so much easier to screw up on the simplest of things. )))))))))))

Thank you. (chuckles)

You're welcome. I've been caught like that myself - now I try to put all the terms in separate brackets.

 

https://www.mql5.com/ru/docs/basis/operations/rules

the sum has a higher priority than the comparison, i.e. it looks like a bug...

Документация по MQL5: Основы языка / Операции и выражения / Приоритеты и порядок операций
Документация по MQL5: Основы языка / Операции и выражения / Приоритеты и порядок операций
  • www.mql5.com
Для каждой группы операций в таблице приоритет одинаков. Чем выше приоритет группы операций, тем выше она расположена в таблице. Порядок выполнения определяет группировку операций и операндов.
 
Igor Zakharov:

https://www.mql5.com/ru/docs/basis/operations/rules

the sum has a higher priority than the comparison,***

Yes, but rather than catching a black swan every time, it's better to write correctly and with a line-up at once.

 

of the same series:

condition? constant:X+Y

is more often interpreted as follows:

condition? constant:(X+Y)

but sometimes

(condition?constant:X)+Y

I have come across it in Quaternary a long time ago. The conclusion is the same as Vladimir's - I like parentheses.

Reason: