How to know a template is fully loaded? - page 2

 
Alain Verleyen #:

But it's your EA which manage to open the template ? Using some input from the user ?

The input from the user is just a template file name. Do you mean I edit the template file to include an Expert Advisor to manage the screenshot? But I do not have FileOpen access to template directory. Am I wrong?

 
Yashar Seyyedin #:

The input from the user is just a template file name. Do you mean I edit the template file to include an Expert Advisor to manage the screenshot? But I do not have FileOpen access to template directory. Am I wrong?

ChartApplyTemplate can handle template files from different folders:

The template file is searched according to the following rules:

  • If filename contains a path (starts with a backslash "\\" or a forward slash "/"), then the pattern is matched relative to the path terminal_data_directory/MQL5.
  • If there is no path in the name, the template is searched for in the same place where the executable of the EX5 file is located, in which the function is called.
  • If the template is not found in the first two places, it is searched for in the standard template folder terminal_dir/Profiles/Templates/.
There is also an example of tpl edition in the algobook.
MQL5 Book: Creating application programs / Working with charts / Working with tpl chart templates
MQL5 Book: Creating application programs / Working with charts / Working with tpl chart templates
  • www.mql5.com
MQL5 API provides two functions for working with templates. Templates are files with the extension tpl , which save the contents of the charts...
 
Stanislav Korotky #:

ChartApplyTemplate can handle template files from different folders:

Thanks for the useful info.

 
Yashar Seyyedin #:

The input from the user is just a template file name. Do you mean I edit the template file to include an Expert Advisor to manage the screenshot? But I do not have FileOpen access to template directory. Am I wrong?

Yes it's what I meant, as explained by Stanislav, MQL5\Files can be used with templates. You just need to be a bit creative, then experiment a bit to find your way to solve the issue. Can be some work but it's worth it.