下载MetaTrader 5
要添加评论,请登录注册
发表您的文章。数以百万的交易者正在寻找好点子!
WANGGUANG
81
WANGGUANG 2010.06.24 13:29 

在某段时间平掉多单和空单的模块:

if((TimeHour(CurTime()) < StartHour) || (TimeHour(CurTime()) >= EndHour) ||
(DayOfWeek() == KillDay && TimeHour(CurTime()) == KillHour))
{
total = OrdersTotal();
//----
for(cnt = 0; cnt < total; cnt++)
{// 3
OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
//----
if(OrderSymbol() == Symbol())
{ //4
if(OrderType() == OP_BUY)
{ //5
OrderClose(OrderTicket(),Lots,Bid,Slippage,Green);
return(0);
} //5
//----
if(OrderType() == OP_SELL)
{ //5
OrderClose(OrderTicket(), Lots, Ask, Slippage, Green);
return(0);
} //5
} //4
} //3
return(0);
}

私下联系QQ 1031130533

/
要添加评论,请登录注册