How to copy signal in local Area Network environment from 1 PC to another

 

Dear experienced traders


Do you know any way to copy signal in local Area Network environment from 1 PC to another? 

We designed an EA which is very heavy, and we need a super PC to decide the position, after that we still have to use some lower spec PCs to follow. 


We already know some way to copy the signal in internet environment, but because of the network risk we don't what to use it. 

In the other hand, we also know some technology to copy the signal from one terminal to another in a same PC, but the technology do not fit to this case...

Do you know any way to copy signal in local Area Network environment from 1 PC to another? 


Thank you in advance and best regards for you

 
Zhang Fengqun:

Dear experienced traders


Do you know any way to copy signal in local Area Network environment from 1 PC to another? 

We designed an EA which is very heavy, and we need a super PC to decide the position, after that we still have to use some lower spec PCs to follow. 


We already know some way to copy the signal in internet environment, but because of the network risk we don't what to use it. 

In the other hand, we also know some technology to copy the signal from one terminal to another in a same PC, but the technology do not fit to this case...

Do you know any way to copy signal in local Area Network environment from 1 PC to another? 


Thank you in advance and best regards for you

What technology and what doesn't fit ?

 
Zhang Fengqun:

Dear experienced traders


Do you know any way to copy signal in local Area Network environment from 1 PC to another? 

We designed an EA which is very heavy, and we need a super PC to decide the position, after that we still have to use some lower spec PCs to follow. 


We already know some way to copy the signal in internet environment, but because of the network risk we don't what to use it. 

In the other hand, we also know some technology to copy the signal from one terminal to another in a same PC, but the technology do not fit to this case...

Do you know any way to copy signal in local Area Network environment from 1 PC to another? 


Thank you in advance and best regards for you

There are such utilities in the Market.

 
Zhang Fengqun: Do you know any way to copy signal in local Area Network environment from 1 PC to another? We designed an EA which is very heavy, and we need a super PC to decide the position, after that we still have to use some lower spec PCs to follow. We already know some way to copy the signal in internet environment, but because of the network risk we don't what to use it. n the other hand, we also know some technology to copy the signal from one terminal to another in a same PC, but the technology do not fit to this case... Do you know any way to copy signal in local Area Network environment from 1 PC to another? 

Just use standard network socket communications. It is built into MQL5 and it even supports secure TLS (SSL) connections. It works for both WAN and LAN communications.

If however you are using MQL4, then just use sockets via WinAPI to achieve the same thing.

Its simple, secure and is used by almost every type of network communications protocol on the Internet (and Intranet). What more could you ask for?
 
May I ask how you can do a socket connection within mql5 from one EA to another EA?

As far as I understand, socket functions in MQL5 itself only support Clientside part of the socket functionality.

Is it true, this can only be achieved by WinAPI?

Same goes for Named Pipes, right?

The only built-in interprocess communication directly supported by MQL5 would be by file, global variable (terminal) and database.

Am I missing something here?
 
Dominik Egert: May I ask how you can do a socket connection within mql5 from one EA to another EA? As far as I understand, socket functions in MQL5 itself only support Clientside part of the socket functionality. Is it true, this can only be achieved by WinAPI? Same goes for Named Pipes, right? The only built-in interprocess communication directly supported by MQL5 would be by file, global variable (terminal) and database.Am I missing something here?

Yes, absolutely correct. MetaTrader and MQL only support the client-side, but you can code a very simply Windows Service to serve as a hub or exchange (running on one PC) where all EAs (on multiple PCs) can connect to and establish communications with one another. Think of it as the equivalent of an Ethernet Hub or Switch but for socket communications.

In my case a created a very simple protocol, where the client establishes a connection, with a unique ID code and a Channel ID. Then when ever any messages is sent to a Channel, the service, relays that message to all members of that channel. I implement both an active relay (messages are sent immediately) or passive relay (messages are queued and collected by the client when requested).

I'm using mine on private networks, but if needed you could create an equivalent solution as a webservice on a 3rd-party web hosting provider, so as to act as a hub for various EA's running at different locations on the Internet or VPS. In such a case, the protocol would need a little more overhead and security but the idea would be equivalent to what I use privately.

Since I have never used MQL5 VPS system, I can't say for sure, but I believe it should work as long as the address has been added to the allowed URLs, which would allow for such a Webservice (equivalent of the Hub/Exchange) to function in these cases as well.

EDIT: Also, if needed, you could have multiple redundant Hubs running and have the EAs automatically switch when a connection is lost, but in my case that would be overkill. I have not implemented that.

EDIT2: Using the channel system I have in place, the EAs can establish which ever protocol is needed on top of it. It simply serves as an exchange or hub and nothing else.
 

Continuing from my previous post, instead of coding one's own "hub", you could use existing open-source solutions for Advanced Message Queuing Protocol (AMQP) or Simple (or Streaming) Text Oriented Message Protocol (STOMP).

These obviously are more sophisticated and have higher overhead, but they are also more robust, are available on different platforms, and work for both LAN and WAN requirements.

There are several open-source projects that implement AMQP and/or STOMP, so it is a question of choosing one that best fits your needs (here are a few):

 
Thank you for elaborating in such detail. Great answer.

An intermediate solution for local and distributed systems I would go with an MySQL instance as central data hub for interchanging. In a private surrounding, using VPN.

But I guess it depends very much on the requirements.

One main advantage of MySQL is it's redundancy and cluster capabilities as well as having detailed logs of anything happening. On application level as well as server level.

Drawback is, client programs cannot be MQL only in such a constellation. This implies, the code cannot be run on VPS.
 
Dominik Egert: An intermediate solution for local and distributed systems I would go with an MySQL instance as central data hub for interchanging. In a private surrounding, using VPN. But I guess it depends very much on the requirements. One main advantage of MySQL is it's redundancy and cluster capabilities as well as having detailed logs of anything happening. On application level as well as server level. Drawback is, client programs cannot be MQL only in such a constellation. This implies, the code cannot be run on VPS.
Yes, unfortunately MQL5 Databases only supports SQLite and not also MySQL. In order to work with MySQL from a MQL5 VPS, you would need write a MySQL client in pure MQL using sockets, which would probably be too complex.
 
Eleni Anna Branou:

There are such utilities in the Market.

Thank you so much, dear. 

 
Fernando Carreiro:

Yes, absolutely correct. MetaTrader and MQL only support the client-side, but you can code a very simply Windows Service to serve as a hub or exchange (running on one PC) where all EAs (on multiple PCs) can connect to and establish communications with one another. Think of it as the equivalent of an Ethernet Hub or Switch but for socket communications.

In my case a created a very simple protocol, where the client establishes a connection, with a unique ID code and a Channel ID. Then when ever any messages is sent to a Channel, the service, relays that message to all members of that channel. I implement both an active relay (messages are sent immediately) or passive relay (messages are queued and collected by the client when requested).

I'm using mine on private networks, but if needed you could create an equivalent solution as a webservice on a 3rd-party web hosting provider, so as to act as a hub for various EA's running at different locations on the Internet or VPS. In such a case, the protocol would need a little more overhead and security but the idea would be equivalent to what I use privately.

Since I have never used MQL5 VPS system, I can't say for sure, but I believe it should work as long as the address has been added to the allowed URLs, which would allow for such a Webservice (equivalent of the Hub/Exchange) to function in these cases as well.

EDIT: Also, if needed, you could have multiple redundant Hubs running and have the EAs automatically switch when a connection is lost, but in my case that would be overkill. I have not implemented that.

EDIT2: Using the channel system I have in place, the EAs can establish which ever protocol is needed on top of it. It simply serves as an exchange or hub and nothing else.

Thank you so much, Fernando. 

Your answer is very helpful. 

Reason: