關於刪除訂單的程序,請各位大大指教小弟!!!! 新评论 Soon Guan Tan 2008.10.23 11:24 { ticket=OrderSend(Symbol(),OP_BUYLIMIT,Lots,buy,0,0,sell,"IceBaby",0,0,Blue); if(ticket>0) { if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) Print("BUY order opened : ",OrderOpenPrice()); } else Print("Error opening BUY order : ",GetLastError()); Sleep(3600000); } { ticket=OrderSend(Symbol(),OP_SELLLIMIT,Lots,sell,0,0,buy,"Icebaby",0,0,Red); if(ticket>0) { if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) Print("SELL order opened : ",OrderOpenPrice()); } else Print("Error opening SELL order : ",GetLastError()); Sleep(3600000); } return(0); for(i=0; i<OrdersTotal(); i++) { if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)) { cmd=OrderType(); //---- pending orders only are considered if(cmd!=OP_BUYLIMIT && cmd!=OP_SELLLIMIT) { //---- print selected order OrderPrint(); //---- delete first pending order result=OrderDelete(OrderTicket()); if(result!=TRUE) Print("LastError = ", GetLastError()); break; } } else { Print( "Error when order select ", GetLastError()); break; } } return(0); } 請問為甚麼不會刪除訂單呢???是哪錯了?? EA不会在多对上运行,需要帮助 請高手指教!!!關於修改程序!!! 請高手幫幫忙,急需中.... [存档!]任何菜鸟问题,为了不使论坛变得混乱。专业人士,不要路过。没有你,哪里都不能去 - 4. yyy999 2008.10.23 15:40 #1 应该是if(cmd!=OP_BUYLIMIT && cmd!=OP_SELLLIMIT) 改成if(cmd==OP_BUYLIMIT || cmd!=OP_SELLLIMIT)吧 Soon Guan Tan 2008.10.23 22:11 #2 yyy999 写道 >> 应该是if(cmd!=OP_BUYLIMIT && cmd!=OP_SELLLIMIT) 改成if(cmd==OP_BUYLIMIT || cmd!=OP_SELLLIMIT)吧 謝謝指點!! 新评论 您错过了交易机会: 免费交易应用程序 8,000+信号可供复制 探索金融市场的经济新闻 注册 登录 拉丁字符(不带空格) 密码将被发送至该邮箱 发生错误 使用 Google 登录 您同意网站政策和使用条款 如果您没有帐号,请注册 可以使用cookies登录MQL5.com网站。 请在您的浏览器中启用必要的设置,否则您将无法登录。 忘记您的登录名/密码? 使用 Google 登录
{
ticket=OrderSend(Symbol(),OP_BUYLIMIT,Lots,buy,0,0,sell,"IceBaby",0,0,Blue);
if(ticket>0)
{
if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) Print("BUY order opened : ",OrderOpenPrice());
}
else Print("Error opening BUY order : ",GetLastError());
Sleep(3600000);
}
{
ticket=OrderSend(Symbol(),OP_SELLLIMIT,Lots,sell,0,0,buy,"Icebaby",0,0,Red);
if(ticket>0)
{
if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) Print("SELL order opened : ",OrderOpenPrice());
}
else Print("Error opening SELL order : ",GetLastError());
Sleep(3600000);
}
return(0);
for(i=0; i<OrdersTotal(); i++)
{
if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES))
{
cmd=OrderType();
//---- pending orders only are considered
if(cmd!=OP_BUYLIMIT && cmd!=OP_SELLLIMIT)
{
//---- print selected order
OrderPrint();
//---- delete first pending order
result=OrderDelete(OrderTicket());
if(result!=TRUE) Print("LastError = ", GetLastError());
break;
}
}
else { Print( "Error when order select ", GetLastError()); break; }
}
return(0);
}
請問為甚麼不會刪除訂單呢???是哪錯了??