예제 #1
0
 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)
                );
 }
예제 #2
0
        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);
            }
        }
예제 #3
0
 public void AddFill(Fill f)
 {
     foreach(Order o in orders){
         if( o.SOK == f.Key ){
             o.AddFill(f);
             break;
         }
     }
 }
예제 #4
0
 public FillEventArgs(Fill fill)
 {
     this.fill = fill;
 }