Build 1065 save template in subfolder issue

 

With the new MT4 build 1065 I can't save the template when I try to save it into a sub folder of the templates folder that I've previously created. The script worked perfectly until the new version. The code fragment is the following

string tipoOp;
  
  if (lineCheck == 5 && prezzoMedio < ordOpen && ordOpen < ordTP) {tipoOp = "BUYSTOP";} 
  if (lineCheck == 5 && prezzoMedio > ordOpen && ordOpen < ordTP) {tipoOp = "BUYLIMIT";}
  if (lineCheck == 5 && prezzoMedio > ordOpen && ordOpen > ordTP) {tipoOp = "SELLSTOP";}  
  if (lineCheck == 5 && prezzoMedio < ordOpen && ordOpen > ordTP) {tipoOp = "SELLLIMIT";} 
  
  if (lineCheck == 5)
   {
      string nome = "/templateOperativi/"+Symbol()+"_"+tipoOp;
      ChartSaveTemplate(0,nome);
      Comment("Template salvato con nome: ",nome, " alle ore: ", TimeToString(TimeCurrent(),TIME_MINUTES), " del giorno ", TimeToString(TimeCurrent(),TIME_DATE));
   }

If I remove the part "/templateOperativi/"+ then the template is correctly saved inside the standard templates folder.

Is there a way to fix it?


Thanks

 
In Windows a path must look like: "\\templateOperativi\\" !
 
Carl Schreiber:
In Windows a path must look like: "\\templateOperativi\\" !


Hi Carl, Thank you for your quick reply. Unfortunately if I try to substitute "/templateOperativi/" with "\\templateOperativi\\" then it doesn't work. And if  try to substitute with "\templateOperativi\", then I've got some compiling errors.

Any other ideas? 

 
  1. I don't know whether Metatrader templates are 'allowed' to use sub folder?
  2. Does the log tell you anything?
  3. Does the folder exist (where)?
  4. Windows or Wine?
 
2DD: I try to substitute "/templateOperativi/" with "\\templateOperativi\\" then it doesn't work.
You want to store it as a subfolder of template. "\\templateOperativi" is a subfolder of the root folder. I.e. C:\program files\..." Try dropping the leading back slash(s)
 
Carl Schreiber:
  1. I don't know whether Metatrader templates are 'allowed' to use sub folder?
  2. Does the log tell you anything?
  3. Does the folder exist (where)?
  4. Windows or Wine?

1. Yes it worked before, so it was allowed

2. No, the log didn't tell anything unfortunately

3. Yes the folder exists. Really the behavior is similar to what happened before when the subfolder didn't exists: simply the template was not saved with out any error message.

4. Windows 8 under Parallels (MacOs). That's an interesting observation indeed. Have to deepen this.


Anyway could you help me trying if in your system it works please?

 
whroeder1:
You want to store it as a subfolder of template. "\\templateOperativi" is a subfolder of the root folder. I.e. C:\program files\..." Try dropping the leading back slash(s)


Yes I want to store the templates into a subfolder of the standard folder (example: installation_Path\templates\templateOperativi\).

This is because my script sets up automatically another chart with a subset of the objects (this new chart is more clear and readable for some manual operation tasks). I need these simplified charts to be easily accessed and copied by other EAs or me, so it's very handy to save them in a different (segregated) location.

Actually I've worked around this issue adding a prefix to the name of the new templates, but it's a dirt way to go IMO.

Reason: