
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
This topic is funny I would say. Some people are discussing like experts about something they obviously don't know (and I am not an expert about compiler either).
As clearly explained by Stanislav and the links he provided, mql (4 or 5 doesn't matter) is compiled into native code. There is nothing to discuss, it's a fact, unless you think Renat is lying. Old mql4 which was possible to decompile to source code was entirely an other story, obviously, but it's now totally obsolete.
A compiled code doesn't mean it's mandatory faster or without debugging information (array our range reporting source code line).
mql 4/5 is a managed language, it runs inside MT4/MT5, and it can't allowed to work directly with memory like C++, it has to check every access (how could it know there is an array out of range otherwise), that's why working with arrays is not that fast.I am sure you don't want to crash your trading platform each time you made a small error in your code. That's why you don't have real pointers.
Still the compiler produces native code. They are even preparing their compiler to compile C++ code in a future version.
This topic is funny I would say. Some people are discussing like experts about something they obviously don't know (and I am not an expert about compiler either).
As clearly explained by Stanislav and the links he provided, mql (4 or 5 doesn't matter) is compiled into native code. There is nothing to discuss, it's a fact, unless you think Renat is lying. Old mql4 which was possible to decompile to source code was entirely an other story, obviously, but it's now totally obsolete.
Alain, with all due respect:
You don't understand a text written in plain English. The test shows that MQL5 is about 22 times slower executed than C++ and that all the talk about pure C++ compilation was hogwash. And even more interesting also the 64bit version (the only MetaTrader version with a supposed native compiler) is NOT relatively faster compared to interpreted MQL (all other MetaTrader versions since more than 12 years).
This topic is funny I would say. Some people are discussing like experts about something they obviously don't know (and I am not an expert about compiler either).
As clearly explained by Stanislav and the links he provided, mql (4 or 5 doesn't matter) is compiled into native code. There is nothing to discuss, it's a fact, unless you think Renat is lying. Old mql4 which was possible to decompile to source code was entirely an other story, obviously, but it's now totally obsolete.
A compiled code doesn't mean it's mandatory faster or without debugging information (array our range reporting source code line).
mql 4/5 is a managed language, it runs inside MT4/MT5, and it can't allowed to work directly with memory like C++, it has to check every access (how could it know there is an array out of range otherwise), that's why working with arrays is not that fast.I am sure you don't want to crash your trading platform each time you made a small error in your code. That's why you don't have real pointers.
Still the compiler produces native code. They are even preparing their compiler to compile C++ code in a future version.
Whatever ...
That is interpreting ...and that was the point of showing the whole thing. Without interpretation the speeds would be comparable (debugger info or not)
All the best
Alain, with all due respect:
You don't understand a text written in plain English. The test shows that MQL5 is about 22 times slower executed than C++ and that all the talk about pure C++ compilation was hogwash. And even more interesting also the 64bit version (the only MetaTrader version with a supposed native compiler) is NOT relatively faster compared to interpreted MQL (all other MetaTrader versions since more than 12 years).
Mladen test is meaningless. It compares what can't be compared.
Anyway, as I said speed and compiler are not necessarily correlated.
About your claims that old mql4 (build 225) as you said is faster than current version, it's just a joke. Please try to prove it, and not with a niche example which will prove nothing.
Whatever ...
That is interpreting ...and that was the point of showing the whole thing. Without interpretation the speeds would be comparable (debugger info or not)
All the best
Mladen test is meaningless. It compares what can't be compared.
Anyway, as I said speed and compiler are not necessarily correlated.
About your claims that old mql4 (build 225) as you said is faster than current version, it's just a joke. Please try to prove it, and not with a niche example which will prove nothing.
Of meaningless test(s) :
I explicitly wanted to use something heavy on the CPU for the sake of being able to compare the execution times of native code and "native" code. No other reason. No arrays access times, no fixing, no debugging. But something that can be compared even without the profiler.
With the method described above (the "count-my-fingers" method) you are comparing what CAN be compared. And the ratio will remain the same (unless I, somewhere in my age, forgot to count)
Of meaningless test(s) :
I explicitly wanted to use something heavy on the CPU for the sake of being able to compare the execution times of native code and "native" code. No other reason. No arrays access times, no fixing, no debugging. But something that can be compared even without the profiler.
With the method described above (the "count-my-fingers" method) you are comparing what CAN be compared. And the ratio will remain the same (unless I, somewhere in my age, forgot to count)
Can't test anything as you provide 32-bit version only. Can you provide the DLL source code ?
Don't you think an indicator's buffer is a dynamic array ?
Try to add index checking on each access into your DLL code, then it will be comparable.
Can't test anything as you provide 32-bit version only. Can you provide the DLL source code ?
Don't you think an indicator's buffer is a dynamic array ?
Try to add index checking on each access into your DLL code, then it will be comparable.
As of arrays (since the wrong dimension is checked at compile time already) :there are two things (and only two things) that need to be checked :
As of the source : feel free to use and test it (attached it) - as I have told : no secret algo, essentially the same thing, just in real native compiled form. Used the simplest visual studio community edition for compilation
As of arrays (since the wrong dimension is checked at compile time already) :there are two things (and only two things) that need to be checked :
As of the source : feel free to use and test it (attached it) - as I have told : no secret algo, essentially the same thing, just in real native compiled form. Used the simplest visual studio community edition for compilation
So I made some work on this, on MT5-64 bit (build 1940). and I got some surprising results if you think mql is interpreted.
2018.11.03 10:48:33.067 IDWMA (EURUSD,M1) IDWMA Original mql5 (14-PRICE_CLOSE) : 5016172 bars processed in 3106384 µs.
2018.11.03 10:48:53.892 idwma_2 (EURUSD,M1) idwma with DLL (14-PRICE_CLOSE) : 5016172 bars processed in 4537182 µs.
2018.11.03 10:49:05.122 idwma_noDLL (EURUSD,M1) idwma NO dll (pure mql5). (14-PRICE_CLOSE) : 5016172 bars processed in 3010602 µs.
IDWMA is the original indicator, code posted in Codebase. idwma_2 is Mladen version using a DLL. idwma_noDLL is the exact same logic of Mladen version but with mql5 pure code. My computer is not fast.
This is executed on a live chart, no debug, no profiler, MT5 "Bars max in chart" set to Unlimited. DLL version is the slowest with a low period (14).
Period 50. Original IDWMA still faster, but not much difference actually.
2018.11.03 11:33:10.103 idwma_noDLL (EURUSD,M1) idwma NO dll (pure mql5). (50-PRICE_CLOSE) : 5016172 bars processed in 34510017 µs.
2018.11.03 11:35:07.770 idwma_2 (EURUSD,M1) idwma with DLL (50-PRICE_CLOSE) : 5016172 bars processed in 38321194 µs.
2018.11.03 11:36:07.601 IDWMA (EURUSD,M1) IDWMA Original mql5 (50-PRICE_CLOSE) : 5016172 bars processed in 29994012 µs.
Period 200. Original IDWMA still a little faster.
2018.11.03 11:46:30.856 idwma_2 (EURUSD,M1) idwma with DLL (200-PRICE_CLOSE) : 5016172 bars processed in 507378503 µs.
2018.11.03 11:55:52.677 IDWMA (EURUSD,M1) IDWMA Original mql5 (200-PRICE_CLOSE) : 5016172 bars processed in 464595404 µs.
2018.11.03 12:07:25.857 idwma_noDLL (EURUSD,M1) idwma NO dll (pure mql5). (200-PRICE_CLOSE) : 5016172 bars processed in 533547635 µs.
I ran the tests without the computer doing anything else. Of course it's still not a complete scientific results. But the conclusion is there is no real difference between the 3 versions.
32 bit terminal- same tests (just 5000 bars but that is enough already)
The only conclusion is that it (the 32 bit version of terminal) is treated as a kind of a "bastard"