Code:
if (TimeHour(CurTime())>=18)
{
for (int i=0;i<OrdersTotal();i++)
{
if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES))
{
OrderClose(OrderTicket(),OrderLots(),OrderClosePrice(),3);
}
}
}
if (TimeHour(CurTime())>=18)
{
for (int i=0;i<OrdersTotal();i++)
{
if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES))
{
OrderClose(OrderTicket(),OrderLots(),OrderClosePrice(),3);
}
}
}