ChartApplyTemplate() on different chart closes EA settings dialog – expected behavior?

 
Hi,

I noticed that calling ChartApplyTemplate() on a different chart seems to close the EA properties dialog on the current chart.

Steps to reproduce:
1. Attach the test EA (code below) to Chart A
2. Open the EA properties dialog on Chart A within 20 seconds
3. The EA opens a new EURUSD chart (Chart B) and applies a template to it
4. The properties dialog on Chart A closes, even though the template was applied to Chart B

I would expect the dialog on Chart A to remain open since ChartApplyTemplate() targets a different chart. In MT4, the settings dialog remains open, as expected.

Tested on Version 5.0 build 5640.

Is this expected behavior or a bug? I couldn't find any documentation mentioning this side effect.

Test EA attached below.

Thanks for any clarification!
EURUSD (Euro vs US Dollar): Live Forex Charts
EURUSD (Euro vs US Dollar): Live Forex Charts
  • 2026.02.24
  • www.mql5.com
EURUSD exchange rate has changed by -0.06% for today. During the day, the instrument was traded at a low of 1.17659 and at a high of 1.17962