예제 #1
0
 public TWSExecDetailsEventArgs(TWSClient client, int orderId, IBContract contract, IBExecution execution)
     : base(client)
 {
     OrderId   = orderId;
     Contract  = contract;
     Execution = execution;
 }
예제 #2
0
 public TWSExecDetailsEventArgs(TWSClient client, int orderId, IBContract contract, IBExecution execution)
     : base(client)
 {
     OrderId = orderId;
     Contract = contract;
     Execution = execution;
 }
예제 #3
0
        private void ProcessExecutionData()
        {
            int version = _enc.DecodeInt();
            int orderId = _enc.DecodeInt();
            IBContract contract = new IBContract();
            contract.Symbol = _enc.DecodeString();
            contract.SecType = _enc.DecodeSecType();
            contract.Expiry = DateTime.ParseExact(_enc.DecodeString(), IB_EXPIRY_DATE_FORMAT, CultureInfo.InvariantCulture);
            contract.Strike = _enc.DecodeDouble();
            contract.Right = _enc.DecodeString();
            contract.Exchange = _enc.DecodeString();
            contract.Currency = _enc.DecodeString();
            contract.LocalSymbol = _enc.DecodeString();
            IBExecution execution = new IBExecution();
            execution.OrderID = orderId;
            execution.ExecID = _enc.DecodeString();
            execution.Time = _enc.DecodeString();
            execution.AcctNumber = _enc.DecodeString();
            execution.Exchange = _enc.DecodeString();
            execution.Side = _enc.DecodeString();
            execution.Shares = _enc.DecodeInt();
            execution.Price = _enc.DecodeDouble();
            if (version >= 2)
                execution.PermID = _enc.DecodeInt();
            if (version >= 3)
                execution.ClientID = _enc.DecodeInt();
            if (version >= 4)
                execution.Liquidation = _enc.DecodeInt();

            OnExecDetails(orderId, contract, execution);
        }
예제 #4
0
 protected void OnExecDetails(int orderId, IBContract contract, IBExecution execution)
 {
     if (ExecDetails != null)
         ExecDetails(this, new TWSExecDetailsEventArgs(this, orderId, contract, execution));
 }