Discussion of article "Working with sockets in MQL, or How to become a signal provider" - page 7
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
Hi, This code works on MQL4 ?
I'm trying to port it to mql4, and when the DLL bind() function is called at MQL StartServer function, gives me the message below:
Another super useful article!
This option is much more convenient than files and DB.
Thanks camarad ;)
Hi, works fine on MT4.
Tx mate. Incredible code!
Hello, Trying to change this to MQL4 but running into issues due to Trade.mqh requirement on signalclient. How did you go about it?
If you could, please share your MT4 version as well, it will help newbies like me out.
Regards
I started copying trades, put an Expert Advisor (server/client) on the charts of each traded symbol for multicurrency Expert Advisor, the Expert Advisor generated a lot of trades during the evening-night-morning, but some trades were lost according to the copied volumes.
I.e. as a minimum it is necessary to add a periodic check for the need for intermediate synchronisation of server and client position volumes, similar to the way it works in the Signals service.
Well, and after emergency reloading of terminals the server sends messages to clients for some reason that it has zero positions (although it is not true), and clients obediently close their positions. These are such observations.
Thank you for the article with examples, I will make a service of signals on their basis.
S.Y.:
Очевидно, что данные примеры сервера, рассылающие любому клиенту информацию, не являются оптимальными. К примеру, вы наверняка захотите ограничить доступ к своей информации. Значит, как минимум, к обязательным требованиям необходимо отнести:
how can this be implemented? zero knowledge of this (even running a server/client on a local machine, some left client connected to the server).
How can this be implemented? zero knowledge of this (even running a server/client on the local machine, some left client connected to the server).
https://www.mql5.com/en/code/15534
Thanks, I'm gonna go look into it.
Well, after emergency reloading of terminals the server sends messages to clients for some reason that it has zero positions (although it is not true), and clients obediently close their positions. Such observations.
I understand that all sorts of misunderstandings with positions occur because of the moments when the terminal has started, but has not yet connected to the trading server, and the sockets are raised at once and either the server sends information about the lack of positions to clients and they cover the positions they have, or the client receives information from the server about positions and until he sees his own - hurries to open them, backing up the available volumes. I understand that a preliminary check of terminal connection with the trading server will solve these misunderstandings.
Otherwise, the stability of sockets is pleasing.
Added:
One damn takki slip from the server messages with zero volumes of positions, which is not true, I do not understand how this happens and where these zeros are taken.
If not closed market positions would have collapsed for some reason....
H.Y.: and it happens once in a while, once you reload terminals - everything is normal, as it should be, and the other time it closes everything to zero....
Alexey ( @o_o ), if you know where to dig, please.
I rebooted the terminals afterwards, and no problems, everything worked as it should....
dig in the server. where it determines how many lots it has open by symbol
Add error checks for MQL position request functions, etc.
Add a printout there to see that it was MQL that returned zeros and not the socket that was stupid.
I removed OnTrade() from OnInit()-and OnTrade() to begin with, maybe this will be the end of the mess.
H.I.: It didn't end. But a couple of checks for terminal connection with the trade server seem to have solved the problem.
Hi all,
I'm compiling on MQL5 and I keep getting the error:
at the line:
EDIT:
For those interested, I solved by manually copying the fields from one struct to another.
Here's the code:
I might add that I had many compilation errors on some WSA error codes, which I had to import manually from winsock.h, and on the function: