Errors, bugs, questions - page 2570

 
Nikolai Semko:

the string is empty, as if it does not exist, i.e. not even memory is allocated.

This is observed for other types. If you declare a variable, it means that memory is already allocated.
But in fact, a string is not a primitive type, but a reference type.

How could it not be? The memory for string object is allocated in the heap and the memory address where the text starts is 0x00
 
Igor Makanu:

can't figure out how to checkPrintFormat

Note

PrintFormat() is not executed in the strategy tester in optimisation mode.

Any thoughts?

How aboutStringFormat and the resulting string into a file? (for each pass to create its own file in the shared folder - so that the tester does not overwrite them).

 
Vladimir Simakov:
How could it not be? The memory for the string object is allocated in the heap, but the memory address at which the text starts is 0x00.

Memory is allocated only for the name and the reference, but not for the object itself, since it does not exist yet. This is not the case with primitive types, memory is allocated there at the moment the variable is created, even without initialization.
I don't want to bother with the terminology. Everybody understands each other anyway.
All this is obvious.

 
Vladimir Karputov:

How aboutStringFormat and the resulting string into a file? (create a different file for each pass in the shared folder - so that the tester doesn't overwrite them).

good option, will test

ZS: code again rewritten to work faster in the optimizer (the results were 5h, now 1.5h !!!)

now i ran across printf() in help, and decided to check all my prints, where i need to replace.... i replaced it and the optimization became 22h .... i found where i messed up, but of course i immediately thought it was all in printf() !!!

)))


I tried to check printf() in the optimizer:

int xx=10;
void OnTick()
{  printf("1/x = %f",1/(xx--));
....

so far got right away what i expected:

2019.09.20 11:29:16.611 Core 1 genetic pass (0, 607) tested with error "critical runtime error 503 in OnTick function (zero divide, module experts\)" at 0:00:00.048


I was expecting that if it says"PrintFormat() is not executed." then it should get that.

 
I've had it that code optimization speeds up execution by a factor of 450 :).
 
Igor Makanu:

good option, will test

SZY: code rewritten once again, to work faster in the optimizer (the results were 5h, now 1.5 h!!!)

Now I ran across printf() in help, and decided to check all my prints, where I need to replace.... I replaced it and the optimization became 22 hours .... I found where I messed up, but of course, immediately thought that the cause of all in printf() !!!

)))


I tried to check printf() in the optimizer:

so far got right away what i expected:

2019.09.20 11:29:16.611 Core 1 genetic pass (0, 607) tested with error "critical runtime error 503 in OnTick function (zero divide, module experts\)" at 0:00:00.048


I was expecting that if it says"PrintFormat() is not executed." then it should get it.

Aha. And get different value of variable xx in single test and in optimization.

Only the printf function call is not executed.

 
Slava:

Aha. And get different value of variable xx in single test and in optimization.

Only the call of the printf function is not executed.

Yes, it's clear that the user can do it that way too

but how to check printf() ?

HH: although, if the developer said it's not printed, then we don't have to check it.

 
Igor Makanu:


but how do you check printf() ?

Compare the time of a single pass from the optimisation and the time of a single pass

 
Slava:

I will duplicate it:

Forum on trading, automated trading systems and trading strategy testing

Bugs, bugs, questions

Alexey Kozitsyn, 2019.09.18 09:34

A few questions about the platform:

1. will there be an allowable trading range added for VP via MOEX (e.g. EURRUB_TOM)? Right now it is not possible to know for sure if a limit will be put out, as there is no access to the range (max and min possible prices). Please add.

2. Is it possible to add to the terminal and meta-editor an auto-save status every N minutes? Very lacking, as with a sudden disconnection you go back to the state at the start of the program with loss of all changes! Very stressful!

On the first point: understand that it is impossible to trade normally if you don't know the limitations! Why is it possible to get these limitations for some instruments and not for others?

 

help is incorrect again, I read:https://www.mql5.com/ru/docs/math/mathmax

Функция возвращает максимальное из двух числовых значений.

double  MathMax(
   double  value1,     // первое число
   double  value2      // второе число
   );

I see that there are no options, function type fmax() double , looking for where I may have lost a fractional value, after searching for anything and everything, I run the test:

void OnStart()
{
   long slvl = SymbolInfoInteger(_Symbol, SYMBOL_TRADE_STOPS_LEVEL);
   int sl = 300;
   Print(typename(fmax(slvl,sl)));
}

2019.09.20 18:06:34.194 tst (EURUSD,H1) long

ZS: I answer right away, I read the help to the end and see the phrase: "The return value type corresponds to the senior type." ...imho, it's not serious, that in 99% of cases it's enough to look in help for description of function, than to look for hidden meaning between lines - it is written result type fmin() --> double - so there are no variants as if