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
- Coding help
- close higher than fractal: doing something wrong
- Delete Sub Window
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:
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 !
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register