Maybe it's best if you give that amount of attention to things like when to push the button in stead of pushing the button itself.
It might be of more importance than the actual button itself.
Of course you can build your own flight deck trading desk, but that, and that skill set does not make you a good trader per se, and it isn't really needed to be a successful trader.
Just use another normal keyboard or a smaller keypad via USB (or Bluetooth), stick some printed labels on the keys and use a Key Macro application or code a small mapping driver for it using "Microsoft Keyboard Layout Creator 1.4" which is totally free.

- johnofe
- www.instructables.com
:D Allright but I want to build one because I am a perfectionist

- www.turtletrader.com
You don't need programmable keyboard because you will be doing the programming in MT5 itself.
You can use your normal single keyboard and assign all the operations to its keys, maybe including a master key to turn this on and off and some visual feedback on your screen.
Here is an example code that changes timeframes through predefined values on pressing [ and ] and defaults to 3 minutes on pressing ' or reaching end of the row:
void OnChartEvent(const int id, const long& lparam, const double& dparam, const string& sparam ) { if(id==CHARTEVENT_KEYDOWN) { if(lparam==219) TimeFrameDown(); if(lparam==221) TimeFrameUp(); if(lparam==222) TimeFrameInTheMiddle(); } ChartRedraw(); } void TimeFrameUp() { ENUM_TIMEFRAMES timeframe; switch(_Period) { case PERIOD_M1: timeframe=PERIOD_M2; break; case PERIOD_M2: timeframe=PERIOD_M3; break; case PERIOD_M3: timeframe=PERIOD_M5; break; case PERIOD_M5: timeframe=PERIOD_M10; break; case PERIOD_M10: timeframe=PERIOD_M15; break; case PERIOD_M15: timeframe=PERIOD_M30; break; case PERIOD_M30: timeframe=PERIOD_H1; break; case PERIOD_H1: timeframe=PERIOD_H4; break; case PERIOD_H4: timeframe=PERIOD_D1; break; case PERIOD_D1: timeframe=PERIOD_W1; break; case PERIOD_W1: timeframe=PERIOD_MN1; break; default: timeframe=PERIOD_M3; } ChartSetSymbolPeriod(0,_Symbol,timeframe); } void TimeFrameDown() { ENUM_TIMEFRAMES timeframe; switch(_Period) { case PERIOD_M2: timeframe=PERIOD_M1; break; case PERIOD_M3: timeframe=PERIOD_M2; break; case PERIOD_M5: timeframe=PERIOD_M3; break; case PERIOD_M10: timeframe=PERIOD_M5; break; case PERIOD_M15: timeframe=PERIOD_M10; break; case PERIOD_M30: timeframe=PERIOD_M15; break; case PERIOD_H1: timeframe=PERIOD_M30; break; case PERIOD_H4: timeframe=PERIOD_H1; break; case PERIOD_D1: timeframe=PERIOD_H4; break; case PERIOD_W1: timeframe=PERIOD_D1; break; case PERIOD_MN1: timeframe=PERIOD_W1; break; default: timeframe=PERIOD_M3; } ChartSetSymbolPeriod(0,_Symbol,timeframe); } void TimeFrameInTheMiddle() { ChartSetSymbolPeriod(0,_Symbol,PERIOD_M3); }
It is better to include and use VirtualKeys.mqh than directly writing the key codes.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Greetings Claudio from Switzerland