Discussion of article "How to Copy Trading from MetaTrader 5 to MetaTrader 4" - page 3

 

RaptorUK:
Perhaps it is a UAC issue,  try installing in a folder other than Program Files,  for example C:\MT4Installs\  

 

Thanks for the explanation and suggestion.

Tried new installs of Metatrader 5 to "C:\MetaTrader 5 (2nd)\"  and Metatrader 4 to "C:\MetaTrader 5 (2nd)\MQL5\Files\MT4\", but still having the same errors when running the "copyist positions" script. My operating system is Windows 8.

I'm thinking it might what the "Translator positions" file is doing as it does not seem to write a file for "copyist positions" to read. I might have to break down a learn a little mql5 to understand it. It seems like the "copyist_positions" script would be better suited as an EA rather than a script. I have an MT4 to MT4 trade copier which works great. I'm having a hard time finding a MT5 to MT4 trade copier that works.

 

 

I think the problem is to do with where Metatrader stores the data. In the most recent versions of Windows it does not use subfolders of the installation folder.

On server 2008 (in my case) MT5 uses:
C:\Users\[username]\AppData\Roaming\MetaQuotes\Terminal\[long hex number]\MQL5\etc...

Each terminal installation uses it's own folder in this location with a unique [long hex number].  I tried installing MT4 in the above folder path but it also reads and writes from it's own unique data folder so that doesn't work either.  In any case, executing programs from this location is probably not a good idea.

I suspect this is the issue on Windows 8 as well.

I'm stuck for ideas at this point, but hope this information is useful.

 

My MT4 data file locations on Windows Server 2008:

C:\Users\[username]\AppData\Local\VirtualStore\Program Files\[name of MT4 program folder]

I'm guessing that the OS is redirecting file operations.

 

4103 - error opening file, means that MT5 is writing trades to some file, and MT4 can't 'find' it.

This is happening because MT5 functions differently from MT4. In MT5 the folder where we install, is different from which it is run. For example, I installed MT5 in C:\Accounts\MT5, and MT4 in C:\Accounts\MT5\MQL\Files\MetaTrader 4.

MT5 created a folder C:\Users\[username]\AppData\Roaming\MetaQuotes\Terminal\[long hex number]\MQL5\etc... and actually runs from here. So MT5 is writing the trades somewhere in this folder.

As by the original article, MT4 should be 'inside' the MT5 folder. So the solution lies in making the MT5 install folder "SAME" as the run folder. And the simplest way is:

1. uninstall all MT5 instances

2. Delete the folder 'Metaquotes' from C:\Users\[username]\AppData\Roaming\

Now we will make install folder same as run folder: 

3. Reinstall MT5. It should not be in Program files folder, make it for example C:\Accounts\MT5. While installing, uncheck 'launch after finish' (critical step)

4. BEFORE running MT5 for the first time, right click MT5 shortcut on the desktop, click properties, add "/portable" to the path, without quotes. So it will be C:\Accounts\MT5\terminal.exe /portable. (Note that there is a space after terminal.exe, forward slash, portable without any capital letter). Click OK.

Now we will install MT4, copy EAs, and run terminals

5. Install MT4 in C:\Accounts\MT5\MQL\Files\MetaTrader 4. (Note that the folder name MetaTrader 4, or whatever it is, should be identical to the name in EAs)

6. Copy Translator and Copyist EA in respective folders.

7. Run both MT5 master and MT4 slave.

8. Enjoy !!! 

Tip: Do not proceed to next step, if something is not done properly. 

Sorry for using 'non technical' language, this is maximum what you can expect from a doctor!

 
doctornasir:

4103 - error opening file, means that MT5 is writing trades to some file, and MT4 can't 'find' it.

This is happening because MT5 functions differently from MT4. In MT5 the folder where we install, is different from which it is run. For example, I installed MT5 in C:\Accounts\MT5, and MT4 in C:\Accounts\MT5\MQL\Files\MetaTrader 4.

MT5 created a folder C:\Users\[username]\AppData\Roaming\MetaQuotes\Terminal\[long hex number]\MQL5\etc... and actually runs from here. So MT5 is writing the trades somewhere in this folder.

As by the original article, MT4 should be 'inside' the MT5 folder. So the solution lies in making the MT5 install folder "SAME" as the run folder. And the simplest way is:

1. uninstall all MT5 instances

2. Delete the folder 'Metaquotes' from C:\Users\[username]\AppData\Roaming\

Now we will make install folder same as run folder: 

3. Reinstall MT5. It should not be in Program files folder, make it for example C:\Accounts\MT5. While installing, uncheck 'launch after finish' (critical step)

4. BEFORE running MT5 for the first time, right click MT5 shortcut on the desktop, click properties, add "/portable" to the path, without quotes. So it will be C:\Accounts\MT5\terminal.exe /portable. (Note that there is a space after terminal.exe, forward slash, portable without any capital letter). Click OK.

Now we will install MT4, copy EAs, and run terminals

5. Install MT4 in C:\Accounts\MT5\MQL\Files\MetaTrader 4. (Note that the folder name MetaTrader 4, or whatever it is, should be identical to the name in EAs)

6. Copy Translator and Copyist EA in respective folders.

7. Run both MT5 master and MT4 slave.

8. Enjoy !!! 

Tip: Do not proceed to next step, if something is not done properly. 

Sorry for using 'non technical' language, this is maximum what you can expect from a doctor!

Thanks for taking the time to write that.

Another way is to keep the default installation settings and make the connection between the two folders with a symbolic link.

http://en.wikipedia.org/wiki/NTFS_symbolic_link

 

 Hi

do you excuse the ignorance but the files "Translator_positions " ed "Copyist_positions " where you they must be installed?.

 

Thanks 

 
xorpheus:

Thanks for taking the time to write that.

Another way is to keep the default installation settings and make the connection between the two folders with a symbolic link.

http://en.wikipedia.org/wiki/NTFS_symbolic_link

I alredy made what you explain, but it does not copy pending orders, what can i do  to crrect this?
Documentation on MQL5: Standard Constants, Enumerations and Structures / Trade Constants / Order Properties
  • www.mql5.com
Standard Constants, Enumerations and Structures / Trade Constants / Order Properties - Documentation on MQL5
 
trofeotrofeo:
I alredy made what you explain, but it does not copy pending orders, what can i do  to crrect this?
I don't think the code is intended to copy pending orders.  That would create complicated problems.  It simply makes sure you have the same net position in slave MT4 terminal compared with master MT5 terminal.
 

the copyist_positions which is run on mt4 does not accepted on new mt4 build 600. whenever I try to add expert to a chart terminal replies "copyist_positions  is not an expert and can not be executed"!!!!!! while it is compiled and run at previous mt4 builds


any one has any idea about this?

 
raminzk:

the copyist_positions which is run on mt4 does not accepted on new mt4 build 600. whenever I try to add expert to a chart terminal replies "copyist_positions  is not an expert and can not be executed"!!!!!! while it is compiled and run at previous mt4 builds


any one has any idea about this?

thanks to alexvd problem resolved!

alexvd:


Remove or comment the line

#property show_inputs



It is property of scripts so the new compiler decides that it is a script
Reason: