Errors, bugs, questions - page 2296
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
There is no problem... there is an error. I also don't understand why you're trying to pull the explanation out of your head. The default Print has the following signature:
And it can also clash with other functions (if needed)
The Print signature is out of range of MQL5 language. If MQL5 prohibits Print overloading at all, it won't be a bug.
I hope this "bug" does not prevent you from creating TS and does not require writing crutches.
I measured the performance of the Tester. To do this, I opened and closed a position on each tick. I measured the time of execution of 100 ticks. I ran it through 100 000 ticks. I measured a total of 1000 ticks. I got this chart
There are spikes of slowing down at almost equal distances between them. I measured it in the Optimization mode. If I ignore those spikes the tester's performance varies by 25% instead of the constant value. Maybe it's Windows speed metering tricks again.
SZZ The same code I ran on MT4
On average it takes MT4 Tester 1.5-2 times less time to process one tick than MT5.
Possibly surges through the use of a genetic optimisation algorithm.
On average it takes MT4-Tester 1.5-2 times less time to process one tick than MT5.
Possibly surges through the use of a genetic optimisation algorithm.
No GA. Optimisation from two passes on one Agent.
And this is already pure manipulation and misleading.
The source code is in place.
In one case a warning, in the other an error
What's the fundamental difference? In C++, for example, there is an error in both cases
I'm asking for help from knowledgeable people to understand the issue of pointers to class instances. I do not understand it.
Here is an example of the script:
When executing it we have, as expected:
if an instance of a class is declared as:
A *a= new A;
then on execution we have:
i.e. the destructor is not even started and therefore memory is not freed.
But if an instance of a class is declared as:
A a= new A;
the constructor is launched twice, the destructor - once, but memory is not freed and we have thePOINTER_AUTOMATIC object pointer type, although it was intended to bePOINTER_DYNAMIC
How to always execute the destructor and correctly execute delete
Как добиться всегда выполнения деструктора и правильного выполнения delete.
See from C++ the topic of smart pointers and adapt for MQL(https://habr.com/post/140222/).
Maybe there's something in kodobase...
See from C++ the topic of smart pointers and adapt for MQL(https://habr.com/post/140222/).
Maybe there's something in kodobase...
thanks, but didn't see any answers to my questions there.
I don't understand why the destructor is not called whenA *a= new A;
Thank you, but I didn't see any answers to my questions there.
I don't understand why the destructor is not called whenA *a= new A;
Result:
1:POINTER_AUTOMATIC
1:POINTER_DYNAMIC
2:POINTER_DYNAMIC
2:POINTER_AUTOMATIC
Thank you, but I didn't see any answers to my questions there.
I don't understand why destructor is not called whenA *a= new A;
Create with new and delete with delete