Function to change currency windows

 
Hello,
I don't know all the new functions after updating.
Is there a function to switch windows? (eg USDCAD is in the foreground and the function must change to EURUSD)
thank you
 

You can do it with ChartSetSymbolPeriod() function

ChartSetSymbolPeriod(0, "EURUSD", PERIOD_H1); 

Besides symbol, you can also change chart timeframe.

 

If you want to switch existing charts, check these topics:


 
hi,
thank you,
the first function does not work it blocks everything (in 646), plus she overwrites the existent window with another window and it does not allow navigation between existing windows.
I'll try the script.
 
I found a solution:

I create a function from the script that I can incorporate into my EA's

#import "user32.dll"
  int GetParent(int hWnd);
  int SendMessageA(int hWnd, int Msg, int wParam, int lParam);
#import

#define WM_MDIACTIVATE 0x222


int periods[9] = {PERIOD_MN1, PERIOD_W1, PERIOD_D1, PERIOD_H4, PERIOD_H1, PERIOD_M30, PERIOD_M15, PERIOD_M5, PERIOD_M1};

int WindowActivate(int hwnd) {
   int p = GetParent(hwnd);
   SendMessageA(GetParent(p), WM_MDIACTIVATE, p, 0);
return(0);}


int WindowGetHandle(string symbol) {
   int i; int hwnd=0;
   for (i=0; i<ArraySize(periods); i++) {
      hwnd = WindowHandle(symbol, periods[i]);
      if (hwnd != 0) break;}
   return (hwnd);}


void selectwind(string paire){
   int hwnd;
   hwnd = WindowGetHandle(paire);
   WindowActivate(hwnd);}


//----------------------------------------------------


... trade_function (..........){
 --------
 -------
 if(  signal_detected  || ...... || .......  ){
    -------
    selectwind(Symbol());
    --------           }

Thank you for the links

 
franky: I don't know all the new functions after updating.
Alphabetic Index of MQL4 Functions (600+) - MQL4 forum
 
WHRoeder:
franky: I don't know all the new functions after updating.
Alphabetic Index of MQL4 Functions (600+) - MQL4 forum

it is very convenient, thank you !
Reason: