How to get the window number of a indicator in the indicator?

 

I am placing the same indicator on the same chart and drawing objects on each of the two indicators. I next want to identify which object(s) belows to each indicator. I can get the window number from each object by using the ObjectFind(name) function. This returns the window index. Great. But I can't get the index of the calling indicator.

I have used the following function; WindowFind(WindowExpertName())

WindowExpertName gets the name of the current function, but it has been placed two. So it always gets the first one, even when I the second one does the calling.

Files:
 

Oh, I guess I don't know how to post questions.

the indicator I included just calls the name and makes an alert message of the result of WindowFind(WindowExpertName()). Place this function on a chart twice and you will see that it give the same result.

Reason: