EA Programing => ปัญหาที่พบในการเขียน EA => Topic started by: sherlockh on กันยายน 16, 2014, 12:44:51 pm
-
เราจะเช็ค ค่า Profit รวมของออเดอร์ BUY ที่เปิดอยู่ หรือ Profit รวมของออเดอร์ SELL
จะทำได้ไหมครับ
ขอบคุรครับ ;)
-
int start()
{ double Pbuy,Psell;
for(int i=0;i<OrdersTotal();i++)
{ int a=OrderSelect(i,SELECT_BY_POS,MODE_TRADES);
if(OrderType()==OP_BUY)
{
Pbuy=Pbuy+OrderProfit();
}
if(OrderType()==OP_SELL)
{
Psell=Psell+OrderProfit();
}
}
Print("Profit BUY : ",Pbuy);
Print("Profit SELL : ",Psell);
return (0);
}
-
ขอบคุณมากๆครับท่านแอดมิน