Write a script to perform the task, and assign a hotkey to run the script.
right click the script in Navigator to assign a hotkey.
Here is an example.
#define KEY_NUMPAD_5 12 #define KEY_LEFT 37 #define KEY_UP 38 #define KEY_RIGHT 39 #define KEY_DOWN 40 #define KEY_NUMLOCK_DOWN 98 #define KEY_NUMLOCK_LEFT 100 #define KEY_NUMLOCK_5 101 #define KEY_NUMLOCK_RIGHT 102 #define KEY_NUMLOCK_UP 104 //+------------------------------------------------------------------+ //| Expert initialization function | //+------------------------------------------------------------------+ int OnInit() { //--- //--- return(INIT_SUCCEEDED); } //+------------------------------------------------------------------+ //| ChartEvent function | //+------------------------------------------------------------------+ void OnChartEvent(const int id, // Event identifier const long& lparam, // Event parameter of long type const double& dparam, // Event parameter of double type const string& sparam) // Event parameter of string type { //--- the left mouse button has been pressed on the chart if(id==CHARTEVENT_CLICK) { //Print("The coordinates of the mouse click on the chart are: x = ",lparam," y = ",dparam); } //--- the mouse has been clicked on the graphic object if(id==CHARTEVENT_OBJECT_CLICK) { //Print("The mouse has been clicked on the object with name '"+sparam+"'"); } //--- the key has been pressed if(id==CHARTEVENT_KEYDOWN) { switch(int(lparam)) { case KEY_NUMLOCK_LEFT: Print("The KEY_NUMLOCK_LEFT has been pressed"); break; case KEY_LEFT: Print("The KEY_LEFT has been pressed"); break; case KEY_NUMLOCK_UP: Print("The KEY_NUMLOCK_UP has been pressed"); break; case KEY_UP: Print("The KEY_UP has been pressed"); break; case KEY_NUMLOCK_RIGHT: Print("The KEY_NUMLOCK_RIGHT has been pressed"); break; case KEY_RIGHT: Print("The KEY_RIGHT has been pressed"); break; case KEY_NUMLOCK_DOWN: Print("The KEY_NUMLOCK_DOWN has been pressed"); break; case KEY_DOWN: Print("The KEY_DOWN has been pressed"); break; case KEY_NUMPAD_5: Print("The KEY_NUMPAD_5 has been pressed"); break; case KEY_NUMLOCK_5: Print("The KEY_NUMLOCK_5 has been pressed"); break; default: Print("Some not listed key has been pressed"); } } //--- the object has been deleted if(id==CHARTEVENT_OBJECT_DELETE) { //Print("The object with name ",sparam," has been deleted"); } //--- the object has been created if(id==CHARTEVENT_OBJECT_CREATE) { //Print("The object with name ",sparam," has been created"); } //--- the object has been moved or its anchor point coordinates has been changed if(id==CHARTEVENT_OBJECT_DRAG) { //Print("The anchor point coordinates of the object with name ",sparam," has been changed"); } //--- the text in the Edit of object has been changed if(id==CHARTEVENT_OBJECT_ENDEDIT) { //Print("The text in the Edit field of the object with name ",sparam," has been changed"); } }
I commented out the irrelevant id's.

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
Curious how i can go about making custom hot keys for FX Trading. The sales rep told me to ask on MQL4 community and find out.
So anyone know how to hot key trades for FX Trading?