There is a feature in MT4 which allows us to navigate to a past date in the chart, so today is 25. january. 2014, and i want to navigate to lets say 1.1.2006, then i would have to do that manually, by pressing the ENTER key and using the "navigator box" to navigate to that past date.
Now what i want is to do this without manually entering the date to the navigator box, using WINAPI and the user32.dll file provided with MT4.
It is a simple task, yet i`m stuck with it, because i`m not very familiar with WINAPI commands and .DLL controls, so i`m asking for help to complete my code please.
The task is simple: PRESS ENTER -> WRITE THE DATE AUTOMATICALLY -> PRESS ENTER
And if this is done by code, then the navigation will be automatical to that specified date.
Here is my code, and here is where i got stuck:
outside functions:
init()
But for some reason, the last command doesnt write the date "2012.1.1 10:30" into the navigator box, it remains empty.
So again the mission is: ENTER ->WRITE IN THE DATE->ENTER, and this way the MT4 will automatically navigate me to the date which i want.
Please help, thanks
Attached Image
Now what i want is to do this without manually entering the date to the navigator box, using WINAPI and the user32.dll file provided with MT4.
It is a simple task, yet i`m stuck with it, because i`m not very familiar with WINAPI commands and .DLL controls, so i`m asking for help to complete my code please.
The task is simple: PRESS ENTER -> WRITE THE DATE AUTOMATICALLY -> PRESS ENTER
And if this is done by code, then the navigation will be automatical to that specified date.
Here is my code, and here is where i got stuck:
outside functions:
Inserted Code
#import "user32.dll" void keybd_event(int bVk,int bScan,int dwFlags,int dwExtraInfo); int SetWindowTextA(int hWnd,string lpString); int GetActiveWindow(); #import #define VK_RETURN 13 //ENTER key
init()
Inserted Code
int init() { keybd_event(VK_RETURN,0,0,0); SetWindowTextA(GetActiveWindow(),"2012.1.1 10:30"); // keybd_event(VK_RETURN,0,0,0); //---- return(0); }
But for some reason, the last command doesnt write the date "2012.1.1 10:30" into the navigator box, it remains empty.
So again the mission is: ENTER ->WRITE IN THE DATE->ENTER, and this way the MT4 will automatically navigate me to the date which i want.
Please help, thanks
"There's a sucker born every minute" - P.T. Barnum