No one knows?
string terminalDataPath = TerminalInfoString(TERMINAL_DATA_PATH);
ChartApplyTemplate(0,"\\Profiles\\Templates\\"+templateName1);
You can't read (or write) outside the sandbox with normal code.
File Write Problem (Error: 5002) - Expert Advisors and Automated Trading - MQL5 programming forum #1-2 (2020)
For security reasons, work with files is strictly controlled in the MQL5 language. Files with which file operations are conducted using MQL5 means, cannot be outside the file sandbox.
FileOpen - File Functions - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
File Write Problem (Error: 5002) - Expert Advisors and Automated Trading - MQL5 programming forum #1-2 (2020)
and FolderDelete using TERMINAL_DATA_PATH - General - MQL5 programming forum (2017)
File Path for saving .csv files in MT5 - MQL5 programming forum (2019)
File Operations via WinAPI - MQL4 Articles (2008)

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Not sure if this question is in the correct topic area.
If not apologize for it
I have a small script (NOT EA) and would like to apply chart templates when a change occurs.
In the end I even tried FUL path yet I keep getting error 5002 (sometimes 5019)
I used the folder above as well as \\MQL5\\Profiles\\Templates and the Files folder.
None of them works
I assume it would be possible to load a new template when I switch Symbol?
Does anyone know what I am doing wrong or am I trying to do something impossible?
Kind regards