I am very appreciated you said that:" I have plans to develop the MQL4 emulator, which will allow you to run your MQL4 programs in new MetaTrader 5 client terminal."
I am not a good programme designer but a trader. MQL5 is too difficult for me.
Also be careful on the precedence. I spent half a day debugging a logic and found that the precedence of && and || are different between MQL4 (|| first) and MQL5 (&& first). So in migrating from MQL4 to MQL5, make sure you search through all the comparison expressions.
This article is a quick guide to MQL4 language functions, it will help you to migrate your programs from MQL4 to MQL5. For each MQL4 function (except trading functions) the description and MQL5 implementation are presented, it allows you to reduce the conversion time significantly. For convenience, the MQL4 functions are divided into groups, similar to MQL4 Reference.
Also be careful on the precedence. I spent half a day debugging a logic and found that the precedence of && and || are different between MQL4 (|| first) and MQL5 (&& first). So in migrating from MQL4 to MQL5, make sure you search through all the comparison expressions.
Each group of operations in the table has the same priority. The higher the priority of operations is, the higher it is position of the group in the table. The precedence rules determine the grouping of operations and operands.
Attention: Precedence of operations in the MQL5 language corresponds to the priority adopted in C++, and differs from the priority given in the MQL4 language.
If only one chart window is open. Then the ID of this window of = -1
-
My mistake, it is true. :)
int WindowHandleMQL4(string symbol,
int tf)
{
ENUM_TIMEFRAMES timeframe=TFMigrate(tf);
long currChart,prevChart=ChartFirst();
int i=0,limit=100;
while(i<limit)
{
currChart=ChartNext(prevChart);
if(i==0)currChart=prevChart; // Wenn nur ein Chartfenster offen istif( currChart<0) break;
if(ChartSymbol(currChart)==symbol
&& ChartPeriod(currChart)==timeframe)
return((int)currChart);
prevChart=currChart;
i++;
}
return(0);
}
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
How about OrderMagicNumber() ? Thanks
How about OrderMagicNumber() ? Thanks
iBarShift() is easy to use but iBarShiftMQL4() is quite complex. And so on...
Why both "TickValue() and SymbolInfoDouble(_Symbol,SYMBOL_TRADE_TICK_VALUE)" always return "0"?!
Hi, Rosh:
I am very appreciated you said that:" I have plans to develop the MQL4 emulator, which will allow you to run your MQL4 programs in new MetaTrader 5 client terminal."
I am not a good programme designer but a trader. MQL5 is too difficult for me.
Waiting for your MQL4 emulator. TKS a Million!
Best Wishes for you.
I found a mistake
If only one chart window is open. Then the ID of this window of = -1
-
Also be careful on the precedence. I spent half a day debugging a logic and found that the precedence of && and || are different between MQL4 (|| first) and MQL5 (&& first). So in migrating from MQL4 to MQL5, make sure you search through all the comparison expressions.
Also be careful on the precedence. I spent half a day debugging a logic and found that the precedence of && and || are different between MQL4 (|| first) and MQL5 (&& first). So in migrating from MQL4 to MQL5, make sure you search through all the comparison expressions.
You are right. See Precedence Rules:
Each group of operations in the table has the same priority. The higher the priority of operations is, the higher it is position of the group in the table. The precedence rules determine the grouping of operations and operands.
Attention: Precedence of operations in the MQL5 language corresponds to the priority adopted in C++, and differs from the priority given in the MQL4 language.
I found a mistake
If only one chart window is open. Then the ID of this window of = -1
-
My mistake, it is true. :)
Hello
I will be pleased to know if all these functions have been validated, I didn't succed
to make the function "CopyBufferMQL4" working.
Thank you
Noel