Download MetaTrader 5

ChartApplyTemplate() is not working

To add comments, please log in or register
Do you want to write a trading robot? Find solution in MQL5 Reference!
YogeshVerma
15
YogeshVerma 2016.11.15 05:53 

Dear Users,

I am trying to apply a Custom template using EA in MT4 platform but it is not getting applied on chart. 

I tried with following options;

ChartApplyTemplate(0,"\\Custom.tpl");

ChartApplyTemplate(0,"Custom.tpl");

ChartApplyTemplate(0,"C:\\Users\\xxxxxxxx\\AppData\\Roaming\\MetaQuotes\\Terminal\\1DAFD9A7C67DCE4FE37EAA1FC1E5CF75\\templates\\Custom.tpl");

My Template is in the following directory  :  Users\xxxxxxxx\AppData\Roaming\MetaQuotes\Terminal\1DAFD9A7C67DCE4FE37EAA1FC1E5CF75\templates\Custom.tpl

I am using Meta Editor 5 Build 1384. Meta Trader 4 Build 1010.

Please advice !

 

Thanks & Regards !

Yogesh Verma 

Marco vd Heijden
Moderator
4701
Marco vd Heijden 2016.11.15 07:34  

What does the journal say ?

Did you print last error ?

YogeshVerma
15
YogeshVerma 2016.11.15 09:57  
Marco vd Heijden:

What does the journal say ?

Did you print last error ?

 

Hi Marco,

 

I am using below code to apply template, it is printing "applied successfully" but actually template contents are not reflecting. This template contains my 3 custom indicators and some display settings but these are not getting displayed after apply.

if(ChartApplyTemplate(0,"Custom.tpl")) 
        { 
         Print("The template 'Custom.tpl' applied successfully"); 
        } 
      else {
         Print("Failed to apply 'Custom.tpl', error code ",GetLastError()); 

     } 

 Please advice. 

Marco vd Heijden
Moderator
4701
Marco vd Heijden 2016.11.15 10:05  
Does it work when you manually load it ?
YogeshVerma
15
YogeshVerma 2016.11.15 10:19  
Marco vd Heijden:
Does it work when you manually load it ?

When I am manually applying it, it is stopping the EA, dont know why ?

 

Can we apply custom indicator on Chart Sub Window from EA using CODE ?

Marco vd Heijden
Moderator
4701
Marco vd Heijden 2016.11.15 10:35  
Documentation on MQL5: Chart Operations / ChartIndicatorAdd
Documentation on MQL5: Chart Operations / ChartIndicatorAdd
  • www.mql5.com
Chart Operations / ChartIndicatorAdd - Reference on algorithmic/automated trading language for MetaTrader 5
To add comments, please log in or register