Note

Hỏi về câu lệnh EA đóng tất cả các lệnh, đk là Accountprofit>một con số cụ thể.

· Views 103
Em có câu lệnh:
-------------
for(int cnt=0;cnt<OrdersTotal();cnt++)
{
OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
if(OrderType()<=OP_SELL &&
OrderSymbol()==Symbol() &&
OrderMagicNumber()==MagicNumber
)
{
if(OrderType()==OP_BUY)
{
if(Accountprofit>40) //here is your close buy rule
{
OrderClose(OrderTicket(),OrderLots(),OrderClosePrice(),Slippage,Red);
}

}
else
{
if(Accountprofit>40) // here is your close sell rule
{
OrderClose(OrderTicket(),OrderLots(),OrderClosePrice(),Slippage,Red);
}

}
}
}
return(0);
-------------
Nhưng mà khổ cái là khi đóng đc 1 vài lệnh thì accountprofit lại <40 thì nó lại ngưng.
Anh chị nào có ý tưởng nào hay để thực hiện đóng tất cả các lệnh khi accountprofit đạt 1 mức nhất định nào đó k ạ.
Em cảm ơn ạ!
 

Sách hay cho anh em tham khảo: Làm Giàu Từ Chứng Khoán + Thực Hành Phương Pháp CANSLIM

Disclaimer: The content above represents only the views of the author or guest. It does not represent any views or positions of FOLLOWME and does not mean that FOLLOWME agrees with its statement or description, nor does it constitute any investment advice. For all actions taken by visitors based on information provided by the FOLLOWME community, the community does not assume any form of liability unless otherwise expressly promised in writing.

FOLLOWME Trading Community Website: https://www.followme.com

If you like, reward to support.
avatar

Hot

No comment on record. Start new comment.