Error 5002 when using ChartApplyTemplate function

 

Hi,


I utilized an indicator, saved the template (hi.tpl), and then tried to load it but it doesn't work. I always received error number 5002. Any advice?



                 long   Chart_ID[1]

                 Chart_ID[1]=ChartOpen("EURCAD",15); //1

                 bool x;

               //MetaQuotes\Terminal\50CA3DFB510CC5A8F28B48D1BF2A5702\templates


               x= ChartApplyTemplate(Chart_ID[1],TerminalInfoString(TERMINAL_DATA_PATH)+"\\templates\\hi.tpl");

               

               Print("working or not working    :", GetLastError());



Thank you in advance.

 
  1. Don't paste
code
    Play video
    Please edit your post.
    For large amounts of code, attach it

  2. long   Chart_ID[1]
    Chart_ID[1]=ChartOpen("EURCAD",15); //1
    Only post code that actually compiles.
  3. If the array has one element how can you store a value in element one? You would know that if you had used strict.
  4. ChartApplyTemplate(Chart_ID[1],TerminalInfoString(TERMINAL_DATA_PATH)+"\\templates\\hi.tpl");
    Had you read the documentation you would know that the path is already in the call. "hi.tpl" is all you need.
Reason: