void tl_newOrderCancelRequest(long number) { int orderid = Convert.ToInt32(number); if (orderid == 0) { return; } if (!socketOrderServer.sitemOrder.sordermap.ContainsKey(Convert.ToInt32(number))) { return; } itemOrder porder = socketOrderServer.sitemOrder.sordermap[orderid]; if (!porder.IsOpenOrder()) { return; } if (porder.mlvsqty > 0) { iManager im = new iManager(socketOrderServer); im.Send_CancelOrder(porder, 0); tl.newCancel(number); } }
void tl_newOrderCancelRequest(long number) { int orderid = Convert.ToInt32(number); if (orderid == 0) { v("ignoring cancel for invalid id: 0"); return; } if (!socketOrderServer.sitemOrder.sordermap.ContainsKey(Convert.ToInt32(number))) { v("ignoring cancel for unknown order: " + number); return; } itemOrder porder = socketOrderServer.sitemOrder.sordermap[orderid]; if (!porder.IsOpenOrder()) { v("ignoring cancel for closed order, tlid: " + number + " sym: " + porder.msecsym + " ord: " + porder.ToString()); return; } if (porder.mlvsqty > 0) { try { iManager im = new iManager(socketOrderServer); im.Send_CancelOrder(porder, 0); v("requested cancel for: " + number + " sym: " + porder.msecsym + " ord: " + porder.ToString()); } catch (Exception ex) { debug("DAS error canceling order: " + number + " err: " + ex.Message + ex.StackTrace); } tl.newCancel(number); } else { v("ignoring cancel for order with zero size, tlid: " + number + " sym: " + porder.msecsym + " ord: " + porder.ToString()); } }