Download MetaTrader 5

SellLimit

Places the pending order of Sell Limit type (sell at the price higher than current market price) with specified parameters.

bool  SellLimit(
   double                volume,                       // order volume
   double                price,                        // order price
   const string          symbol=NULL,                  // symbol
   double                sl=0.0,                       // stop loss price
   double                tp=0.0,                       // take profit price
   ENUM_ORDER_TYPE_TIME  type_time=ORDER_TIME_GTC,     // order lifetime
   datetime              expiration=0,                 // order expiration time
   const string          comment=""                    // comment
   )

Parameters

volume

[in]  Requested order volume.

price

[in]  Order price.

symbol=NULL

[in]  Order symbol. If the symbol is not specified, the current symbol will be used.

sl=0.0

[in]  Stop Loss price.

tp=0.0

[in]  Take Profit price.

type_time=ORDER_TIME_GTC

[in]  Order lifetime from ENUM_ORDER_TYPE_TIME enumeration.

expiration=0

[in]  Order expiration time (used only if type_time=ORDER_TIME_SPECIFIED).

comment=""

[in]  Order comment.

Return Value

true - successful check of the structures, otherwise - false.

Note

Successful completion of the SellLimit(...) method does not always mean successful execution of the trade operation. It is necessary to check the result of trade request (trade server return code) using ResultRetcode() and value returned by ResultDeal().


Updated: 2016.05.30