KeyBoard Trader

  • Thread starter Thread starter Phylo
  • Start date Start date
  • Watchers Watchers 1

Phylo

Senior member
Messages
3,363
Likes
360
KeyBoard Trader

This MT4 EA is a FREE AS-IS project –
  1. Note: This EA was developed using a UK Compact/Mini Keyboard - so no functions on NumLock Keys. Thoroughly test and accommodate for differences in layout when using a keyboard other than a UK keyboard.
  2. I developed due to dissatisfied with key combination (Ctrl+Key, Alt+Key, etc.) in existing available free keyboard traders. All function of this EA are single key function, inclusive of those that are by default key combinations (Ctrl+T, Ctrl+A, etc).
  3. I developed this some years ago with MT4 running on Linux Mint.
  4. Note: For the benefit of newbies - there is no MQL4 code applicable specifically to Linux and this EA is not specifically coded for Linux - such, would be nonsense. This EA will run just fine on Windows 10 or 11 or, as some prefer, BG's shite.
  5. This will install MT4 Terminal on Linux and automatically install and update Wine – https://www.metatrader4.com/en/tradi.../install_linux
  6. Suggestion: If running more than one MT4 Terminal on Linux, open each terminal in a different workspace. The below image illustrates 5 work spaces
    workspace.png
  7. Recently tested on Linux Mint 2.2, Windows 10 & 11
  8. While all developed features tested on Linux work perfectly, the screenshot function (Button F) does not work on Windows 10 & 11 installation. The code is bog-standard code and the fault is not with the code. Should be some indicators around, if needed. Edit - forgot: The Font Bold function does not work in Linux due to OS difference in font specification.
  9. I use Linux exclusively, and cannot be bothered with BG’s shite.
Pending available time – I may develop in MQL5 for MT5.

All instances of the Expert Advisor are of the same core KeyBoard Trader EA code.
What are the differences ?
Only - the default lot sizes allocated to the number buttons 1,2,3,4,5,6,7,8,9,0. This merely as convenience, according to lot preference or use.

Button Functions:
Note: All button functions pertain to the relevant chart ‘symbol’.

Buttons 1,2,3,4,5,6,7,8,9,0 : default or custom allocated lots.

Default Lot & LotStep Allocations
  1. KBT_Micro: Buttons 1-0 // 0.01–0.10 lots. // LotStep = 0.01
  2. KBT_Mini: Buttons 1-0 // 0.10–1.00 lots. // LotStep = 0.05
  3. KBT_Lots_1-10: Buttons 1-0 // 1.00–10.00 lots. // LotStep = 0.50
  4. KBT_Lots_10-100: Buttons 1-0 // 10.00-100.00 lots. // LotStep = 5.00
  5. KBT_Lots_5-50: Buttons 1-0 // 5.00-50.00 lots. // LotStep = 2.50
  6. KBT_Lots-55-100: Buttons 1-0 // 55.00-100.00 lots. // LotStep = 2.50
U : LotStep increment.
Y : LotStep decrement.
Note: The LotsStep Increment/Decrement Value can be customised from the Inputs tab.
  • Other than default allocation, any Lot or LotStep, SL, TP etc., can be customised and saved via the Save button on the Inputs tab.
  • Saved customisation can be loaded via the Load button on the Inputs tab.
  • For ease of efficiency and organisation, incorporate the EA as component of a template.
M : 0.00 lots - Note: This is a safety feature – set Lots to zero when not trading to avoid fat finger accidentals.
}] : 0.01 lots – this is for testing (if required, for whatever reason) if trading at higher than micro lots. If a test is required, one does not want to open 100 lots to run a test. Use – as and when required or not at all. Go figure.

?/ : Buy at Ask – open an order
,< : Sell at Bid – open an order

P : Buy Stop – pending order
L : Sell Stop – pending order
I : Buy Limit – pending order
J : Sell Limit – pending order

R : Reverse - all open orders
Z : Close All - open orders
B: Close All Buy - open orders
S: Close All Sell - open orders
C : Cancel All - pending orders

E : Move Stop Loss to Break Even (BE)
Note: Break Even Offset can be customised in the Inputs tab. Default = 0;
1) BUY & SELL Orders: if BE Offset = 0, BE = Order Open Price.
2) BUY Orders: if BE Offset > 0, BE = Order Open Price plus BE Offset in points.
3) SELL Orders: if BE Offset > 0, BE = Order Open Price less BE Offset in points.

A : Toggle On/Off AutoTrading
T : Toggle On/Off Terminal Window

F : Screenshot >> Broker Name – Symbol – Y.M.D – H:M:S.
Screenshot-1.png

Note: Button F – the screenshot function works perfectly on Linux, but fails on Windows 10 & 11. As previous mention, I cannot be bothered with Windows shite.
Check around there are screen capture indicators available.

Screenshot Location : This in Linux – Wine C Drive (Windows will be similar)
Note: For ease and speed of access individual MT4 Terminal Folders and File can be added to File Explorer Favourites, both in Linux and Windows.
Screenshot-2.png


KEY to Status Text
Screenshot-3.png

These separate values are easily remembered or figured out – the trade closed out on TP before I could get a screenshot – its bog straight forward.

4.00 : Lots
50 : SL in points
300 : TP in points
828.76* : Required Margin with respects to Lots Value x Leverage (base currency margin rate) x Exchange Rate (to deposit currency)*
101,292.64 : Account Equity
101,292.84 : Account Free Margin
** $0.0 : Account Profit.

** Account Deposit Currency: The EA should auto detect the following account deposit currencies: $, £, € and ¥.
Custom account deposit currency symbols - other than the above four auto detected currencies - can be set from the Input in Account Currency Symbol.

* NOTE: STRESS TRIGGER WARNING FOR THE UNEDUCATED:
  1. If this margin value does not correspond to the margin value against the relevant lot value in the MT4 terminal (Ctrl+T, or, T for the EA), then your broker has not translated "Required Margin" from “Base Currency” to “Deposit Currency”.
  2. Lets bounce that again - your broker has not translated "Required Margin" from “Base Currency” to “Deposit Currency”.
  3. MT4/5 brokers are at liberty to set a whole range of terminal specifications to their own choosing – there is no central exchange standardisation.
  4. MQL4/5 code can only read certain specifications as set by the broker.
  5. To get around the broker's lazy sloppy shit requires some serious magic which has its own problems when distributing. F-it, while a welcomed free, charity is a bridge too far.
  6. As a trader, you should know your craft and be able to calculate margins yourself to ascertain and verify correct values. But then again, some will conclude that they, along with their bag of weed, are going to burn the town. I don't doubt and applaud, but it's not for me.
  7. Posts #4 & #5 https://www.trade2win.com/threads/ma...2/post-3268785
  8. More advanced: https://www.forexfactory.com/thread/...7#post13046957
If any errors are bought to light I will – pending available time – investigate correction. Though - I primary run Linux and not really interested in Windows 10 & 11 problem BS.

Downloads: See next post
 
Last edited:
TEST THOROUGHLY ON DEMO
Screenshot from 2025-03-01 20-51-35.png

Note: EAs are tick reliant for operation. If testing in slow markets when ticks are slow (or closed markets, no ticks - limited operation testing), enlist the help of a free tick generator: MT4Ticker: https://fx1.net/mt4ticker.php

NOTE: ENSURE THE FOLLOWING AFTER EA INSTALLATION

Right-click chart > Expert Advisor >> Properties >> Common tab
Screenshot from 2025-03-01 07-33-24.png


Tools > Options > Expert Advisor tab
Screenshot from 2025-03-01 07-33-46.png
 

Attachments

Location of origin.txt file
  1. The origin.txt will reveal which broker is associated with the long Alpha Numerical Terminal Number.
  2. The origin.tex file can be renames as BrokerA.txt, BrokerB.txt, etc.,etc., for ease of Identification
This is the Linux file structure - Windows with be matching similar (start in C:>>Users >> ...)

Screenshot from 2025-03-02 06-07-47.png
 
Back
Top