MetaTrader 4 Build 574 with Updated MQL4 Language and Market of Applications Released - page 5

To add comments, please log in or register
Alain Verleyen
37485
Alain Verleyen  
Ovo:
It should not depend on a scope of a pointer, but on a number of references to the object. The object may be removed only if there is not any reference left. And it is not so easy, there may be deadly embrace, or circular references, so the memory manager must detect garbage with a kinda intelligence.

Pointer in mql4/mql5 aren't pointer as in C++.

Again, unlike C++, the variable hobject from the example above is not a pointer to the memory, it is a descriptor of the object.

I know online documentation is for mql5, but I suppose it's valid also for the new mql4 version :

Pointers can be declared on a local or global level; and they can be initialized by the empty value of NULL or by the value of the pointer of the same or inherited type. If the new operator is called for a pointer declared on a local level, the delete operator for this pointer must be performed before exiting the level. Otherwise the pointer will be lost and the explicit deletion of the object will fail.

Sunaley
16
Sunaley  
gchrmt4:

Format of RateInfo structure has also changed. All DLLs which receive data from ArrayCopyRates() are now broken and must be replaced, including the DLLSample which has been supplied with MT4 since 2004.
My .ex4 file(build 509) with DLL is working fine but strings cannot be recognized in DLL.

Consider this:

  • Strings are now presented in Unicode format, though they were in ANSI format (single byte ones) before. That should be considered if the program uses DLLs and passes string variables to them.
Ex Ovo Omnia
3459
Ex Ovo Omnia  
angevoyageur:

Pointer in mql4/mql5 aren't pointer as in C++.

I know online documentation is for mql5, but I suppose it's valid also for the new mql4 version :


no problem, I wanted to doubt that MQs had implemented the garbage collector, because it is not easy task at all. If they did, they would not introduce the "delete" operator as mandatory. Releasing the heap after the script ends I consider axiomatic, otherwise the script could not be used by amateurs.

I myself do not have problem to adopt the delete operator, but I have problem to locate leaks in my code, because the only tool/info I have is the very generic message about bytes in the log. It sucks.

Edit: Just went through the link you gave me:

When deleteing the dynamic object using the delete operator, released memory is immediately returned back to the class memory pool. Memory manager releases memory back to the operating system immediately after exiting the following event handling functions: OnInit(), OnDeinit(), OnStart(), OnTick(), OnCalculate(), OnTimer(),OnTrade(), OnTester(), OnTesterInit(), OnTesterPass(), OnTesterDeinit(), OnChartEvent(), OnBookEvent().

The "delete" returns memory to the pool, and at the end of the event method it returns the pool to the operating system. No note that objects would be released anywhere without the "delete" until the script ends.

gchrmt4
276
gchrmt4  
Sunaley:
My .ex4 file(build 509) with DLL is working fine but strings cannot be recognized in DLL.

Consider this:

  • Strings are now presented in Unicode format, though they were in ANSI format (single byte ones) before. That should be considered if the program uses DLLs and passes string variables to them.

struct RateInfo defined in ExpertSample.cpp is 44 bytes long with MT4 <= 509. In the new version, each RateInfo record is 60 bytes long (for both old EAs and new EAs). Therefore, existing DLLs receiving RateInfo data from ArrayCopyRates() will stop working. Confirmed by Service Desk.
gchrmt4
276
gchrmt4  
RaptorUK:
Maybe I'm misunderstanding . . . MetaQuotes CEO said . . . "old ex4/mq4 files will work, " if the .hst format has changed how can this statement be true ?


Old EX4 file does work... but DLL is broken. In a very narrow sense, it is true that all old EX4 files work. In a broader, more practical, real-life sense, it is not true.

Similarly, the change to the directory used by FileOpen() means that lots of things will stop working (e.g. https://www.mql5.com/en/forum/148772) and will need to be re-configured or even re-built. Again, the old EX4 file "works". But it does not work as expected.

Simon Gniadkowski
17644
Simon Gniadkowski  
gchrmt4:


Old EX4 file does work... but DLL is broken. In a very narrow sense, it is true that all old EX4 files work. In a broader, more practical, real-life sense, it is not true.

Similarly, the change to the directory used by FileOpen() means that lots of things will stop working (e.g. https://www.mql5.com/en/forum/148772) and will need to be re-configured or even re-built. Again, the old EX4 file "works". But it does not work as expected.

Not working as expected is not working . . . or broken. I have EAs that write .hst files . . . these will no longer work, so the statement that "old ex4/mq4 files will work, " should be withdrawn and corrected, it is, at best, misleading.
gilmt5
163
gilmt5  

I remember beta 563 build had been multi timeframe like MT5.

But final stage build 574 haven`t it.

Why did you remove this feature?

It is very useful.

gilmt5
163
gilmt5  

When platform is restarted,all charts deleted is removed.

option-charts- save deleted charts to reopen checked.

While platform is working, charts deleted is saved.

but when it is restarted, all charts deleted is removed.

gilmt5
163
gilmt5  

Closed positions and deleted pending orders can be displayed in the chart.

But trendline is always blue color.(default setting)

Yes, I can edit color.

But It is restored always.

gilmt5
163
gilmt5  

Windows - drive not ready error.

To add comments, please log in or register