วันพฤหัสบดีที่ 23 พฤศจิกายน พ.ศ. 2560

MQL 4 OrderSend และตัวอย่างการนำไปใช้

MQL 4 OrderSend
  • การส่ง Order ของ MQL 4
  • ส่วนประกอบของคำสั่ง
    • int  OrderSend(
      •    string   symbol,              // symbol
      •    int      cmd,                 // operation
      •    double   volume,              // volume
      •    double   price,               // price 
      •    int      slippage,            // slippage 
      •    double   stoploss,            // stop loss
      •    double   takeprofit,          // take profit 
      •    string   comment=NULL,        // comment
      •    int      magic=0,             // magic number 
      •    datetime expiration=0,        // pending order expiration 
      •    color    arrow_color=clrNONE  // color
      •    );
    • รายละเอียด
      • symbol : [in]  Symbol for trading. , คู่เงิน
      • cmd : [in]  Operation type. It can be any of the Trade operation enumeration. , คำสั่ง ซื้อขาย
      • volume : [in]  Number of lots.  , ขนาดที่ต้องการซื้อขาย
      • price : [in]  Order price. , ราคาที่ต้องการซื้อขาย
      • slippage : [in]  Maximum price slippage for buy or sell orders.
      • stoploss : [in]  Stop loss level.  , จุดที่ต้องการตั้ง Stoploss
      • takeprofit: [in]  Take profit level., จุดที่ต้องการตั้ง Take Profit
      • comment=NULL : [in]  Order comment text. Last part of the comment may be changed by server.
      • magic=0 : [in]  Order magic number. May be used as user defined identifier.
      • expiration=0 : [in]  Order expiration time (for pending orders only). , เวลาที่ Order จะหมดอายุ
      • arrow_color=clrNONE : [in]  Color of the opening arrow on the chart. If parameter is missing or has CLR_NONE value opening arrow is not drawn on the chart.
ตัวอย่าง Source Code

Download
Quiz
  • ทดลองเขียน 
    • SendOrder Sell
    • SendPreOrder Sell
    • กำหนด ให้สามารถ Order ได้ทีละ 1 Order เท่านั้น

ไม่มีความคิดเห็น:

แสดงความคิดเห็น

วิธีขายจากกลุ่มสิงค์โปร

  BUY USDJPY 115.14   SL: 114.84 TP1: 115.34 TP2: 115.54 TP3: 115.74 SL 50 จุด tp 1 :20 tp 2 :40 tp 3 :60 ถ้าซื้อ 3 order ไป TP 1,2,3 profit...