Yes it does (ChartGetString - Chart Operations - MQL4 Reference) just not useful to you.
What are you going to do differently depending on the result?If you have the EA's code, have it create a Global Variable OnInit and remove it OnDeinit. Someting like «EA_NAME»_ «CHARTID».
You could also try creating a hard link between «DataFolder»/../templates/X.tpl and «DataFolder»/Files/X.tpl, call ChartSaveTemplate and then read the template looking for
<expert> name=«EA_NAME»
Thank you for your reply.
Unfortunately I don't have EA code. So Global Variable wouldn't work.
I may forcily apply template to some chart. The template may contain target EA. My code knows each chart who runs the target EA. In this way I don't need to detect but know the charts in advance.
Thank you very much
I use ChartFirst and ChartNext to iterate all charts and detect each chart if it has the specific EA. The link below helps.
![How can I detect by my Indicator code if an Expert is placed on the chart? How can I detect by my Indicator code if an Expert is placed on the chart?](https://c.mql5.com/36/50/how-can-i-detect-by-my-indicator.jpg)
- 2018.01.23
- www.mql5.com
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I'm writing a code to detect a chart that is running a specified EA. I know the EA name. In MQL5, I use ChartGetString(chart_id, CHART_EXPERT_NAME) to detect if a chart is running the specified EA. MQL4 does not have ChartGetString() but has WindowExpertName(). However, WindowExpertName() returns the caller's name, not the chart I'm detecting.
Anyone could help?
Thanks