When I set something to do with OnTimer, setting 1 millisecond takes longer than if I call this function when reacting to an event. Why?
" When working in real-time mode, timer events are generated no more than 1 time in 10-16 milliseconds due to hardware limitations. "
- www.mql5.com
https://www.mql5.com/en/docs/eventfunctions/eventsetmillisecondtimer
" When working in real-time mode, timer events are generated no more than 1 time in 10-16 milliseconds due to hardware limitations. "
Since OnChartEvent is faster then, is there any way to create "dummy" events without necessarily having to interact with metatrader 4?
Since OnChartEvent is faster then, is there any way to create "dummy" events without necessarily having to interact with metatrader 4?
This timer limitation goes back all the way to the OS, you would need special real time OS to go bellow the 10-16 millisecond barrier.
Even if you generated the events, there would be no garantee they would be executed in less the 10-16ms.
This is why people that code real HFTs have highly speciallized code connected directly to the exchange(in the case of brazil, B3 has the PUMA system).
What are you repeatedly doing when nothing has changed (no onChart, no onTick)?
A possible use case would be HFTs, tracking something like "if no order has been executed in X ms, do something", but I don't believe metatrader
would be a good tool in this case, too many abstraction layers.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
When I set something to do with OnTimer, setting 1 millisecond takes longer than if I call this function when reacting to an event. Why?