How to make a trade copier EA?

 

Hello everyone,

I want to write my own trade copier, because all available paid and unpaid do not meet my needs.

 What are the basic principles of making trade copier EA?

We have 3 accounts live/demo with 20 traders each varying just the lot size. We have full acess to those accounts login/pass/investor pass.  

Is it possible to remotely login to those accounts and copy trades to my account using EA? Or what are the critearias? because i haven't found

any mql4 file of a trade copier to look inside.

 

Thanks for help, lets make a trade copier EA :) 

 
Georgiy Liashchenko:

Hello everyone,

I want to write my own trade copier, because all available paid and unpaid do not meet my needs.

 What are the basic principles of making trade copier EA?

We have 3 accounts live/demo with 20 traders each varying just the lot size. We have full acess to those accounts login/pass/investor pass.  

Is it possible to remotely login to those accounts and copy trades to my account using EA? Or what are the critearias? because i haven't found

any mql4 file of a trade copier to look inside.

 

Thanks for help, lets make a trade copier EA :) 

google for NamedPipe or Sockets - but be aware one side could be blocked. There is even a solution that uses normal file in the codebase.
 
https://www.mql5.com/en/code/14085
Simple Copier
Simple Copier
  • votes: 25
  • 2015.11.16
  • Vladimir Tkach
  • www.mql5.com
Copying utility with minimal functionality.
 
Alain Verleyen:
https://www.mql5.com/en/code/14085
Thanks a lot, but it transfers trades only within local pc right? How can it be done remotely? My first thought is to locate the file on some website and using webrequest() do write/read file.
 
Georgiy Liashchenko:
Thanks a lot, but it transfers trades only within local pc right? How can it be done remotely? My first thought is to locate the file on some website and using webrequest() do write/read file.
Sockets but this has to coded in another language than mt5 I guess
 
Carl Schreiber:
Sockets but this has to coded in another language than mt5 I guess
Lets think how a socket pair can be established in mt4 :) perhaps by .dll import file, we just need to create or find a proper file. But again if i understood correctly, the socket requires IP adress and it is ok if IP is static and we can predefine the IP in sender/reciever. But most of connections and mine particularly uses Dynamic IP, which means I will not be able to recieve data unless i tell somehow my new IP tp a sender.
 

There are tries to connect mt4 to a socket - but finally I gave up :(

https://www.mql5.com/en/forum/149633

https://www.mql5.com/en/forum/151932

Those are normally in one way connections. A two way connection therefore needs two socket-channels.

FIX has a socket channel for sending orders and another channel to receive quotes and confirmations ...

And the socket-server - the one who listens/waits for a connection blocks until it got something - like OnTick() nothing happens until a tick was sent.

A dll-solution is possible but not needed. You can e.g. use a PowerShell-Script as server or client ...

Client-Server-Socket functions for mt4 >= Build 600 - MQL4 forum
Client-Server-Socket functions for mt4 >= Build 600 - MQL4 forum
  • www.mql5.com
Client-Server-Socket functions for mt4 >= Build 600 - MQL4 forum
 
Carl Schreiber:

There are tries to connect mt4 to a socket - but finally I gave up :(

https://www.mql5.com/en/forum/149633

https://www.mql5.com/en/forum/151932

Those are normally in one way connections. A two way connection therefore needs two socket-channels.

FIX has a socket channel for sending orders and another channel to receive quotes and confirmations ...

And the socket-server - the one who listens/waits for a connection blocks until it got something - like OnTick() nothing happens until a tick was sent.

A dll-solution is possible but not needed. You can e.g. use a PowerShell-Script as server or client ...

Thanks, i will have a look. Currently i am reading a solution regarding named pipes, but it is for mt5 so perhaps it can be adapted to mt4

 https://www.mql5.com/ru/articles/115

Although it in Russian :) 

Реализация взаимодействия между клиентскими терминалами MetaTrader 5 при помощи именованных каналов (Named Pipes)
Реализация взаимодействия между клиентскими терминалами MetaTrader 5 при помощи именованных каналов (Named Pipes)
  • 2010.07.01
  • investeo
  • www.mql5.com
Данная статья знакомит с реализацией межпроцессного взаимодействия между терминалами MetaTrader 5 посредством именованных каналов (named pipes). Предложен класс CNamedPipes, реализующий возможность использования именованных каналов. Рассмотрен тиковый индикатор для тестирования связи между двумя клиентскими терминалами MetaTrader 5 и измерения общей пропускной способности системы. Представленный метод взаимодействия оказался пригодным для отправки котировок в реальном времени.
 
NamedPipes are bound to one pc as there medium is a kind of file writing and reading!
 
Carl Schreiber:
NamedPipes are bound to one pc as there medium is a kind of file writing and reading!

so there is no way to use named pipes via web?

i found another article, https://www.mql5.com/en/articles/503 here it states that pipes can be used in the network but in mt5 at least... 

Communicating With MetaTrader 5 Using Named Pipes Without Using DLLs
Communicating With MetaTrader 5 Using Named Pipes Without Using DLLs
  • 2012.10.15
  • MetaQuotes Software Corp.
  • www.mql5.com
Many developers face the same problem - how to get to the trading terminal sandbox without using unsafe DLLs. One of the easiest and safest method is to use standard Named Pipes that work as normal file operations. They allow you to organize interprocessor client-server communication between programs. Take a look at practical examples in C++ and MQL5 that include server, client, data exchange between them and performance benchmark.
 
And again, other trade copiers do communicate somehow. I am talking about copiers via web no just a local machine, they do it somehow, question is How?
Reason: