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
Well, cant say anything on the threads being used for the indicators. - But I can say, OnCalculate is being called for every tick received. - We had prooven that. - I dont know when calls will be skipped, might be, if the event queue is full, but as it seems, its a long way until that happens.
https://www.mql5.com/en/forum/454153
Well, here is my part of citations:
Forum on trading, automated trading systems, and trading strategy testing
Indicators are missing ticks on the Exchange
fxsaber , 2016.09.14 15:43
The indicator shows how many ticks the Calculate event skips compared to the History
Result
The same thing, of course, happens with experts (the Tick event). While Forex indicators don't miss ticks (they didn't catch them), expert advisors do.
Please note that there are situations where the tick history (with an accuracy of 1ms) contains fewer entries with the same time than the indicator calls. In this case, the indicator was called 17 times with identical ticks, but there is only one such tick in the history.
The discovered bug, when CopyTicks and Event are not synchronized on the last tick , has been taken into account.
Forum on trading, automated trading systems, and trading strategy testing
Indicators are missing ticks on the Exchange
fxsaber , 2016.09.20 10:28
ScriptResult
More details at the beginning of the chart
If an indicator takes 1 ms to execute, it can lag by several hundred ms. Sometimes it can lag by 5 seconds even if OnCalculate takes 6 ms to execute. And if OnCalculate takes as long as 50 ms to calculate, the lag can exceed a minute! And the lag depends greatly on the instrument. The higher the tick frequency, the higher the indicator lag.
Clearly, there can be no talk of any execution of indicators on every tick (like, indicators should not skip ticks)!
Guys, this topic is about CopyBuffer() and iCustom call, given the platform as IT IS.
If you want to talk about how it should be or other platform "mechanics" please open an other topic.
Guys, this topic is about CopyBuffer() and iCustom call, given the platform as IT IS.
If you want to talk about how it should be or other platform "mechanics" please open an other topic.
Guys, this topic is about CopyBuffer() and iCustom call, given the platform as IT IS.
If you want to talk about how it should be or other platform "mechanics" please open an other topic.
We are all just do not know how IT IS behind the scene, without clarifications from MQ. This is why our last resort is the collective investigation of the matter from different aspects.
And synchronization of different threads (from where API functions are called and events are fired) is apparently related to queueing technique used in the terminal. And queueing can be (currently) investigated by ticks/events flow only. So the posts are on topic, imho.
@Dominik Egert @Stanislav Korotky
Ok.
The conclusion is already clear : CopyBuffer (called once or several times for a given handle) is thread safe : the EA thread and the indicator thread are synchronized "somehow".
What is unclear is the mechanism used. So we can investigate that together, but please stay on topic.
Later I will open a more general topic on the MT5 platform mechanics in general.
We are all just do not know how IT IS behind the scene, without clarifications from MQ. This is why our last resort is the collective investigation of the matter from different aspects.
And synchronization of different threads (from where API functions are called and events are fired) is apparently related to queueing technique used in the terminal. And queueing can be (currently) investigated by ticks/events flow only. So the posts are on topic, imho.
Ok maybe but then please provide data, logs, code, etc...
I don't really see the pertinence of your links to fxsaber 2016 posts.
The conclusion is already clear : CopyBuffer (called once or several times for a given handle) is thread safe : the EA thread and the indicator thread are synchronized "somehow".
What is unclear is the mechanism used. So we can investigate that together
I'm more or less convinced that the single call to CopyBuffer is synchronized with the indicator referenced by handle, but I doubt that the synchronization persists between numerous calls.
Ok maybe but then please provide data, logs, code, etc...
If you mean some info about the queues, then as a user I don't know anything about internals - only the fact that the chart and every interactive MQL5-program have their queues of events (including ticks), and this is a part of the synchronization mechanism, because otherwise any thread would have to wait/freeze a lot. Possibility of skipping ticks are related to the queueing, and I don't know at the moment at which degree it's related or not related to our research.
My test codes are similar to what has been already published. I can't yet trap a moment when buffer reading would be inconsistent, but this in itself does not guarantee that such problem can not occur at all.
@Alain Verleyen
Hi Alain, do you have any news about developers?
I also couldn't get an incosistent buffer reading at the moment, in the tests i did. But a confirm by MQ would be appreciated, if not due.