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

 

I did think that I have been a bit confused since from others' program coding about fileopen function, they do check the error 4103 like the following:

int start()
{
int Handle, nbre=0;//, sens=2, ticket=3333;
string File_Name="trading.txt", sens=2, ticket=3333;
//-----Lecture-------------------------------------------------------+
Handle=FileOpen(File_Name,FILE_CSV|FILE_READ,";");// File opening
if(Handle<0) // File opening fails
{
if(GetLastError()==4103) // If the file does not exist,..
Alert("No file named ",File_Name);//.. inform trader
else // If any other error occurs..
Alert("Error while opening file ",File_Name);//..this message
PlaySound("Bzrrr.wav"); // Sound accompaniment

return; // Exit start()

Actually, I compiled the source https://c.mql5.com/2/8/copyist_positions.mq4 successfully with some debug displays added and this program was run as a script.  The following error occurred in the Experts window:

22:02:25 Copyist_positions EURUSD,M1: Error opening file 4103,Translator positionsHandle=-1

22:02:30 Copyist_positions EURUSD,M1: Error opening file 4103,Translator positionsHandle=-1

22:02:30 Copyist_positions EURUSD,M1: ArrayInitialize function internal error

The integer handle is clearly not equal to zero and fileopen function failed (though 4103 may not be the exact error code referring to this error since it's just got from getlasterror()?).

 

Much appreciated for any feedback for the above. 

 
I set up the copier everything works fine, but today after closing sell at stoploss the copier started to open positions in the same direction at the same price with the same stoploss and immediately close! What is the problem? How to trace what made it open?
 
maxxttro:
I set up the copier everything works fine, but today after closing sell at stoploss the copier started to open positions in the same direction at the same price with the same stoploss and immediately close! What is the problem? How to trace what made it open?
Apparently the stoploss on MT4 was reached earlier than on MT5. This is possible with the difference in quotes.
 

Hi,

would it be possible to rewrite the master part from MQ5 to MQ4? To be both usable on MT4 platform? Any idea how to convert, please?


Thanks a lot

 
is it possible to make a fixed lot for opening a position in Mt4 ? not a coefficient but for example 0,01 lot.
 
x5fx:
is it possible to make a fixed lot for opening a position in Mt4 ? not a coefficient but for example 0.01 lot.

You can, I have such a version, but only the Market does not work yet.

By the way, the bug from the previous post is fixed there too.

 
Urain:

You can, I have this version, but only the Market is not working yet.

By the way, the bug from the previous post is fixed there too.

can you upload it somewhere ?
i already have the market open 30 min ago :)
 
maxxttro:
I set up the copier everything works fine, but today after closing sell at stoploss the copier started to open positions in the same direction at the same price with the same stoploss and immediately close! What is the problem? How to trace what made it open ?

Since I mentioned this bug, I will answer it once again.

To fix the bug, it is enough to extend the copied stops, it will not affect the results of trading because the stops in MT4 will be triggered only when the connection is lost, and the bug will disappear because the achievement of stops in MT4 will occur after the stops in MT5, so the copier will copy the position closing.

 
x5fx:
can you post it somewhere?
I already had the market open 30 minutes ago :))

And that there is an opportunity to make purchases? As far as I know operations of real purchases do not work yet.

For those who know how to do it, there is a balloon article, and those who don't know how to do it, please be kind enough to pay.

 
Urain:

And that there is an opportunity to make purchases? As far as I know operations of real purchases do not work yet.

For those who know how to make purchases, a balloon article has been written, and those who don't know how to make purchases should be kind enough to pay.

Market means market.