/// <summary> Снять регистрацию стакана инструмента для отмены получения данных стакана. </summary> public void UnregisterDepth(Securities sec) { if (!sec.Empty()) { this.ConTerminal.SendMsgToServer("UnRegDepthSec", sec.Code + MManager.SpliterData + sec.Class.Code); } }
/// <summary> /// Отменяет указанную стоп-заявку. /// </summary> /// <param name="sec"></param> /// <param name="OrderNumber">Номер заявки</param> /// <returns></returns> public int CancelStopOrder(Securities sec, decimal OrderNumber) { if (sec.Empty()) { return(-1); } if (OrderNumber <= 0) { return(-2); } Common.Ext.NewThread(() => { Qlog.CatchException(() => { Account acc = this.ConTerminal.Accounts.FirstOrDefault(a => !a.AccClasses.FirstOrDefault(c => c.Code == sec.Class.Code).Empty()); if (acc.Empty()) { return; } Random rnd = new Random(); //"|CLASSCODE|QJSIM|SECCODE|SBER|ORDER_KEY|3181375550|ACCOUNT|NL0011100043"; string[] Params = { "TRANS_ID", rnd.Next(1, 1000000).ToString(), "ACTION", "KILL_STOP_ORDER", "CLASSCODE", sec.Class.Code, "SECCODE", sec.Code, "ACCOUNT", acc.AccID, "STOP_ORDER_KEY", OrderNumber.ToString() }; this.SendTransaction(Params); }); }); return(-1); }
/// <summary> /// Снимает все стоп-заявки по инструменту /// </summary> /// <param name="sec"></param> /// <returns></returns> public int CancelAllStopOrder(Securities sec) { if (sec.Empty()) { return(-1); } Qlog.CatchException(() => { IEnumerable <Order> orders = this.ConTerminal.StopOrders.Where(o => o.Sec.Code == sec.Code && o.Sec.Class.Code == sec.Class.Code && o.Status == OrderStatus.ACTIVE); if (!orders.Empty()) { foreach (var ord in orders) { this.CancelStopOrder(sec, ord.OrderNumber); } } }); return(0); }