Features of the mql5 language, subtleties and tricks - page 101

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
Result
Yes, I didn't take into account the internal work of Sleep, which takes about 4 ms on my computer.
A good alternative to Sleep (who cares about accuracy :)) is
I can not guarantee the accuracy of the coefficient 0.995. I picked it up for my computer. It may be good for all.
To be honest, I don't even know what it means and where in MQL5 one can encounter it.
This means that spikes are possible in any situation, even in synchronous functions. The only thing to do is to be aware of them and not to pay attention to them, because it cannot be solved.
https://en.wikipedia.org/wiki/InterruptIn addition to files and global variables, there is another way to transfer information between programs
Forum on trading, automated trading systems and trading strategies testing
Libraries: TradeTransactions
fxsaber, 2018.09.20 16:23
In addition to files and global variables, there is another way to transfer information between programs
We're talking about programs within a single running terminal, right?
We are talking about programs within a single running terminal, right?
Yes. That's why global variables are mentioned.
And between Terminals I've started to use this way.Yes. That's why global variables are mentioned.
And between Terminals started using this way.Yes, it's really cool!
Very cool find using RAM disks instead of SSDs.
Yes. That's why global variables are mentioned.
And between Terminals I used this way.I have been using such an easy semi-hacking method using user32.dll for a long time. But it is impossible to pass the tick arrays in that way.
I invented it a long time ago, when I was still mastering MQL4. Of course, it is not the shortest solution in terms of reasonable organization of the exchange, but it works fast and well (maybe faster than all existing solutions), that's why I haven't racked my brains anymore.
Besides, this method does not require any additional action.
The idea is that for the whole Windows there is a common for all variable of string type - the name of the main Windows window. All can change it and all can see it.
I've been using such an easy semi-hacker way for a long time, using user32.dll. But you can't transfer tick arrays that way.
If you use dll, there is a universal solution for all types of data.
but it works fast (maybe faster than all existing solutions)
First of all, it goes through message queue. Secondly, you have to do some additional conversions (back and forth). Plus there's some validation going on.
By the way, you shouldn't write the size of the structure explicitly. That's what sizeof is for.
If you use dll, then there is a universal solution for all types of data.
I'm not arguing. Your solution is really more universal.
But personally I need the bridge between terminals only to transfer the current tick.
My version is just easier to understand because of its primitiveness and slightly faster. I measured it in comparison with yours - it is 1.5 - 2 times faster. Reading one tick is 90 microseconds vs. 160 microseconds.