FREE EA AND INDICATOR คือแจกฟรีจริงๆไม่ต้องสมัคร Downline => แจก EA ฟรี => Topic started by: guitars1131 on กรกฎาคม 04, 2016, 01:30:16 pm

Title: รบกวน Admin แก้ไขเพิ่มเติม EA ตัวนี้ได้ไหมครับ
Post by: guitars1131 on กรกฎาคม 04, 2016, 01:30:16 pm
อยากให้เพิ่มเติมให้มันตั้ง TP กับ SL ให้หน่อยครับ เอาไปลอง Run Demo แล้วมันไม่ตั้งให้เลย หรือท่านใดแก้ได้รบกวนด้วยครับ
เป็นตัวเดียวกันกับกระทู้นี้  http://www.thaiforexea.com/index.php/topic,2339.0.html (http://www.thaiforexea.com/index.php/topic,2339.0.html)  ผมลอง Backtest แล้วเว่อร์มากๆ ไปลองกับ Demo ก็เปิดเข้าออเดอร์นะครับ แต่ไม่ตั้ง tp sl ให้เลย

ขอบคุณครับ
Title: Re: รบกวน Admin แก้ไขเพิ่มเติม EA ตัวนี้ได้ไหมครับ
Post by: admin on กรกฎาคม 08, 2016, 12:27:15 am
เอาฟังก์ชั่น ด้านล่างไปใส่เพิ่มในส่วนท้ายสุดของ code จากนั่นให้เรียกใช้ในฟังก์ชั่นหลัก

void tpsl()
{  int SL=100;
   int TP =100;

for(int i=0;i<OrdersTotal();i++)
     {
        OrderSelect(i,SELECT_BY_POS,MODE_TRADES);
        {
           if(OrderType()==OP_BUY)
             {
               if(OrderStopLoss()==0)
                {
                  int a= OrderModify(OrderTicket(), OrderOpenPrice(),OrderOpenPrice() - SL*Point, OrderTakeProfit(), 0, Blue); 
                 
                }
               
                  if(OrderTakeProfit()==0)
                {
                 a=  OrderModify(OrderTicket(), OrderOpenPrice(),OrderStopLoss(), OrderOpenPrice()+TP*Point, 0, Blue); 
                 
                }
               
                }
               
             
             
             
               if(OrderType()==OP_SELL)
                {
                   
                   if(OrderStopLoss()==0)
                {
                 a= OrderModify(OrderTicket(), OrderOpenPrice(),OrderOpenPrice() + SL*Point, OrderTakeProfit(), 0, Blue); 
                 
                }
               
                  if(OrderTakeProfit()==0)
                {
                 a= OrderModify(OrderTicket(), OrderOpenPrice(),OrderStopLoss(), OrderOpenPrice()-TP*Point, 0, Blue); 
                 
                }
             
             
             
        }   
     
     }

}

}
Title: Re: รบกวน Admin แก้ไขเพิ่มเติม EA ตัวนี้ได้ไหมครับ
Post by: guitars1131 on กรกฎาคม 08, 2016, 03:11:59 pm
เอาฟังก์ชั่น ด้านล่างไปใส่เพิ่มในส่วนท้ายสุดของ code จากนั่นให้เรียกใช้ในฟังก์ชั่นหลัก

ขอบคุณครับ ของมแป๊บ
Title: Re: รบกวน Admin แก้ไขเพิ่มเติม EA ตัวนี้ได้ไหมครับ
Post by: guitars1131 on กรกฎาคม 08, 2016, 11:18:54 pm
อ้างถึง : เอาฟังก์ชั่น ด้านล่างไปใส่เพิ่มในส่วนท้ายสุดของ code จากนั่นให้เรียกใช้ในฟังก์ชั่นหลัก

void tpsl()
{  int SL=100;
   int TP =100;

ผมแก้ค่าเป็น :

void tpsl()
{  int SL = Stoploss;
   int TP = Takeprofit;

กับลองแก้ตรงๆ เป็น
 void tpsl()
{  int SL = 30;
   int TP = 30;

ก็ยังไม่ตั้ง SL กับ TP ให้ครับพอมีคำแนะนำเพิ่มไหมครับ
ตอนนี้กำลังนั่งทำความเข้าใจกับค่าทีละบรรทัด แต่ก็ยังงง เพราะอ่อนมากๆ 55+
Title: Re: รบกวน Admin แก้ไขเพิ่มเติม EA ตัวนี้ได้ไหมครับ
Post by: admin on กรกฎาคม 10, 2016, 07:17:48 pm
แล้วคุณเรียกใช้ ฟังกชั่นนี้ใน ฟังกชั่น หลักหรือยัง