MT4 Script Hot Key Time Frame

 

Hey, does anyone have a script that can assign a set of hotkeys to flip inbetween all the time frame, it gets annoying have to go back to the Periodicity Tool bar to hit H1 or M5. I know you can hit enter and and type it in, but thats not what i want.


thank you :D

 
hastyle:

Hey, does anyone have a script that can assign a set of hotkeys to flip inbetween all the time frame, it gets annoying have to go back to the Periodicity Tool bar to hit H1 or M5. I know you can hit enter and and type it in, but thats not what i want.


thank you :D

 

///// This script changes time frame of One chart.

#include <WinUser32.mqh>
#define TF_D1 33134
#define TF_H4 33136
#define TF_M1 33137
#define TF_M5 33138
#define TF_M15 33139
#define TF_M30 33140
#define TF_W1 33141
#define TF_MN 33334
#define TF_H1 35400

int start()
{
if(!IsDllsAllowed()){
Alert("Tool Menu -> Option -> Expert Advisors TAB --> Check Allow DLL imports");
return(0);
}
int hwnd = WindowHandle(Symbol(),Period());
PostMessageA(hwnd, WM_COMMAND,TF_D1, 0);
}

 

sweet thank you. so how do i define the hotkey for it?? sorry im new to scripts. Do i have to create an individual script for teach time frame, with one of those "#define TF_H1 35400" lines and assign it a hotkey?

Reason: