Features of the mql4 language, subtleties and techniques - page 18

 
Dmitry Rannev:

The problem has been described above by fxsaber. We are trying to find the cause.

This is how it will work correctly

NormalizeDouble(Price1 - Price2, _Digits) != 0.0;
 
Alexey Viktorov:

This is how it will work correctly

This is not trying to solve the problem of comparing doubles. The task is different.

 
Dmitry Rannev:

The problem has been described above by fxsaber. We are trying to find the cause.

Well then fxsaber has answered correctly - I would add don't use Printf, use printf and specify desired accuracy of numbers output { printf("Open: %.6f, Close: %.6f", OrderOpenPrice(), OrderClosePrice()); }

 
Ilya Malev:

Well then fxsaber answered correctly - I would add don't use printf, use printf and specify desired accuracy of numbers output { printf("Open: %.6f, Close: %.6f", OrderOpenPrice(), OrderClosePrice()); }

If you want to understand what exactly the problem is, ask fxsaber what prevents him from writing EAs normally. We are trying from the broker software developer's side to make it less of a problem. We are not looking for a problem with writing EAs, we are looking for a problem with storing data in the server's track record that prevents fxsaber from writing EAs.

 
I haven't heard that fxsaber has been prevented from writing EAs properly, but never mind, never mind :) If my comment was off-topic, pardon.
 
Dmitry Rannev:

...but in saving data in the trader's server record, which prevents fxsaber from writing EAs.

Ah, that's it... And we can't figure out what's stopping him.
 
Alexey Navoykov:
Ah, there it is... And we can't figure out what's stopping him.

That's where it started. And evolved into this

Forum on trading, automated trading systems and strategy testing

Unnormalized prices in MT4

fxsaber, 2019.02.20 23:03

But the situation is much worse, and at the same time on MQ-Demo
// 15326434
// wmefo5sa
// MetaQuotes-Demo
void OnStart()
{
  const double Price1 = HistoryOrderSelect(356138100) ? HistoryOrderGetDouble(HistoryOrderGetTicket(0), ORDER_PRICE_CURRENT) : 0;
  const double Price2 = PositionSelectByTicket(356138100) ? PositionGetDouble(POSITION_PRICE_OPEN) : 0;  
  
  Print(Price1 - Price2); // -2.220446049250313e-16
}


The opening price of the current position is not equal to the price of their order/trade.

 
fxsaber:
Features of ArrayResize for multidimensional arrays

because with ArrayRange() you need to get the number of elements in the required dimension, and you can resize only the 1st dimension anyway, that's why it's more logical to use mql5

 

Forum on trading, automated trading systems and trading strategy testing

Bugs, bugs, questions

Andrey Khatimlianskii, 2019.03.12 22:57

I wonder if TerminalInfoInteger(TERMINAL_TRADE_ALLOWED) (AutoTrade button) affects tested EAs (MT4)?

In 1170 it affects, directly with the button you can control trading in the tester. I am shocked.

Forum on trading, automated trading systems and strategy testing

Bugs, bugs, questions

Slava, 2019.03.13 06:05

It looks like from the beginning of new MQL4.

Forum on Trading, Automated Trading Systems and Strategy Tests

Bugs, bugs, questions

Vladimir Pastushak, 2019.03.13 19:12

If your code contains something like

if(!TerminalInfoInteger (TERMINAL_TRADE_ALLOWED))
return;

The button works.

If there is no such a command, then the button does not work.

Forum on trading, automated trading systems and strategy testing

Bugs, bugs, questions

Vladislav Andruschenko, 2019.03.13 19:14


I wrote about it about two years ago.


It is exactly what it is. That's why I disabled the button checks in the strategy tester.





 

Turns out that it's possible to get buffer values of indicators running on a chart (one-time use of WinAPI).

If without DLL - almost in automatic mode.