ChartApplyTemplate returns true but nothing changes

 

I want to show automatically a template on the chart when I use my EA, So I used 

Alert(ChartApplyTemplate(0,"My_template.tpl");

When I run my EA, the Alert returns True, but my template is not applied. (I also tried without the "Alert")

The template works fine when I add it manually.


Any idea where this comes from?

 

I have exactly this problem. GetLastError gives a 0. Applying the template manual is working.

The function ChartApplyTemplate is simply doing NOTHING, only giving a true back, great :(

Other templates in the same directory, which only differ in 1 or 2 settings are applied normally. Also apllying in a loop with a Sleep(200) between the calls is not working...

Documentation on MQL5: Chart Operations / ChartApplyTemplate
Documentation on MQL5: Chart Operations / ChartApplyTemplate
  • www.mql5.com
ChartApplyTemplate - Chart Operations - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 
Yes i have same problem ... can you solve that ?
 
derFux #: Also apllying in a loop with a Sleep(200) between the calls is not working...

That makes the problem. The function simply queues the apply. Until you return, nothing will ever happen.

 

Yes I finally successfully loaded my template ... in the same chart , mt4 not allow to you load template and EA together ...

if you run a EA and load any template in the same chart , the ea remove from chart !

if you want load a template with ea you must open a new chart with ea and load template on that , otherwise not worked and you get true from chartapplytemplate function but chart not change !

i'm sorry about my bad english ...

I hope it helped you

best regards