metadevEU:
Can a remote server send data to my Expert advisor throughout socket so the EA can react to it asynchronously? I mean, I want my EA working normally and do something only when some data is received in the socket channel.
I don´t believe it is possible because it seems to me it uses only one thread, but I am asking here to confirm the limitation. I cannot use DLL (it runs in a VPS). It needs to be blazing fast.
If it's not possible I will just handle it using a combination of the onTimer and the onTick event handlers.
Only one thread.
So you need to integrate the socket check in your code. Either as timer event, or at the end of OnTick.
I would do both, just to make sure I have reasonable execution of my socket check.
Can be done.
Another option is to create a service, and have it notify your ea with the new data available, iE ChartEvents.
Got it. Thanks.
![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
Can a remote server send data to my Expert advisor throughout socket so the EA can react to it asynchronously? I mean, I want my EA working normally and do something only when some data is received in the socket channel.
I don´t believe it is possible because it seems to me it uses only one thread, but I am asking here to confirm the limitation. I cannot use DLL (it runs in a VPS). It needs to be blazing fast.
If it's not possible I will just handle it using a combination of the onTimer and the onTick event handlers.