OK thanks. But I am confused. After using the iCustom function, you need to add the EA with the ChartIndicatorAdd function.It is valid?
chart = ChartOpen("EURUSD",15);
Thank you very much
I think there is an extensive article somewhere here. Try looking it up
Start asking a proper question. Stop asking how do I do this with this, and start stating what are you trying to do. How To Ask Questions The Smart Way The XY Problem
Your code adds an indicator to the current chart and saves a template, then opens another chart and applies the template. A) That will not work, it takes time for the chart to open, and you have no delay. B) If the current chart doesn't already have the EA on it, neither does the template and then other chart.
Setup a chart the way you want it (including the EA) and save the template. Then you can have code open another chart and apply it, or have it applied by default. The template ordering for new charts is «EAname».tpl, (if tester) tester.tpl, (if offline chart) offline.tpl, and Default.tpl.
Or drop your code completely and just open another chart. What are you trying to do?