If you want the current chart, there is the function WindowHandle() from MQL and you may find some other, probably usefull functions in the "Chart Operations" part in the documentation. But I am confused if you want to know also which of the two terminals is active in your machine; in that case, that topic may help you to some extent https://forum.mql4.com/47991
There is no function to know which chart/window is active on mql4 (unless you run a custom code on each window), so you need to use WINAPI. Check the documentation.
To add comments, please log in or register