public TWSClientErrorEventArgs(TWSClient client, int tickerId, IBContract contract, TWSError error) : base(client) { RequestId = tickerId; Error = error; Contract = contract; }
public TWSTickStringEventArgs(TWSClient client, int requestId, IBTickType tickType, string value) : base(client) { RequestId = requestId; TickType = tickType; Value = value; }
public TWSTickSizeEventArgs(TWSClient client, int requestId, IBTickType sizeTickType, int size) : base(client) { RequestId = requestId; TickType = sizeTickType; Size = size; }
public TWSTickPriceEventArgs(TWSClient client, int requestId, IBTickType tickType, double price, int size, int canAutoExecute) : base(client) { RequestId = requestId; TickType = tickType; Price = price; Size = size; CanAutoExecute = canAutoExecute; }
public TWSTickOptionComputationEventArgs(TWSClient client, int reqId, IBTickType tickType, double impliedVol, double delta, double modelPrice, double pvDividend) : base(client) { RequestId = reqId; TickType = tickType; ImpliedVol = impliedVol; Delta = delta; ModelPrice = modelPrice; PVDividend = pvDividend; }
public TWSTickGenericEventArgs(TWSClient client, int requestId, IBTickType tickType, double value) : base(client) { RequestId = requestId; TickType = tickType; Value = value; }
public TWSContractDetailsEventArgs(TWSClient client, IBContractDetails contractDetails) : base(client) { ContractDetails = contractDetails; }
public static void ReleaseSocket(TWSClient client) { lock (_refCount) { _refCount[client]--; if (_refCount[client] == 0) { client.Disconnect(); _refCount.Remove(client); _sockets.Remove(client.EndPoint); } } }
public TWSOrderStatusEventArgs(TWSClient client, int orderID, string status, int filled, int remaining, double avgFillPrice, int permID, int parentID, double lastFillPrice, int clientID, string whyHeld) : base(client) { OrderID = orderID; Status = status; Filled = filled; Remaining = remaining; AvgFillPrice = avgFillPrice; PermID = permID; ParentID = parentID; LastFillPrice = lastFillPrice; ClientID = clientID; WhyHeld = whyHeld; }
public TWSOpenOrderEventArgs(TWSClient client, int orderId, IBOrder order, IBContract contract) : base(client) { OrderId = orderId; Order = order; Contract = contract; }
public TWSMarketDepthEventArgs(TWSClient client, int requestId, int position, string marketMaker, IBOperation operation, IBSide side, double price, int size) : base(client) { RequestId = requestId; Position = position; MarketMaker = marketMaker; Operation = operation; Side = side; Price = price; Size = size; }
public TWSMarketDataEventArgs(TWSClient client, TWSMarketDataSnapshot snapshot, IBTickType tickType) : base(client) { TickType = tickType; Snapshot = snapshot; }
public TWSHistoricalDataEventArgs(TWSClient client, int tickerId, TWSHistoricState state, DateTime date, double open, double high, double low, double close, int volume, double wap, bool hasGaps) : base(client) { TickerId = tickerId; State = state; Date = date; Open = open; High = high; Low = low; Close = close; Volume = volume; WAP = wap; HasGaps = hasGaps; }
public TWSExecDetailsEventArgs(TWSClient client, int orderId, IBContract contract, IBExecution execution) : base(client) { OrderId = orderId; Contract = contract; Execution = execution; }
public TWSCurrentTimeEventArgs(TWSClient client, long time) : base(client) { Time = DateTime.FromFileTimeUtc(time); }
public TWSUpdatePortfolioEventArgs(TWSClient client, IBContract contract, int position, double marketPrice, double marketValue, double averageCost, double unrealizedPNL, double realizedPNL, string accountName) : base(client) { Contract = contract; Position = position; MarketPrice = marketPrice; MarketValue = marketValue; AverageCost = averageCost; UnrealizedPnL = unrealizedPNL; RealizedPnL = realizedPNL; AccountName = accountName; }
public TWSClientEventArgs(TWSClient client) { Client = client; }
public TWSTickEFPEventArgs(TWSClient client, int requestId, IBTickType tickType, double basisPoints, string formattedBasisPoints, double impliedFuturesPrice, int holdDays, string futureExpiry, double dividendImpact, double dividendsToExpiry) : base(client) { RequestId = requestId; TickType = tickType; BasisPoints = basisPoints; FormattedBasisPoints = formattedBasisPoints; ImpliedFuturesPrice = impliedFuturesPrice; HoldDays = holdDays; FutureExpiry = futureExpiry; DividendImpact = dividendImpact; DividendsToExpiry = dividendsToExpiry; }
public static TWSClient GetSocket(string host, int port) { IPAddress address = IPAddress.Loopback; IPAddress localAddress = IPAddress.Loopback; foreach (var a in Dns.GetHostEntry(host).AddressList) { if (a.AddressFamily == AddressFamily.InterNetwork) address = a; else continue; if (a == IPAddress.Loopback) break; } IPEndPoint endPoint = new IPEndPoint(address, port); TWSClient socket; lock (_refCount) { if (!_sockets.TryGetValue(endPoint, out socket)) { _sockets.Add(endPoint, socket = new TWSClient(endPoint)); _refCount.Add(socket, 0); } _refCount[socket]++; } return socket; }
public TWSClientStatusEventArgs(TWSClient client, TWSClientStatus status) : base(client) { Status = status; }