Open Forex4you Account

Server รัน EA 1000 / ปี

สั่งชื้อคู่มือการโปรแรกม MQL4

Author Topic: Tailing Stop มีการเลื่อนตามราคาใหม่ พบว่า Tailing Stop มีการเลื่อนต่ำลงบางครั้ง  (Read 5482 times)

chawin_win

  • Newbie
  • *
  • Posts: 14
สวัสดีครับ


จากคำสั่งด้านล่าง เมื่อเอามาประมวลผล 
Tailing Stop มีการเลื่อนตามราคาใหม่ ได้จริง

แต่พบว่า Tailing Stop มีการเลื่อนต่ำลงบางครั้ง
ในกรณีที่ ค่า Bid และ Low > OrderOpenPrice() และ ค่า Bid < Low แท่งก่อนหน้านี้ 
Trailing Stop จะเปลี่ยน จาก Low-OrderStopLoss()  เป็น Bid - OrderStopLoss()
ซึ่ง Trailing Stop ใหม่จะเลื่อนต่ำกว่า  Trailing Stop เก่าครับ

ผมอยากขอให้ช่วยแก้ให้ Trailing Stop คงเดิม ไม่เลื่อนต่ำลงตามค่าที่คำนวณใหม่ครับ
เลื่อน Trailing Stop เมื่อ เกิดค่า Low ใหม่ ที่สูงขึ้นกว่าค่า Low เก่า (New High ของ Low)

if(OrderType() == OP_BUY)     
                   {if(trailing > 0){       
                       if(Bid - OrderOpenPrice() > trailing*Point)           
                           {if(OrderStopLoss()==0 || (Bid - OrderStopLoss()> trailing*Point))     
                                {OrderModify(OrderTicket(), OrderOpenPrice(),Bid - trailing*Point, OrderTakeProfit(), 0, Blue);                                  }
                           }
                      }

ขอบคุณครับ
วิน


chawin_win

  • Newbie
  • *
  • Posts: 14
ขออภัย  ผมอาจจะรันโปรแกรมแล้วใส่ค่าผิดครับ