KeyboardTrade – library MetaTrader 4

This tool is for trading with keyboard input, it supports “Send order”, “Set Stop Loss”, “Set Take Profit”, and “Close order”.

1. Send Order

Command

Buy: b,lots,price,sl,tp
Sell: s,lots,price,sl,tp

Example

Buy 0.1 lots EURUSD on 1.16000, set Stop Loss on 1.15500, and set Take Profit on 1.17000

The command is:

b,0.1,1.16,1.155,1.17x

The last ‘x’ is to execute this command.

  • If price is zero, or is equal to the Ask/Bid, the order type will be BUY/SELL.
  • If the first command is ‘b'(BUY), and price > Ask, the order type will be Buy Stop, if price < Ask, the order type will be Buy Limit.
  • If the first command is ‘s'(SELL), and price > Bid, the order type will be Sell Limit, if price < Bid the order type will be Sell Stop.

2. Modify Order

Setting Stop Loss and Take Profit are supported only.

Command

Set Stop Loss: sl,ticket,sl
Set Take Profit: tp,ticket,tp

Example

If there is an EURUSD buy order, the Stop Loss is 1.1550, and the ticket is 123456789.

Alternative:  Fair Value Gap (FVG) Indicator - indicator MetaTrader 5

Now we set the Stop Loss to 1.1580, the command is:

sl,123456789,1.1580x

The last ‘x’ is to execute this command.

3. Close or Delete Order

Command

c,ticket

Example

If we want to close an order with the ticket 123456789

The command is:

c,123456789x

The last ‘x’ is to execute this command.

4. Other Commands

  • ‘,’ is to separate the command.
  • ‘ESC’ or double ‘z’ will clear the command.
  • ‘x’ is to execute the command.

Translated from Chinese by MetaQuotes Ltd.

📈 ROBOTFX MetaTrader Expert Advisors and Indicators to maximize profits and minimize the risks