i==這裏不對吧,
可以這樣寫,Print("i=",i," 訂單號碼=",OrderTicket());
//平倉可以用這個
if(OrderType()==OP_BUY) OrderClose(OrderTicket(),OrderLots(),Bid,3,Blue);
if(OrderType()==OP_SELL) OrderClose(OrderTicket(),OrderLots(),Ask,3,Red);