How to teach the Expert Advisor to trade


for example, forex

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
HistoryTotalThe number of claosed positions and deleted orders
OrderCloseIt closes a position
OrderCloseByIt closes a position by another position (locked)
OrderClosePriceThe closing price of the order/position selected by the OrderSelect() function
OrderCloseTimeThe date and time of closing of the order selected by the OrderSelect() function
OrderCommentComments of the order/position selected by the OrderSelect() function
OrderCommissionCommission of the order/position selected by the OrderSelect() function
OrderDeleteIt deletes a pending order
OrderExpirationExpiration date of the order/position selected by the OrderSelect() function
OrderLotsThe number of lots in the order/position selected by the OrderSelect() function
OrderMagicNumber«Magic» number of the order/position selected by the OrderSelect() function
OrderModifyIt 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
OrderOpenPriceOpeneing price of the order/position selected by the OrderSelect() function
OrderOpenTimeThe date and time of placing/opening of the order/position selected by the OrderSelect() function
OrderPrintIt outputs parameters of an order in the log
OrderProfitProfit/loss of the order/position selected by the OrderSelect() function
OrderSelectTo select an order to receive information on it
OrderSendOpens a position or places a pending order
OrderStopLossStop Loss of the order/position selected by the OrderSelect() function
OrdersTotalThe number of open positions and pending orders
OrderSwapThe size of storage of the order/position selected by the OrderSelect() function
OrderSymbolAbbreviation of the instrument of the order/position selected by the OrderSelect() function
OrderTakeProfitTake Profit of the order/position selected by the OrderSelect() function
OrderTicketTicket of the order/position selected by the OrderSelect() function
OrderTypeThe type of the order/position selected by the OrderSelect() function

Next article: "OrderSelect function"

+7 (495) 710-76-76
© 1998—2008 «Alpari»

close

Your Personal Area

For alpari.classic enter your account number (a letter and 4 figures) and the code word for the Personal Area.

For alpari.micro account: enter your login (6 figures) and the password for MT.

Open an account!Forgotten your password?