您需要 登录 才可以下载或查看,没有帐号?注册
函数执行多单全部平仓。
void CloseBuys(int MagicNumber, int Slippage)
{
for(int i = 0; i OrdersTotal(); i++)
{
// already closed
if(OrderSelect(i, SELECT_BY_POS) == false) continue;
// not current symbol
if(OrderSymbol() != Symbol()) continue;
// order was opened in another way
if(OrderMagicNumber() != MagicNumber) continue;
if(OrderType() == OP_BUY)
{
if(OrderClose(OrderTicket(), OrderLots(), Bid, Slippage, Blue))
{
i--;
}
RefreshRates();
}
}
}复制代码
外汇交易有很大的风险性,本站所有资源均来自网络,请选择使用,如若出现亏损,本站不承担任何责任!