您需要 登录 才可以下载或查看,没有帐号?注册
函数执行在某个时间后全部平仓或删除挂单。
if (Hour() = Order_Hour)
{
for(cnt=0;cnt OrdersTotal();cnt++)
{
// check selection result because order may be closed or deleted at this time!
OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
if (OrderSymbol()==Symbol())//check for opened position and symbol
{
if (OrderType()==OP_SELLSTOP OpenBuys 0) OrderDelete( OrderTicket());
if (OrderType()==OP_BUYSTOP OpenSells 0) OrderDelete( OrderTicket());
if (Hour() = CloseOrdersHour Minute() = 45 OrderType()==OP_SELL)
OrderClose(OrderTicket(),OrderLots(),Ask,3,Violet);
if (Hour() = CloseOrdersHour Minute() = 45 OrderType()==OP_BUY)
OrderClose(OrderTicket(),OrderLots(),Bid,3,Violet);
}
}
}复制代码
外汇交易有很大的风险性,本站所有资源均来自网络,请选择使用,如若出现亏损,本站不承担任何责任!