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

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
Copying from mt4 -> mt5 and back using your method
works fine - only with mt5 -> mt4 there is a delay.
because there is no counter there. But in general it works fine.
And for W7 / Vista the terminal should be placed in the common folder MetaQuotes\Terminal\.
is a bit depressing. But there is a desire to write a simple program (not mql)
with a cycle of 1 sec - which would copy files from the folder
mt4 to mt5 and back if they are available. So as not to touch terminals
Copying from mt4 -> mt5 and back using your method
works fine - only with mt5 -> mt4 there is a delay.
because there is no counter there. But in general it works fine.
And for W7 / Vista the terminal should be placed in the common folder MetaQuotes\Terminal\.
is a bit depressing. But there is a desire to write a simple program (not mql)
with a cycle of 1 sec - which would copy files from the folder
mt4 to mt5 and back if they are available. So as not to touch terminals
I get these warnings when compiling. Granted, they are just warnings and not errors.
Compiling 'Copyist_positions.mq4'...
'cmd' - comparison expression expected C:\Program Files\MetaTrader 5\MQL5\Files\Metatrader 4\experts\scripts\Copyist_positions.mq4 (120, 46)
'cmd' - comparison expression expected C:\Program Files\MetaTrader 5\MQL5\Files\Metatrader 4\experts\scripts\Copyist_positions.mq4 (122, 46)
0 error(s), 2 warning(s)
The above refers to these two lines of code:
//--- open price
double price_open(string symbol,int cmd) {if(cmd%2)return(bid(symbol));else return(nd(symbol,ask(symbol)));}
//--- close price
double price_close(string symbol,int cmd){if(cmd%2)return(ask(symbol));else return(nd(symbol,bid(symbol)));}
I'm thinking that "if(cmd%2)" should be changed to "if(cmd<2)" , but I'm not sure.
I get these errors when running the above script in MT4
2013.02.26 06:16:38 Copyist_positions EURUSDm,H1: Error opening file 4103
2013.02.26 06:16:38 Copyist_positions EURUSDm,H1: ArrayInitialize function internal error
Here is the path I used to install Metatrader 4 and used to the run script:
C:\Program Files\MetaTrader 5\MQL5\Files\Metatrader 4\experts\scripts
It looks like a few people are having the same problems. Any help on how to fix the problems or a new clean version of the file would be appreciated.
I get these warnings when compiling. Granted, they are just warnings and not errors.
Compiling 'Copyist_positions.mq4'...
'cmd' - comparison expression expected C:\Program Files\MetaTrader 5\MQL5\Files\Metatrader 4\experts\scripts\Copyist_positions.mq4 (120, 46)
'cmd' - comparison expression expected C:\Program Files\MetaTrader 5\MQL5\Files\Metatrader 4\experts\scripts\Copyist_positions.mq4 (122, 46)
0 error(s), 2 warning(s)
The above refers to these two lines of code:
//--- open price
double price_open(string symbol,int cmd) {if(cmd%2)return(bid(symbol));else return(nd(symbol,ask(symbol)));}
//--- close price
double price_close(string symbol,int cmd){if(cmd%2)return(ask(symbol));else return(nd(symbol,bid(symbol)));}
I'm thinking that "if(cmd%2)" should be changed to "if(cmd<2)" , but I'm not sure.
Here is the path I used to install Metatrader 4 and used to the run script:
C:\Program Files\MetaTrader 5\MQL5\Files\Metatrader 4\experts\scripts
It looks like a few people are having the same problems. Any help on how to fix the problems or a new clean version of the file would be appreciated.
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.
But there was a desire to write a simple program (not mql)
with a cycle of 1 sec - which would copy files from the folder
mt4 to mt5 and back if they are available. So as not to touch terminals
I made a simple copier. We set from where, to where and copying interval.
Start copying with the "Save/start" button. During the work it will blink ))).
In Translator positions.MQ5 you can change the line int han=FileOpen(subfolder+"\\\experts\\\files\\\"+folder+".csv",FILE_WRITE|FILE_SHARE_READ|FILE_ANSI,","); to int han=FileOpen(folder+".csv",FILE_WRITE|FILE_SHARE_READ|FILE_ANSI,","); i.e. the file will be written to the \\Program Files\MetaTrader 5\MQL5\Files folder.