Errors, bugs, questions - page 254

 

there is no testing and optimisation of longs and shorts separately?

it was in mt4 - please add it in 5!

Thank you!

 
Jingo:

there is no testing and optimisation of longs and shorts separately?

it was in mt4 - please add it in 5!

Thank you!

how do you envisage it?

how do you close a sell position if buy is not allowed :)))

 

Folks, if anyone knows why

1) printf(3/(2*((3*0.1)/(4*10))));

outputs 200,

2) and printf(int(3/(2*((3*0.1)/(4*10)))));

gives 199,

3) and printf(int(round(3/(2*((3*0.1)/(4*10))))));

gives out 200 again?

It is unclear why:

- case 2) is not equivalent to case 3)?

- case 2) is not equivalent to case 1)?

 
-Alexey-:

Folks, if anyone knows why

1) printf(3/(2*((3*0.1)/(4*10))));

outputs 200,

2) and printf(int(3/(2*((3*0.1)/(4*10)))));

gives 199,

3) and printf(int(round(3/(2*((3*0.1)/(4*10))))));

gives out 200 again?

It is unclear why:

- case 2) is not equivalent to case 3)?

- case 2) is not equivalent to case 1)?

Without going into specific numbers. roundreturns a value rounded to the nearest whole number of the specified numeric value. And int - to an integer part of the rounded number (i.e. only to the nearest whole number from the bottom ).
 
Yedelkin:
Without going into specific numbers. roundreturns a value rounded to the nearest whole number of the specified numeric value. And int - to an integer part of the rounded number (i.e. only to the nearest whole number from the bottom ).
I know that. Only if I'm not mistaken, you're not quite right. Rounding to the nearest integer is floor, while int is rounding to integer type int. But the number in case 1) is already integer (200) - there is not a single place after the dot. Why does conversion to integer type make it 199, but in case of round it does not?
Документация по MQL5: Основы языка / Типы данных / Целые типы / Типы char, short, int и long
Документация по MQL5: Основы языка / Типы данных / Целые типы / Типы char, short, int и long
  • www.mql5.com
Основы языка / Типы данных / Целые типы / Типы char, short, int и long - Документация по MQL5
 

Keep it simple: print all intermediate values. And then you can figure out the difference between floor and int.

For case 1, read about type conversion. One of your multipliers there is a number of type double, so the final value cannot be of type int; while numbers of type double have some special internal representation, which is also described in the Reference book.

Документация по MQL5: Основы языка / Типы данных / Приведение типов
Документация по MQL5: Основы языка / Типы данных / Приведение типов
  • www.mql5.com
Основы языка / Типы данных / Приведение типов - Документация по MQL5
 

Hello! Just recently learned MQL5, I can't solve one problem. I need your help!

When a bar appears, I need to limit the number of trades performed on it to one, for example. How to do it in fifth MQL? If possible, please send a code example! Thanks in advance!

Обработчик события "новый бар"
Обработчик события "новый бар"
  • 2010.10.04
  • Konstantin Gruzdev
  • www.mql5.com
Язык программирования MQL5 позволяет решать задачи на совершенно новом уровне. Даже те задачи, которые уже вроде имеют решения, благодаря объектно-ориентированному программированию могут подняться на качественно новый уровень. В данной статье специально взят простой пример проверки появления нового бара на графике, который был преобразован в достаточно мощный и универсальный инструмент. Какой? Читайте в статье.
 
CArdagant:

Hello! Just recently learned MQL5, I can't solve one problem. I need your help!

When a bar appears, I need to limit the number of trades performed on it to one, for example. How to do it in fifth MQL? If possible, please send a code example! Thanks in advance!

Read this " New Bar" Event Handler
 

Happy New Year!

Questions.

1. When I hover the cursor on a graphical object (e.g. horizontal), a window appears with the name and price.
The name is OK but price value is different every time depending on the cursor position.
Where does MT5 get the price?
We need to show the true price of the line.

2. I tried to avoid it in MT4 by adding the price value through ObjectSetText. And in the window, there would be a line with
the true price.
Now it is possible only when setting Properties -> Show object description and together with its display on a chart.
chart.
The value of the property OBJPROP_TEXT must be in the box regardless of
Properties -> Show object des criptions.

3. Graphical objects disappear when the TF is switched and a message appears in the Experts window
2011.01.03 23:11:10 !exp_channel_7 (EURUSD,H4) DLL loading is not allowed

The indicator does not use a DLL. Files with classes are used.
When any of the input parameters is changed, everything is restored. After this, change of TF does not affect the operation of the indicator.
When I run MT5, the indicator calculates and draws some objects (lines) incorrectly. Again, when
all is restored when you change any of the input parameters.

Are there any peculiarities of OnInit() and OnDeinit() at first launch and through the indicator properties?

4. In MT4 I like the chart scale control better. It moves beautifully with a mouse in any direction.

In MT5 it is like using crutches. You have to run both and compare, it's like heaven and earth. I have already raised this problem - and silence.

Happy New Year!!!

Документация по MQL5: Стандартные константы, перечисления и структуры / Константы объектов / Свойства объектов
Документация по MQL5: Стандартные константы, перечисления и структуры / Константы объектов / Свойства объектов
  • www.mql5.com
Стандартные константы, перечисления и структуры / Константы объектов / Свойства объектов - Документация по MQL5
 

Question to the developers. Are there any plans to change window management in MT4? Let me explain what I mean... In some terminals like Saxo Trader or Rumus there is a handy feature - you can place several charts on one sheet. These sheets can be easily switched among themselves. This gives access to several charts, which can be grouped by different currencies or by one currency but in different timeframes. It makes my life easier, because I trade with many symbols and analysis requires different pairs.

Thanks.