FREE EA AND INDICATOR คือแจกฟรีจริงๆไม่ต้องสมัคร Downline => แจก EA ฟรี => Topic started 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 ให้เลย
ขอบคุณครับ
-
เอาฟังก์ชั่น ด้านล่างไปใส่เพิ่มในส่วนท้ายสุดของ 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);
}
}
}
}
}
-
เอาฟังก์ชั่น ด้านล่างไปใส่เพิ่มในส่วนท้ายสุดของ code จากนั่นให้เรียกใช้ในฟังก์ชั่นหลัก
ขอบคุณครับ ของมแป๊บ
-
อ้างถึง : เอาฟังก์ชั่น ด้านล่างไปใส่เพิ่มในส่วนท้ายสุดของ 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+
-
แล้วคุณเรียกใช้ ฟังกชั่นนี้ใน ฟังกชั่น หลักหรือยัง