
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
Print and Alert are not asynchronous?
I wanted to make these functions asynchronous. Tried an implementation through ChartEvent - it works. But it is very slow. I had dug this out.
Gave up such an expensive function in critical places.
On the subject of Alert.
So far we can say for sure that Alert in critical places is not possible. Asynchrony is needed.
Reproduced the SymbolInfoTick brakes. And no stress test. Practical necessity makes you write it that way.
Follow this instruction for quick replay.
Forum on trading, automated trading systems and trading strategy testing
Synchronous OrderSend reports successful execution faster than ping to trade server
fxsaber, 2020.09.30 20:36
On a fast machine the result with 30 characters in Market Watch.
I hope I'm not the only one who is reproducing. Of course, the lag is not as big as shown earlier. But it will be possible to get to the bottom of the causes much quicker here.
ZZY TimeCurrentMsc is not input in MQL5 for some reason, in spite of repeated requests.
Gave up such an expensive function in critical places.
This is a significant drawback. Because the MQL event model is incomplete - there is no zero event, i.e. the event that is called when there are no other events in the queue. It can be emulated through a custom event. But taking into account this disadvantage, the event model is meaningless for those who are interested in speed
EventChartCustom is expensive.
What about withoutChartFirst()?
How about without ChartFirst()?
It's more expensive to send to someone else's chart than to your own.
This is a significant flaw. Because the MQL event model is incomplete - there is no null event, i.e. an event that is called when there are no other events in the queue. It can be emulated through a custom event. But with this drawback in mind, the event-based model is meaningless for those who are interested in speed
OnTimer allows you to make background calls with frequency up to 16 ms.
Correct, i.e. we lose at least16ms to nothing (we can come back at the earliest).And we could not lose them if there was a free zero event or free custom events. And now the event model in the case below works limitedly:
Forum on trading, automated trading systems and trading strategy testing
MT5 and speed in action
fxsaber, 2020.10.06 01:27
You are completely out of the loop. Let's say you need to open two positions in OnTick. The first OrderSend is a few milliseconds. After it you have to make a snapshot. And then the second OrderSend should be called.
Only OnTick can be executed for hundreds of milliseconds. And you suggest to snapshot some OnTimer.
On the subject of Alert.
For now, it's safe to say that Alert can't be used in critical places. Asynchrony is needed.
Alert with a print, you can try to replace it with a quick write somewhere.
Native sql in memory comes to mind
I wasn't suggesting a snapshot, I was answering a direct question about the millisecond timer.
I often use the fact that the Tester has exactly a millisecond timer, not a second timer. Proof.
Result.
There is exactly 29 ms between opening and closing time of the position.