That is a good question that I have never thought of before!
As far as I can remember, there does not seem to be any MQL function for that, but I may be wrong. If that is the case, you may need to use Win32 API functions to identify the window and bring focus to it. It has been a long time since I manipulated MetaTrader via Win32 API so I no longer remember how to do that but you can probably use the WindowHandle function to get the handle for the chart in question and then the Windows API to give it focus. Try doing a search with that in mind and may just find a few clues on how to handle the windows via the Windows API.
There may be a simpler solution, so just wait a while to see if anyone else has a better idea.

- www.mql5.com
Hi folks,
Is there any function to maximize or "bring to front" or "pop up" a chart window inside of MT5?
I don't want to open a new chart (ChartOpen function), I just want to show a specific chart in case it already opened at my MT5.
Are you talking about
//+----------------------------------------------------------------------+ |
Of course you will need additional code to identify the relevant chart ID, but that's not difficult.
Are you talking about
Of course you will need additional code to identify the relevant chart ID, but that's not difficult.
I did not know about that one. Thanks Keith! That is good to know for future reference!
Fernando Carreiro:
If that is the case, you may need to use Win32 API functions to identify the window and bring focus to it. It has been a long time since I manipulated MetaTrader via Win32 API so I no longer remember how to do that but you can probably use the WindowHandle function to get the handle for the chart in question and then the Windows API to give it focus. Try doing a search with that in mind and may just find a few clues on how to handle the windows via the Windows API.
I vaguely remember having some problems with bringing a minimised chart to the top.
Something like this, but I am not sure now.
#include <WinUser32.mqh> #define SW_SHOWMAXIMIZED 3
int hWnd = WindowHandle(Symbol(), Period()); int parent = GetParent(hWnd); ShowWindow(parent, SW_SHOWMAXIMIZED);
I vaguely remember having some problems with bringing a minimised chart to the top.
Something like this, but I am not sure now.
Except there is no WindowHandle on mql5.
Need to use :
ChartGetInteger(0,CHART_WINDOW_HANDLE)And I doubt the rest of the code will work on MT5, but I didn't try.

- www.mql5.com
According to the current MQL5 documentation, WindowHandle is still a valid MQL5 function - Documentation on MQL5: Standard Library / Price Charts / WindowHandle

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi folks,
Is there any function to maximize or "bring to front" or "pop up" a chart window inside of MT5?
I don't want to open a new chart (ChartOpen function), I just want to show a specific chart in case it already opened at my MT5.