Can we determine whether an indicator is attached or if it is being run through iCustom? - page 2

 
collierab:

hi szgy74,

thanks for the response. however, i am not sure that i understand you.

for the bare-bones indicator code below:



really, I thought only of separate windows, it seems this will not work on chart indicators at all.


I thought that when you want to find out the method of calling the indicator based on the WindowFind result, you will not see iCustom calls when the same indicator is also attached to the same chart (in a separate window). In other words in this case the result will be the same from the EA iCustom call and from the indi attached to the chart.

However, I don't know how could this be managed with WindowFind, as long as it is not possible to know what is attached to the (main) chart.

My first suggestion is still applicable, when you have the source code of the indicator.


Another hard way is to analyze all *.chr files under MT4/profiles/ to find the chart you need and the indicators on it.

 
collierab:

hi szgy74,

thanks for the response. however, i am not sure that i understand you.

for the bare-bones indicator code below:

if i attach this to a chart then it outputs "on window -1" in the Experts tab of the terminal. this is not what i would have expected. the indicator is attached to the main chart, so i would have thought that WindowFind() would return 0. i naively thought that in the case that the indicator were not actually attached to anything [for example, if it were called through iCustom()] only then would it return -1.

have i got the wrong end of the stick here?

thanks, andrew.

Why are you searching such difficulties when szqy74 shows you an easy solution ? Maybe, for your specific issue you can also simply delete with the EA, all objects created by your indicator ?
Reason: