Errors, bugs, questions - page 322

 
Renat:
So the 404 build of the tester crashes even when testing the standard Moving Average Expert Advisor?
The confusion occurs both with Moving Average and MACD...
 
52_rus:

Test: MACD Sample for a year on TF H1. Immediately after the first test, the second test: MACD Sample for a year on the TF Н4 ; in the report we get results of the first test on TF H1

If we wait 5 minutes after the first test and then run the next test on a different TF, we get a new correct report, different from the first test report.

Build 404

A link to a similar problem: https://www.mql5.com/ru/forum/3139

Thank you for the message. Reproduced, we will correct it.
 

Good afternoon to all and sundry. Wrote some code for the Expert Advisor:

   double Open1[1],Open2[1];
   int data1=CopyOpen(Symbol1,0,1,1,Open1);
   int data2=CopyOpen(Symbol1,0,5,1,Open2);
   double ss=MathAbs(Open1[0]-Open2[0]);

Calculates the difference between 1 and 5 bars. Printed it to the log

and got this

ss is a modulo difference, before this line there are open numbers 1 and 5 bars,

as you can see the difference is not clear how it is calculated and it is the same for all i-th

bars, currency and TF. It appears in 1 of 10 cases. Maybe it is a service or I am mistaken about something?

... I was mistaken?

 
alexluek:

Good afternoon to all and sundry. Wrote some code for the Expert Advisor:

Calculates the difference between 1 and 5 bars. Output to the log via Print

How about this?

Print(DoubleToString(ss,SymbolInfoInteger(Symbol1,SYMBOL_DIGITS)));
 
alexvd:

How about this?

OK, I'll check in 3-4 hours when the tester is finished,

but it's not clear why this is done (number conversion)in Print

if it calculates it that way and that's how the Expert Advisor works.

Maybe you hint that if you do the same in the code?

Then it will be possible to try your construction in the code

Документация по MQL5: Общие функции / Print
Документация по MQL5: Общие функции / Print
  • www.mql5.com
Общие функции / Print - Документация по MQL5
 

The same ...

 
alexluek:

The same ...

Normalise the difference

double ss=MathAbs(NormalizeDouble(Open1[0]-Open2[0], SymbolInfoInteger(Symbol1,SYMBOL_DIGITS)));

https://www.mql5.com/ru/articles/1561

https://www.mql5.com/ru/docs/convert/normalizedouble

https://www.mql5.com/ru/docs/basis/types/double

or better still

double ss=NormalizeDouble(MathAbs(Open1[0]-Open2[0]), SymbolInfoInteger(Symbol1,SYMBOL_DIGITS));
Особенности работы с числами типа double в MQL4 - Статьи по MQL4
  • www.mql5.com
Особенности работы с числами типа double в MQL4 - Статьи по MQL4: примеры использования экспертов, тестирования и оптимизации
 

I'll try in an hour or two and reply...

 
alexluek:

I'll try in an hour or two...

For a start, read up on real numbers in the help.
 

hmmm... It's back.

possible loss of data due to type conversion

probably missing something NormalizeDouble

as with array handling (for example, don't want to confuse ...[1]-identify and [0] - use)

Reason: