using System; namespace Krs.Ats.IBNet { /// /// Open Order Event Arguments /// [Serializable()] public class OpenOrderEventArgs : EventArgs { private Contract contract; private Order order; private int orderId; private OrderState orderState; /// /// Full Constructor /// /// The order Id assigned by TWS. Used to cancel or update the order. /// Describes the contract for the open order. /// Gives the details of the open order. /// The openOrder() callback with the new OrderState() object will now be invoked each time TWS receives commission information for a trade. public OpenOrderEventArgs(int orderId, Contract contract, Order order, OrderState orderState) { this.orderId = orderId; this.order = order; this.contract = contract; this.orderState = orderState; } /// /// Parameterless OpenOrderEventArgs Constructor /// public OpenOrderEventArgs() { this.orderId = -1; this.order = new Order(); this.contract = new Contract(); this.orderState = new OrderState(); } /// /// The order Id assigned by TWS. Used to cancel or update the order. /// public int OrderId { get { return orderId; } set { orderId = value; } } /// /// Describes the contract for the open order. /// public Contract Contract { get { return contract; } set { contract = value; } } /// /// Gives the details of the open order. /// public Order Order { get { return order; } set { order = value; } } /// /// The openOrder() callback with the new OrderState() object will /// now be invoked each time TWS receives commission information for a trade. /// public OrderState OrderState { get { return orderState; } set { orderState = value; } } } }