Open Forex4you Account

Server รัน EA 1000 / ปี

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

Author Topic: trailing stop code  (Read 7177 times)

TvT

  • Full Member
  • ***
  • Posts: 133
trailing stop code
« on: กุมภาพันธ์ 12, 2011, 03:13:56 pm »
เนื่องจากต้องการนำ traing stop ไปใช้
จึงลองแกะจาก EAbuilder มา

ไม่ทราบว่าแบบนี้ถูกไหม


///Trailing stop Buy
int TrailingStop = 30;

               if(Bid - OrderOpenPrice() > Point * TrailingStop)
               {
               if(OrderStopLoss() < Bid - Point * TrailingStop)
                     {
                     OrderModify(OrderTicket(), OrderOpenPrice(), Bid - Point * TrailingStop, OrderTakeProfit(), 0, MediumSeaGreen);
                     if (!EachTickMode) BarCount = Bars;  อันนี้ไว้ทำอะไรครับ ใช่เพื่อให้ปรับ eack tick mode ไหม
                     continue; อันนี้ไม่รู้ทำไมเป็น continue 
                     }
               }                     

TvT

  • Full Member
  • ***
  • Posts: 133
Re: trailing stop code
« Reply #1 on: กุมภาพันธ์ 14, 2011, 10:32:39 pm »
ไม่มีใครตอบเลยหรือครับ
ที่ตั้งหัวข้อชื่อนี้ เพราะกะไว้ให้คนต่อไปมาค้นได้

สงสัย admin งานยุ่งแฮะ

admin

  • Administrator
  • Hero Member
  • *****
  • Posts: 2386
Re: trailing stop code
« Reply #2 on: กุมภาพันธ์ 15, 2011, 10:24:25 pm »
EachTickMode  อันนี้จะเป็นชื่อฟังก์ชั่นที่ตัว EAbuilder สร้างขึ้นมานะครับ รายละเอียดผมไม่ทราบครับ  แต่ continue นี้คือสั่งให้ทำงานต่อครับตรงข้ามกับ break ที่สั่งหยุดครับ

TvT

  • Full Member
  • ***
  • Posts: 133
Re: trailing stop code
« Reply #3 on: กุมภาพันธ์ 16, 2011, 12:35:54 am »
แล้วถ้าจะแก้ใช้กับ EA ที่พยายามเขียนเองตั้งแก้เป็นอย่างไง ครับ


admin

  • Administrator
  • Hero Member
  • *****
  • Posts: 2386
Re: trailing stop code
« Reply #4 on: กุมภาพันธ์ 16, 2011, 01:46:22 am »
ไป copy code triling stop จากระบบสร้าง Ea อัตโนมัติผมเขียน ไปใช้ได้เลยครับเพระผมแยกเป็นฟังก์ชั่นไวเรียบร้อยแล้วครับ