if(FileIsExist("\templates\normal.tpl")){
All file accesses are in the sandbox; you do not specify the path. «DataFolder»/Files or «DataFolder»/tester/files. You are trying to read «DataFolder»/Files/templates/normal.tpl.
You can't read (or write) outside the sandbox with normal code.
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)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi everyone,
I want to apply a custom template, so that my EA immediately starts to change/show the chart with that template. It is called "normal.tpl"
Before, I want to check if that file is existing. So I print my terminal data path
which prints
G:\Meine Ablage\Trading\MetaTrader 4 IC Markets
and ask if there is the file I want to apply. I read in the documentation
It always prints NOT FOUND.
Same with
or
or
Yet, to try everything, I manually under windows copied the file "normal.tpl"
- in G:\Meine Ablage\Trading\MetaTrader 4 IC Markets\normal.tpl
- in G:\Meine Ablage\Trading\MetaTrader 4 IC Markets\templates\normal.tpl
- in G:\Meine Ablage\Trading\MetaTrader 4 IC Markets\MQL4\normal.tpl
- in G:\Meine Ablage\Trading\MetaTrader 4 IC Markets\MQL4\templates\normal.tpl
I am sure it is a very simple problem, yet I struggle to find the correct file path