Errors, bugs, questions - page 1583

 

The compiler will not detect an error if the class name and the function pointer are the same

class fn {};
typedef void (*fn)();
void OnStart()
{
        Print( sizeof( fn ));
}
 

Problem: When testing an EA in the cloud, everything goes fine. I stop the optimization, after some time I start it again - OnInit failed errors keep coming. It helps to rename EA to a file with another name and run optimization in the cloud with the same parameters - no errors.

I think it may be due to the fact that during the initialization process the EA needs access to the characters, other than the one used to start the test.

I have been using the cloud a lot lately and I am spending real money on it, so please do not ignore the bug report. I can not provide the code of the Expert Advisor, right away, because it belongs to the customer.

P.S. Now during the test for some reason the terminal disconnected from the cloud server and reconnected to it and these errors started again, even without restarting the test

 
Comment(1/100); outputs 0, why and how do I fight it?
 
Aliaksandr Kryvanos:
Comment(1/100); outputs 0, why and how do I fight it?

For example: Comment((double)1/100);

Or like this: Comment(1.0/100);

 

No, it doesn't work that way, 0 puts


I used the whole arsenal (double, DoubleToStr, Normalize...), but nothing

 
Aliaksandr Kryvanos:
No, it doesn't work like that, it puts 0
I have just tested in both terminals, it works fine and puts 0.01
 
Aliaksandr Kryvanos:
No, it doesn't work that way, it puts 0.
So explicitly show the compiler that the numbers are valid: Comment(1.0/100.0); or Comment(1.0*0.01);
 

я использовал весь арсенал (double, DoubleToStr, Normalize...), но вот никак

DoubleToStr and Normalize will not work, because the expression itself is int unless explicitly cast to double. You most likely did not accurately reproduce my example and jumped to conclusions.
 
Thanks, it's working.)
 

It feels like one and the same agent with low PR, who gets one run after another, lacks memory and blows up some part of optimization (other agents have enough and everything locally works fine). Why not immediately remove such agents from continuation tests?