There is no distinction between a manually added indicator or one added via code, so your proposed work-around ideas are viable options.

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hello - I have written an indicator that uses the OnChartEvent event that draws lines onto the chart. When this indicator is loaded by an EA using IndicatorCreate, drawing the indicator on the chart is not required. Although not drawn on the chart, the function for drawing the lines is still run. Can someone suggest a way to detect if the indicator has been added to the chart via IndicatorCreate vs added to the chart in the usual way?
The only way I can think of is by passing an extra setting to the indicator via MqlParams in IndicatorCreate or by communicating between the EA and Indicator using a global variable.
Thank you.