pek4christ / 프로필
pek4christ
Please can any one help me out... I made a fuction in an EA that is surpose to close only all profit trades at a certain profit, But its closing both profit and loss trade Here is the Function:
void CloseOrderBuy() {
for (int i = OrdersTotal() - 1; i >= 0; i--) {
if(OrderSelect(i, SELECT_BY_POS, MODE_TRADES))
{
if (OrderSymbol() == Symbol() && OrderMagicNumber() == MagicNumberSeries)
{
if (OrderType() == OP_BUY)
{
bool CloseOrder=(OrderClose(OrderTicket(),OrderLots(),Bid,3,0));
}
}
}
}
}
I will really appreciate your responds... Thanks in advace.
void CloseOrderBuy() {
for (int i = OrdersTotal() - 1; i >= 0; i--) {
if(OrderSelect(i, SELECT_BY_POS, MODE_TRADES))
{
if (OrderSymbol() == Symbol() && OrderMagicNumber() == MagicNumberSeries)
{
if (OrderType() == OP_BUY)
{
bool CloseOrder=(OrderClose(OrderTicket(),OrderLots(),Bid,3,0));
}
}
}
}
}
I will really appreciate your responds... Thanks in advace.
Oksana Berenko
2018.02.22
if(OrderProfit()>0) {close}
: