![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
Why an offline chart ? Just don't use OnTick()...ah maybe you are thinking there is an overheid on a normal chart even without using OnTick() ?
Asynchronous orders can be done if you really need it, but in MT4 is it really worth it ? Well, depends of the strategy I suppose.
Let's just say I have a strategy... Here's my reasoning for offline (inactive) charts
Let's just say I have a strategy... Here's my reasoning for offline (inactive) charts
On what evidence is this based ?
There is not any latency if OnTick() is not used. If it's use why a 2-60ms latency ? That doesn't exist unless I misunderstood what you mean.
An OnTimer loop interrupted by ticks ? no such things unless I misunderstood what you mean.
I think you are overcomplicating things and searching solution to non-existent problems. But if I am wrong please explain and show it.
Let's just say I have a strategy... Here's my reasoning for offline (inactive) charts
a) I would use OnTimer() in a offline chart to poll for prices. That means that I should be careful to poll for new prices; even then, polling at 50 ms can be much better than having a dozen of charts open with OnTick() on every single one
b) Have a second chart to handle orders signaled from the chart above. There should be no point for async orders in MT4, simulated or not. After, I should make sure consecutive orders of a single symbol are not messed up
regards
On what evidence is this based ?
There is not any latency if OnTick() is not used. If it's use why a 2-60ms latency ? That doesn't exist unless I misunderstood what you mean.
An OnTimer loop interrupted by ticks ? no such things unless I misunderstood what you mean.
I think you are overcomplicating things and searching solution to non-existent problems. But if I am wrong please explain and show it.
Oh boy... here we go again......
I posted the evidence earlier in the thread, and you even tested it out yourself and posted the results. Since you likely skimmed the posts in between, it was discovered that the latency in the ping was due to the behind the scenes post-processing of the OnTick event. The latency can vary depending on how many symbols in market watch and for no reason at all, and it is most certainly due to the OnTick event. If you want more obvious proof then run this EA on a live chart for a bit then look at the logs... then do the same on an offline chart. The delays from tick events are obvious, on my end at least.
a) I would use OnTimer() in a offline chart to poll for prices. That means that I should be careful to poll for new prices; even then, polling at 50 ms can be much better than having a dozen of charts open with OnTick() on every single one
b) Have a second chart to handle orders signaled from the chart above. There should be no point for async orders in MT4, simulated or not. After, I should make sure consecutive orders of a single symbol are not messed up
regards
I appreciate the thoughts, but...
Oh boy... here we go again......
I posted the evidence earlier in the thread, and you even tested it out yourself and posted the results. Since you likely skimmed the posts in between, it was discovered that the latency in the ping was due to the behind the scenes post-processing of the OnTick event. The latency can vary depending on how many symbols in market watch and for no reason at all, and it is most certainly due to the OnTick event. If you want more obvious proof then run this EA on a live chart for a bit then look at the logs... then do the same on an offline chart. The delays from tick events are obvious, on my end at least.
Checking...
I just expressed my opinion, if you can't manage contradictions or misunderstandings you should not post on a public forum. Please stop that attitude.
Checking...
You attack my position on 100% of the threads that I start... This is the cycle between you and I...
You attack my position on 100% of the threads that I start... This is the cycle between you and I...
I was just trying to understand what you mean. I asked you to explain your view and you got mad once again.
Banned 1 week for repeated trolling, coming to non-existent personal issues each time someone "contradict" or ask question. Enough is enough.
After my own test :
OnTimer Min loop : 16ms even if you ask 1ms (As it's said in the doc)
So a While loop with Sleep(1) would be more efficient.
For the OnTick() Function lantency don't know I'll code something to test that and keep you posted.