There is no difference; templates can have either or both.
OK thanks. But I am confused. After using the iCustom function, you need to add the EA with the ChartIndicatorAdd function.It is valid?
void OnStart() { long chart; int h; h=iCustom(NULL,0,"C:\Program Files\MetaTrader\MQL5\Experts\EAexample"); ChartIndicatorAdd(0,1,h); ChartRedraw(); ChartSaveTemplate(0,"pru"); chart = ChartOpen("EURUSD",15); ChartSetInteger(chart,CHART_SHOW_OBJECT_DESCR,true); if(chart!=0) { ChartApplyTemplate(chart,"pru"); } }This does not work. I want to load an EA in a new chart.
Thank you very much
OK thanks. But I am confused. After using the iCustom function, you need to add the EA with the ChartIndicatorAdd function.It is valid?
This does not work. I want to load an EA in a new chart.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?
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Thank you very much