public bool TryPickPendingCancel(string id, out OrderRecord record) { if (_pendingCancel.TryGetValue(id, out record)) { _pendingCancel.Remove(id); return(true); } return(false); }
public void AddCancelPending(Order order) { var key = _orderIds[order.Id]; if (!_working.TryGetValue(key, out var record)) { record = new OrderRecord(order); } _pendingCancel[key] = record; }
public OrderRecord PendingToWorking(string localId, string orderId) { if (_pendingNew.TryGetValue(localId, out var order)) { _pendingNew.Remove(localId); var record = new OrderRecord(order); _working.Add(orderId, record); _orderIds[order.Id] = orderId; return(record); } return(null); }
private static ExecutionReport CreateReport(OrderRecord record, OrderStatus ordStatus, ExecType execType, string text = "") { var report = new ExecutionReport(record.Order); report.DateTime = DateTime.Now; report.AvgPx = record.AvgPx; report.CumQty = record.CumQty; report.LeavesQty = record.LeavesQty; report.OrdStatus = ordStatus; report.ExecType = execType; report.Text = text == "" ? record.Order.Text : text; return(report); }
private bool TryPickWorking(string orderId, out OrderRecord record, bool remove = true) { if (_working.TryGetValue(orderId, out record)) { if (remove) { _working.Remove(orderId); _orderIds.Remove(record.Order.Id); } return(true); } return(false); }
public bool TryPickRejected(string id, out OrderRecord record) { return(TryPickWorking(id, out record)); }
public bool TryPeek(string id, out OrderRecord record) { return(TryPickWorking(id, out record, false)); }
public bool TryPickCancelled(string id, out OrderRecord record) { return(TryPickWorking(id, out record)); }