void CloseOrders() { int total = OrdersTotal(); for (int a = total-1; a >= 0; a--) { if (!OrderSelect(a, SELECT_BY_POS, MODE_TRADES)) continue; if (OrderSymbol() != Symbol()) continue; if (OrderType() == OP_BUY) OrderClose(OrderTicket(),OrderLots(),Bid,3,Violet); if (OrderType() == OP_SELL) OrderClose(OrderTicket(),OrderLots(),Ask,3,Violet); } }
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
{
int total;
total = OrdersTotal();
for(int a = 0;a < total; a ++)
{
OrderSelect(a, SELECT_BY_POS, MODE_TRADES);
if(OrderSymbol()==Symbol())
{
if(OrderType()==OP_BUYSTOP && OrderType()==OP_SELLSTOP)
OrderClose(OrderTicket(), OrderLots(), Bid, 3,Violet);
OrderClose(OrderTicket(), OrderLots(), Ask, 3,Violet);
}
}
}