Does the template work if you load it manually ?
I do not have the MA.tpl but i tried with Volume.tpl and this works fine... i had to copy the Volume.tpl from template folder to the Files folder do.
long CurrentOpenedChartId=ChartOpen("EURUSD",1); if(FileIsExist("Volume.tpl")) { Print("The file Volume.tpl found in \\Files'"); //--- apply template if(ChartApplyTemplate(CurrentOpenedChartId,"\\Files\\Volume.tpl")) { Print("The template 'Volume.tpl' applied successfully"); } else Print("Failed to apply 'Volume.tpl', error code ",GetLastError()); } else { Print("File 'Volume.tpl' not found in " +TerminalInfoString(TERMINAL_PATH)+"\\MQL4\\Files"); }
Marco vd Heijden:
I do not have the MA.tpl but i tried with Volume.tpl and this works fine... i had to copy the Volume.tpl from template folder to the Files folder do.
Thanks a lot buddy. Now its working........
Instead of long data type , I was using int.
Thanks again.
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 applying template in newly opened chart.
it is throwing an error message err 4051 invalid function parameter value.
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");
}
//---