Annoying Window Object Indexing.

 
Slawa,

I am trying to display an Object at the Indicator window.
Without adding any extra windows the WindowsTotal() function will sometime return window count 2 or 3 in which case the index of my objects get shifted. Is it a Bug?
How can I keep this from happening?
How can I have my objects assign to a window which corresponds to same window as is my indicator window?
 
I don't understand your problem.
Please example with step by step explanations
 
I don't understand your problem.
Please example with step by step explanations

Slawa,
My problem is very simple.
Case 1) I have only chart and indicator window opened and WindowsTotal() is showing 3 windows opened.
Why?
Case 2) Before, with the same configuration the WindowsTotal() was showing 2 windows opened.

So when the 3 windows are opened I must specify window #2 in the ObjectCreate() and when the 2 windows are opened I must specify window #1 in the ObjectCreate().

Case 4) If I open another indicator above, the WindowsTotal() is showing 4 windows opened and I must specify window #3 in the ObjectCreate()

Case 5) Now I have removed the above indicator and have only one indicator, same as in the Case 1 , and WindowsTotal() i showing 2 windows opened [please notice discrepancy in the window count], and I must reassign the ObjectCreate() to #1 window.

That it self is illogical!

Regardless of how many windows I have opened the object assignment should not change.
Am I missing something?
Is there any assignment like local indicator window?

So my question is: How can I assign the objects to my indicator window so it will not change with the amount of windows opened.
 
WindowsTotal returns 3 and You see main chart and only one indicator subwindow - it means one additional subwindow is hidden (see property page "Visualization"). Press Ctrl-I and You can see indicators list and nodes "Indicator window 1", "Indicator window 2". You can use WindowIsVisible function to detect visibility.

There is common practice in C/C++, numeration begins from 0, because array indexes begin from 0. And this state is logical!

Please read documentation: "Notes: The chart sub-windows (if there are sub-windows with indicators in the chart) are numbered starting from 1. The chart main window always exists and has the 0 index.", "The returned index is the number of window (0-chart main menu, subwindows of indicators are numbered starting from 1)..."
 
WindowsTotal returns 3 and You see main chart and only one indicator subwindow - it means one additional subwindow is hidden (see property page "Visualization"). Press Ctrl-I and You can see indicators list and nodes "Indicator window 1", "Indicator window 2". You can use WindowIsVisible function to detect visibility.

There is common practice in C/C++, numeration begins from 0, because array indexes begin from 0. And this state is logical!

Please read documentation: "Notes: The chart sub-windows (if there are sub-windows with indicators in the chart) are numbered starting from 1. The chart main window always exists and has the 0 index.", "The returned index is the number of window (0-chart main menu, subwindows of indicators are numbered starting from 1)..."


Slawa,

You are still not getting my point, so again:

Case 1) Main window = 0, My Indicator window=1, Total windows=2

Now I will open additional indicator in following sequence:

Case 2) Main window = 0, My Indicator window=1, Additional Indicator window=2, Total windows=3

Now I will open additional indicator in following sequence:

Case 3) Main window = 0, Additional Indicator window=1, My Indicator window=2, Total windows=3

Please notice difference between Case 2 & 3 where window #No of My Indicator changed with indicator sequence position so the objects of My Indicator became invisible in the Case 3
 
To detect subwindow number, please use WindowFind function. Use it at start.
int index=WindowFind("My Indicator");
 
To detect subwindow number, please use WindowFind function. Use it at start.
int index=WindowFind("My Indicator");

Thanks Slawa,
That is what I was looking for.
Have a nice weekend.
Reason: