If you click the button and the Window is already open, nothing happens.
Bug fix will come with 1.08.
This code will fix it (add the 2 lines after //)
Code: Select all
if( WindowHandle( SymbolName, timeframe) != 0)
{
Print("Chart already open ",WindowHandle( SymbolName, timeframe) );
// switch to existing chart
hTerminal = GetParent(GetParent(WindowHandle(Symbol(), Period())));
SendMessageA(hTerminal, WM_MDIACTIVATE, GetParent(WindowHandle( SymbolName, timeframe)),0);
return(0);
}