MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal

Automated Trading Language Documentation

Percentage Crossover Channel Indicator
Percentage Crossover Channel
Author: GODZILLA
Screenshot
XAGUSD, M5
Real
Interview with Mariusz Zarnowski (ATC 2012) Interview with Mariusz Zarnowski (ATC 2012) Acceleration of GravityAcceleration of Gravity Try product
Acceleration of Gravity
Author: achidayat
Subscribe to signal
Moringa
47.80%, 7.39 USD

SellStop

Places the pending order of Buy Stop type (sell at the price, lower than current market price) with specified parameters.

bool  SellStop(
   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]  Order volume.

price

[in]  Order price.

symbol=NULL

[in]  Order symbol. If the symbol isn't 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 (value of ENUM_ORDER_TYPE_TIME enumeration).

expiration=0

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

comment=""

[in]  Order comment.

Returned value

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

Note

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


Updated: 2012.07.27