Download MetaTrader 5

Error 5002 when using ChartApplyTemplate function

To add comments, please log in or register
Samer Gowid
Samer Gowid  


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;


               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
    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.
To add comments, please log in or register