📅 财经日历 📊 实时波动 📈 大盘云图 📶 行情走势 🆚 投机情绪 🚀 今日热点

    如何删除挂单

    老周 LV16
    2016-10-26 · 2182 阅读
    bool OrderDelete(int ticket, void Color) 删除先前打开挂单。成功返回true,失败返回false。
    // 删除所有挂单
    int total = OrdersTotal();
    for(int i=total-1; i>=0; i--) {
        OrderSelect(i, SELECT_BY_POS);
        int type   = OrderType();
        bool result = false;
        switch(type) {
          //Close pending orders
          case OP_BUYLIMIT  :
          case OP_BUYSTOP   :
          case OP_SELLLIMIT :
          case OP_SELLSTOP  : result = OrderDelete( OrderTicket() );
        }

        if(result == false) {
          Print("Order " + OrderTicket() + " failed to close. Error:" + GetLastError());
        }
    }

    ""
    还没有人打赏,支持一下
    回复

    举报

     
    您需要登录后才可以回帖 登录 | 注册

    提醒: 禁止引战、谩骂、灌水内容

    微信二维码

    有问题联系客服