
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
Yes, that is correct and I did not explain it very well in my previous post (I've updated it accordingly).
When using Zoom in MT4 it aligns (if Auto-Scroll is enabled) by the Right-Hand-Side (of the entire chart), but when Auto-Scroll is disabled, it aligns by the Left-Hand-Side (of the visible part).
In MT5 however, irrespective of whether Auto-Scroll is enabled or not, it always aligns by the Left-Hand-Side of the visible part (hence, why it will not update, until a tick arrives, if auto-scroll is enabled).
PS! As far as the MT5 functionality, I am unsure if it was always like this on if it is like this only now. I don't really remember how it was in the early builds.
However, in MT4 I am pretty sure it has been like that since I first started with it.Getting back to the graphics issue. In the meanwhile I have some benchmarks and the comparison between Mt4 and MT5 is horrible. The main code is 1:1 the same, max 1 ChartRedraw within one ChartEvent, max one ChartRedraw during OnInit and creation of all objects:
1. Loading time: MT4 3 seconds, MT5 25 seconds!
2. OnChartEvent: MT4 creates approx 10 times more chartevents when the chart is resized (and bitmap objects are rebuilt) than MT5 does
3. Compilation time: MT4 2-3 seconds, MT5 1,5 minutes
Both platforms deal with the same code, it differs only in a few things which do not affect the benchmarks at all. Bot create <> 800 chart objects during load, 14 global vars and <> 1000 code objects. Both run on Windows 8.1. No part of the code freezes, every function simply takes much longer to execute with MT5.
I passed this data to MQ and wait for an answer.
Getting back to the graphics issue. In the meanwhile I have some benchmarks and the comparison between Mt4 and MT5 is horrible. The main code is 1:1 the same, max 1 ChartRedraw within one ChartEvent, max one ChartRedraw during OnInit and creation of all objects:
1. Loading time: MT4 3 seconds, MT5 25 seconds!
2. OnChartEvent: MT4 creates approx 10 times more chartevents when the chart is resized (and bitmap objects are rebuilt) than MT5 does
3. Compilation time: MT4 2-3 seconds, MT5 1,5 minutes
Both platforms deal with the same code, it differs only in a few things which do not affect the benchmarks at all. Bot create <> 800 chart objects during load, 14 global vars and <> 1000 code objects. Both run on Windows 8.1. No part of the code freezes, every function simply takes much longer to execute with MT5.
I passed this data to MQ and wait for an answer.
Is this "test code" that you used for the tests, something which can be shared and run by others to obtain some independent benchmarks or is this code part of some private project of yours?
It would be useful if others could run some tests as well to get an overall idea of the performance under different conditions and setups.
EDIT: One thing that did get discussed here before, but I cant remember the thread name, was the MT4 handles the Graphic Object function processing synchronously and that MT5 handles them asynchronously. The difference could require that it be handled differently in order to achieve the same or better performance on MT5. Handling them as if synchronously on MT5 might be the cause of the handicap.
Getting back to the graphics issue. In the meanwhile I have some benchmarks and the comparison between Mt4 and MT5 is horrible. The main code is 1:1 the same, max 1 ChartRedraw within one ChartEvent, max one ChartRedraw during OnInit and creation of all objects:
1. Loading time: MT4 3 seconds, MT5 25 seconds!
2. OnChartEvent: MT4 creates approx 10 times more chartevents when the chart is resized (and bitmap objects are rebuilt) than MT5 does
3. Compilation time: MT4 2-3 seconds, MT5 1,5 minutes
Both platforms deal with the same code, it differs only in a few things which do not affect the benchmarks at all. Bot create <> 800 chart objects during load, 14 global vars and <> 1000 code objects. Both run on Windows 8.1. No part of the code freezes, every function simply takes much longer to execute with MT5.
I passed this data to MQ and wait for an answer.
In MT5, many functions are queued for execution.
For example, if you refuse to use "ObjectFind ()", the speed will grow at times.
Use Profiling to identify slow functions.
Debug -> Start Profiling
In MT5, many functions are queued for execution.
For example, if you refuse to use "ObjectFind ()", the speed will grow at times.
Use Profiling to identify slow functions.
Debug -> Start Profiling
I have my own benchmark measurements in the code and I know the bottlenecks. What you miss is the much higher speed with MT4, so the code is obviously not the problem. Its simply the fact that any function is simply executed much slower than in MT4 and in the end its the summary of it all.
Is this "test code" that you used for the tests, something which can be shared and run by others to obtain some independent benchmarks or is this code part of some private project of yours?
It would be useful if others could run some tests as well to get an overall idea of the performance under different conditions and setups.
EDIT: One thing that did get discussed here before, but I cant remember the thread name, was the MT4 handles the Graphic Object function processing synchronously and that MT5 handles them asynchronously. The difference could require that it be handled differently in order to achieve the same or better performance on MT5. Handling them as if synchronously on MT5 might be the cause of the handicap.
Since most of my projects (my own and for customers) as mostly non-graphical, I have yet to run into the problems I am sure you must be facing.
Your porting of ST to MQL5 is severely handicapped by this and I don't blame you for being so frustrated with the MetaTrader 5. If I were in your position, I would be blowing smoke out of ears and cursing everything around me!
I have my own benchmark measurements in the code and I know the bottlenecks. What you miss is the much higher speed with MT4, so the code is obviously not the problem. Its simply the fact that any function is simply executed much slower than in MT4 and in the end its the summary of it all.
I'm not telling you about your code, but about the features of MT5.
In MQL5, the function "ObjectFind ()" (and some others) is very slow.
What you missed is that I recommended you do Profiling and see it with your own eyes)
I do benchmarking with some macros. This is much more efficent to find bottlenecks because you get exact timings and surround the problem step by step. One should also keep in mind, that the code is really 1:1 between MT4 and MT5, its because I dont use any of the old MT4 functions and by this all code is almost 100% portable anyway.
I mention this because in view of this, any profiling cannot tell me anything new, thats the problem. Maybe I call one million functions during startup, maybe more, I dont know, and when every functions takes some microseconds more, in the end its a million times these microseconds.
What I see is, that any function which results in mainly updating a bitmap or a chart object, takes much more time than before. And this makes no sense, because I dont update the chart itself more often than with MT4 and modify non-bitmap chart objects only while they are invisible.
I dont use Objectfind at all. Maybe you have some ideas more?Since most of my projects (my own and for customers) as mostly non-graphical, I have yet to run into the problems I am sure you must be facing.
Your porting of ST to MQL5 is severely handicapped by this and I don't blame you for being so frustrated with the MetaTrader 5. If I were in your position, I would be blowing smoke out of ears and cursing everything around me!