We’re sure You are impatient to teach Your Expert Advisor to trade. MetaQuotes Language 4 allows carrying out COMPLETE control over your trading account — open/close positions, place/modify and deleting orders, getting information of the open and already closed position etc.
In this article we would like to give the complete list of the trading functions that can be called in an expert advisor, and in the following articles I will consider each function in detail.
| Function | Brief description |
| HistoryTotal | The number of claosed positions and deleted orders |
| OrderClose | It closes a position |
| OrderCloseBy | It closes a position by another position (locked) |
| OrderClosePrice | The closing price of the order/position selected by the OrderSelect() function |
| OrderCloseTime | The date and time of closing of the order selected by the OrderSelect() function |
| OrderComment | Comments of the order/position selected by the OrderSelect() function |
| OrderCommission | Commission of the order/position selected by the OrderSelect() function |
| OrderDelete | It deletes a pending order |
| OrderExpiration | Expiration date of the order/position selected by the OrderSelect() function |
| OrderLots | The number of lots in the order/position selected by the OrderSelect() function |
| OrderMagicNumber | «Magic» number of the order/position selected by the OrderSelect() function |
| OrderModify | It modifies the level and expiration date of a pending order, Stop Loss and Take Profit levels and «magic» number of an open position or a pending order |
| OrderOpenPrice | Openeing price of the order/position selected by the OrderSelect() function |
| OrderOpenTime | The date and time of placing/opening of the order/position selected by the OrderSelect() function |
| OrderPrint | It outputs parameters of an order in the log |
| OrderProfit | Profit/loss of the order/position selected by the OrderSelect() function |
| OrderSelect | To select an order to receive information on it |
| OrderSend | Opens a position or places a pending order |
| OrderStopLoss | Stop Loss of the order/position selected by the OrderSelect() function |
| OrdersTotal | The number of open positions and pending orders |
| OrderSwap | The size of storage of the order/position selected by the OrderSelect() function |
| OrderSymbol | Abbreviation of the instrument of the order/position selected by the OrderSelect() function |
| OrderTakeProfit | Take Profit of the order/position selected by the OrderSelect() function |
| OrderTicket | Ticket of the order/position selected by the OrderSelect() function |
| OrderType | The type of the order/position selected by the OrderSelect() function |