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

 

Hello Raminzk,

Is the EA working well., cause in my case its not copying any trades. after the update, maybe we should change something in the folders?

Anybody can help?

 
raminzk:

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
that's ok, thanks
 
currencyscalper:

Hello Raminzk,

Is the EA working well., cause in my case its not copying any trades. after the update, maybe we should change something in the folders?

Anybody can help?

I am working on it, if I get any output I will post it here, did you get any error or warning during runtime?
 

Finally I have reached a working version in new MT4 without any array out of range error, restrictions on installation of meta trader terminals and windows UAC interference. For this reason and also some incompatibilites I've changed the 2 files and have attached new versions to this post.

Now I will explain step by step:

1. Install MT5 any where you want. I installed on default C:\ProgramFiles

2. Install new MT4 any where you want. I installed on default C:\ProgramFiles   -  at runtime these 2 programs will be moved to [user]\AppData\Roaming\MetaQuotes\Terminal\

3. Run cmd.exe as administrator and run mklink command to make a link between a virtual folder witch you point to it in your mt4 runing expert(copyist_positions_V2.mq4) and the MT5 "Files" folder.

(the Translator_Positions_V2.mq5 is changed to write the file into Files folder of its installed position)

The command would be something like this:

mklink /D "C:\Users\Ramin\AppData\Roaming\MetaQuotes\Terminal\50CA3DFB510CC5A8F28B48D1BF2A5702\MQL4\Files\Link2MT5_DataFolder" "C:\Users\Ramin\AppData\Roaming\MetaQuotes\Terminal\D0E8209F77C8CF37AD8BF550E51FF075\MQL5\Files"

You can easily copy these 2 long addresses from address bar when you run "open data folder" item of each terminal from file menu.

The name "Link2MT5_DataFolder"  refers to a virtual folder witch you can select it as copyist_positions_V2 parameter. BUT make sure the name you select as expert parameter and the name you use in command line are the same.

4. Attach the experts to terminals and do not forget to set the parameter "link_folder_name"of the copyist_positions_v2 to the name you selected for virtual folder,here: Link2MT5_DataFolder

5. The programs run correctly, but there is still a problem witch some time trades are copied with delays at the order of several minutes!!!??

Thanks to nikolay for this good article...


 
raminzk:

Finally I have reached a working version in new MT4 without any array out of range error, restrictions on installation of meta trader terminals and windows UAC interference. For this reason and also some incompatibilites I've changed the 2 files and have attached new versions to this post.



For the following lines, should this now be set to have FILE_UNICODE instead of FILE_ANSI ??

//--- open file for writing, shared read mode
   int han=FileOpen(filename+".csv",FILE_WRITE|FILE_SHARE_READ|FILE_ANSI,",");
 

Another question, would it be better to use the common folder for the shared file?

 

ie C:\Users\<your name>\AppData\Roaming\MetaQuotes\Terminal\Common 

 
BP33:
For the following lines, should this now be set to have FILE_UNICODE instead of FILE_ANSI ??

AS I know the ANSI file format is suitable for CSV files witch are infact text files
 
BP33:

Another question, would it be better to use the common folder for the shared file?

 

ie C:\Users\<your name>\AppData\Roaming\MetaQuotes\Terminal\Common 

it is not important, you can use common folder but you should use appropriate address to point this location in file opening. I've used the default address. when you do not specify an address in file opening commands, the file is generated on files folder
 
raminzk:
it is not important, you can use common folder but you should use appropriate address to point this location in file opening. I've used the default address. when you do not specify an address in file opening commands, the file is generated on files folder
Ok, thanks :)
 
thanks for your work raminzk it help me a lot .