I tested in build 1345:
I can confirm that both WindowFind and ChartWindowFind return the wrong number according to the documentation:
ChartWindowFind
...
Return Value
Subwindow number in case of success. In case of failure the function returns -1.
void OnStart() { //--- Print(WindowFind("MA(21)"),",",ChartWindowFind(0,"MA(21)")); Print(WindowFind("RSI(14)"),",",ChartWindowFind(0,"RSI(14)")); }
0 18:57:13.649 Script _ Test\test-WindowFind GBPUSD,Daily: loaded successfully
0 18:57:13.661 test-WindowFind GBPUSD,Daily: initialized
0 18:57:13.662 test-WindowFind GBPUSD,Daily: 1,1
0 18:57:13.662 test-WindowFind GBPUSD,Daily: 2,2
0 18:57:13.662 test-WindowFind GBPUSD,Daily: uninit reason 0
0 18:57:13.663 Script test-WindowFind GBPUSD,Daily: removed
I tested in build 1345:
I can confirm that both WindowFind and ChartWindowFind return the wrong number according to the documentation:
0 18:57:13.649 Script _ Test\test-WindowFind GBPUSD,Daily: loaded successfully
0 18:57:13.661 test-WindowFind GBPUSD,Daily: initialized
0 18:57:13.662 test-WindowFind GBPUSD,Daily: 1,1
0 18:57:13.662 test-WindowFind GBPUSD,Daily: 2,2
0 18:57:13.662 test-WindowFind GBPUSD,Daily: uninit reason 0
0 18:57:13.663 Script test-WindowFind GBPUSD,Daily: removed
Having problems since some days to display objects in a subwindow.
On some MT4-versions it works on others not.
Maybe what you say is the problem.
How we can fix that if one clients terminal gives window number = 1 (sub-window) and another gives 2?
I just found this same problem. My indicator needs to draw buttons in subwindow 1 where the indicator is.
However, the WindowFind() says it finds the indicator in subwindow 2 which does not exist.
Hence i get the 4206 err and no buttons created.
The main chart is now window index 1 instead of window index 0.
int subWindowNo; subWindowNo = WindowFind("WindowName"); if (TerminalInfoInteger(TERMINAL_BUILD) == 1345) { subWindowNo = subWindowNo - 1; }

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use