public void AddFill( Fill f ) { fills.Add(f); Interlocked.Add(ref wkqty, -f.Qty); if (log.IsDebugEnabled) log.Debug( new System.Text.StringBuilder("setting wkqty: ") .AppendFormat("{0} filled: {1} {2}",wkqty,f.Qty,f.Key) ); }
private void OnOrderFillData(XTAPI.TTFillObj pFill) { try { Fill fill = new Fill(); Array data = (Array)pFill.get_Get("Key,FillType,BuySell,Qty,Price#,NetQty,Acct,Contract.Product"); fill.Key = (string)data.GetValue(0); fill.Full = ((string)data.GetValue(1)).Equals("F"); fill.Buy = ((string)data.GetValue(2)).Equals("B"); fill.Qty = (int)data.GetValue(3); fill.Price = (double)data.GetValue(4); fill.NetQty = (int)data.GetValue(5); fill.Account = (string)data.GetValue(6); fill.Product = (string)data.GetValue(7); if (OnFill != null ) { OnFill(this, new FillEventArgs(fill)); } } catch (Exception ex) { if (log.IsErrorEnabled) log.Error(ex.StackTrace); } }
public void AddFill(Fill f) { foreach(Order o in orders){ if( o.SOK == f.Key ){ o.AddFill(f); break; } } }
public FillEventArgs(Fill fill) { this.fill = fill; }