Download MetaTrader 5

hello guys i havw this Ea i need to add stop loss to the order orderSend

To add comments, please log in or register
Start making profit using the Market. Publish your product!
Rock Abi Chebl
370
Rock Abi Chebl 2016.10.15 17:04 
OrderSend(Symbol(),OP_SELL,Lots,Bid,Slippage*multi, 0,

                   Ask-20*Point,Ask + 10*Point,"SHORT Position Initiated",0,0,Red);
 

how i can add  the stop loss any body can help me ? 

Sherif Hasan
7290
Sherif Hasan 2016.10.15 22:23  

Learn MQL4 or try here.there are thousands of programmers waiting forthe job.

https://www.mql5.com/en/job

Freelance service at MQL5.com
Freelance service at MQL5.com
  • www.mql5.com
Orders for the development of automated trading programs
Daniel Andrejczuk
1272
Daniel Andrejczuk 2016.10.15 23:11  

Hi, 

Look documentation "https://www.mql5.com/en/docs/trading/ordersend" , study!!!!


bool  OrderSend(
   MqlTradeRequest&  request,      // query structure
   MqlTradeResult&   result        // structure of the answer
   );


struct MqlTradeRequest
  {
   ENUM_TRADE_REQUEST_ACTIONS    action;           // Trade operation type
   ulong                         magic;            // Expert Advisor ID (magic number)
   ulong                         order;            // Order ticket
   string                        symbol;           // Trade symbol
   double                        volume;           // Requested volume for a deal in lots
   double                        price;            // Price
   double                        stoplimit;        // StopLimit level of the order
   double                        sl;               // Stop Loss level of the order
   double                        tp;               // Take Profit level of the order
   ulong                         deviation;        // Maximal possible deviation from the requested price
   ENUM_ORDER_TYPE               type;             // Order type
   ENUM_ORDER_TYPE_FILLING       type_filling;     // Order execution type
   ENUM_ORDER_TYPE_TIME          type_time;        // Order expiration type
   datetime                      expiration;       // Order expiration time (for the orders of ORDER_TIME_SPECIFIED type)
   string                        comment;          // Order comment
   ulong                         position;         // Position ticket
   ulong                         position_by;      // The ticket of an opposite position
  };

 

The commnad It should be something like: 

MqlTradeRequest         mrequest;      // To be used for sending our trade requests
MqlTradeResult          mresult;       // To be used to get our trade results

mrequest.tp = x

OrderSend(mrequest, mresult)  


Best regards,

Daniel 

Documentation on MQL5: Trade Functions / OrderSend
Documentation on MQL5: Trade Functions / OrderSend
  • www.mql5.com
Trade Functions / OrderSend - Reference on algorithmic/automated trading language for MetaTrader 5
To add comments, please log in or register