Open Forex4you Account

Server รัน EA 1000 / ปี

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

Author Topic: รบกวนปรับ ea ตัวนี้ให้ทีครับ  (Read 7407 times)

Nantipat

  • Newbie
  • *
  • Posts: 9
รบกวนปรับ ea ตัวนี้ให้ทีครับ
« on: พฤษภาคม 18, 2016, 04:52:15 pm »
รบกวน admin ปรับ EA ชื่อ EA_NAN_MA_V23
ให้เบิ้ล lot และเลื่อย TP นะครับ ผมติดตรงนี้ทำไม่เป็นครับ
ส่วน EA ชื่อ forexthaipop เป็นตัวอย่างครับ อยากให้ EA_NAN_MA_V23 เบิ้ล lot และเลื่อย TP แบบ EA ชื่อ forexthaipop


EA_NAN_MA_V23 เขียนตาม อ้างถึง หัวข้อ: วอนพี่ๆช่วยเขียนอีเอให้ครับ

ขอบคุณครับ
« Last Edit: พฤษภาคม 18, 2016, 04:55:36 pm by Nantipat »

admin

  • Administrator
  • Hero Member
  • *****
  • Posts: 2386
Re: รบกวนปรับ ea ตัวนี้ให้ทีครับ
« Reply #1 on: พฤษภาคม 18, 2016, 09:35:32 pm »
ถ้าเลื่อน TP เอา code นี้ไปใส่เพิ่มแล้วเรียกใช้ฟังก์ชั่นแบบในตัวอย่าง
extern int Trailing =10;
int start()
  {
    if(OrdersTotal()==0)
    {
       
   
     OrderSend(Symbol(),OP_BUY,0.1,Ask,3,0,0,"EX6",0,0,Green);

     OrderSend(Symbol(),OP_SELL,0.1,Bid,3,0,0,"EX6",0,0,Red);
   
    }
    trailingstop();
   
   return(0);
  }
void trailingstop() {   
         for(int count=0;count<OrdersTotal();count++)       
            {OrderSelect(count,SELECT_BY_POS,MODE_TRADES);     
               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);                                  }
                           }
                      }
                  }   
                if(OrderType() == OP_SELL )
                  { if(Trailing > 0)
                       {if(OrderOpenPrice() - Ask > Trailing*Point)
                            {   
                          if(OrderStopLoss() == 0 || ( OrderStopLoss()-Ask > Trailing*Point ) ) 
                              {OrderModify(OrderTicket(), OrderOpenPrice(),Ask + Trailing*Point, OrderTakeProfit(), 0, Red);                                   }
                         }
                      }
                 } 
              }
          }



Nantipat

  • Newbie
  • *
  • Posts: 9
Re: รบกวนปรับ ea ตัวนี้ให้ทีครับ
« Reply #2 on: พฤษภาคม 18, 2016, 11:20:13 pm »
ขอบคุณครับ ผมจะลองดูครับ