Errors, bugs, questions - page 1405

 
Tapochun:
Can you please tell me, what spread values are passed to spread[] array when OnCalculate() is called in the indicator? Maximum/minimum/average values per candle?
Those that the terminal receives from the server.
 

A question has arisen about the order in which the .dll is loaded. If declared

#import "Test1.dll" //1
#import "Test2.dll" //2
#import

they will be loaded in reverse order, i.e. "Test2.dll" first. It would seem that there is a difference. It turned out that it makes a difference and in some cases (.dll requires a certain order of loading) it fails: Sappot load 'Test1.dll'.
The question
is whether to change the load order to direct, which from the perspective of the code would be more logical - or to ensure that this order will not be changed in the future (so that code adjusted to the reverse order does not suddenly stop working). At the moment we need to adjust the code to the reverse order.

 

Build 1191. Compilation error: code generation error


I don't even know where to look for the reason. But in build 1162 all is ok.

 
A100:

Build 1191. Compilation error: code generation error


I don't even know where to look for the reason. But in build 1162 all is ok.

Please send code to servicedesk.
 
Alexander:
Please send the code to servicedesk.

It's heavily distributed - I'll try to put it all in one file.

Other code - notice the time - it's probably 20 times bigger

 
Ilyas:

Two cases are known to date:
1) In bool &= operation (bool expression)
2) An extra comma in initializing sequences: val={ {...},{...}, }

Here is the first case - I have very many such operations in my code. I had no problems before when I had the 1159 build. When may we expect corrections?

 

Code generation error

I sent the source code to servicedesk: #1332553

 
Alexander:
Please send the code to servicedesk.

code generation error


//build 1191
class A {};
class B : public A {};
void f( A& a ) {}
B *h() { return new B; }
void OnStart()
{
        f( h() );
}

Please be careful not to end up like I described in the pocket. If you can do it without * as it works now and worked before in the following example

//build 1191
class A {};
void f( A& a ) {}
A *h() { return new A; }
void OnStart()
{
        f(  h() ); //нормально
        f( *h() ); //нормально
}
please do, if not - maybe it makes sense to roll everything back at all before you start using the innovation

Forum on trading, automated trading systems and strategy testing

Bugs, bugs, questions

A100, 2015.08.26 10:35

In fact you are offering a simple and straightforward entry

a = (b + c) - d*e + f;
replace with
*a = (*b + *c) - *d**e + *f;
And this is for what? So that you can write
bool c = *a == *b;

while a special function can be used to compare pointers to equality, and all other arithmetic operations (addition, subtraction, multiplication, etc.) with pointers have no meaning per se, and are interesting only in terms of being able to overload them.

Only by creating a mathematical base and derived class, redefining several (rather than one or two) arithmetic operations, making them virtual and then testing complex expressions (not just a = b + c) on their basis - only this will bring you closer to understanding that everything is now done OPTIMALLY. In the meantime, you're reasoning at an entry level.

If you take equality pointer comparison into a separate function, you are left with only one(!) bottleneck

class A {};

A *a = b; //однозначно присвоение указателю значения
a = b;    //неоднозначно
which should nevertheless also be treated as an assignment and not an operator=() call, because currently there is no other syntax for assigning a value to a pointer, while a.operator=( b ) can also be called explicitly
 
A100:


Other code - pay attention to time - it must have grown by 20 times

This is a new optimizing compiler for MQL5 (MQL4 doesn't have it).

You have to pay for better target code with longer compilation time. Some long functions consisting of hundreds of lines are very hard to optimize.

 
Renat Fatkhullin:

This is how the new optimizing compiler for MQL5 (it's absent in MQL4) works.

For a better target code you have to pay for a longer compilation time. Some long functions, consisting of hundreds of lines, it is very stubbornly optimizing.

Is it really necessary at all? Isn't the price of this "high-quality code" too high? To slow down the compilation speed dozens of times for the sake of a relatively small performance gain... All the more so because in many cases, this gain isn't very important, and lengthening the compilation time is torture for the programmer.

Wouldn't it be better to make the "Debug" and "Release" compilation options?

Reason: