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
Hi
Kindly help me with the following code.
I am creating an EA in which I want to open new chart with EURUSD M1 and apply the template in newly opened chart .
EURUSD chart is getting opened , but template is not getting apllied on newly opened chart EURUSD M1.
I have kept the template file in MQL4\Files folder.
Here is the code
CurrentOpenedChartId=ChartOpen("EURUSD",1);
if(FileIsExist("MA.tpl"))
{
Print("The file MA.tpl found in \\Files'");
//--- apply template
if(ChartApplyTemplate(CurrentOpenedChartId,"\\Files\\MA.tpl"))
{
Print("The template 'MA.tpl' applied successfully");
}
else
Print("Failed to apply 'MA.tpl', error code ",GetLastError());
}
else
{
Print("File 'MA.tpl' not found in "
+TerminalInfoString(TERMINAL_PATH)+"\\MQL4\\Files");
}