public TWSMarketDataEventArgs(TWSClient client, TWSMarketDataSnapshot snapshot, IBTickType tickType) : base(client) { TickType = tickType; Snapshot = snapshot; }
public TWSTickStringEventArgs(TWSClient client, int requestId, IBTickType tickType, string value) : base(client) { RequestId = requestId; TickType = tickType; Value = value; }
public TWSOpenOrderEventArgs(TWSClient client, int orderId, IBOrder order, IBContract contract) : base(client) { OrderId = orderId; Order = order; Contract = contract; }
public TWSExecDetailsEventArgs(TWSClient client, int orderId, IBContract contract, IBExecution execution) : base(client) { OrderId = orderId; Contract = contract; Execution = execution; }
public TWSTickGenericEventArgs(TWSClient client, int requestId, IBTickType tickType, double value) : base(client) { RequestId = requestId; TickType = tickType; Value = value; }
private void ConnectToPlayback(string fileName) { _client = _playback = new TWSPlaybackClient(fileName); _client.Settings = _settings; AddGenericClientEventHandlers(); _symbolDataMap = new Dictionary <IBContract, InstrumentDataRecord>(); }
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; }
private void ConnectToTWS(string host, int port) { _client = TWSSocketFactory.GetSocket(host, port); _client.RecordForPlayback = (bool)(recordMarketDataButton.Tag ?? false); _client.Settings = _settings; AddGenericClientEventHandlers(); _symbolDataMap = new Dictionary <IBContract, InstrumentDataRecord>(); _client.Connect(); }
public static void ReleaseSocket(TWSClient client) { lock (_refCount) { _refCount[client]--; if (_refCount[client] == 0) { client.Disconnect(); _refCount.Remove(client); _sockets.Remove(client.EndPoint); } } }
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 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 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 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 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 static TWSClient GetSocket(string host, int port) { var address = IPAddress.Loopback; var localAddress = IPAddress.Loopback; foreach (IPAddress a in Dns.GetHostEntry(host).AddressList) { if (a.AddressFamily == AddressFamily.InterNetwork) { address = a; } else { continue; } if (a == IPAddress.Loopback) { break; } } var 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; }
public TWSClientEventArgs(TWSClient client) { Client = client; }
public TWSHistoricalDataEventArgs(TWSClient client) : base(client) { }
public TWSClientErrorEventArgs(TWSClient client) : base(client) { }
internal TWSScannerDataEventArgs(TWSClient client) : base(client) { }
public TWSMarketDepthEventArgs(TWSClient client) : base(client) { }
public TWSScannerParametersEventArgs(TWSClient client) : base(client) { }
internal TWSOrderChangedEventArgs(TWSClient client, OrderRecord or) : base(client) { OriginalOrder = or.Order; OriginalContract = or.Contract; OrderId = or.OrderId; }
public TWSClientErrorEventArgs(TWSClient client, int tickerId, IBContract contract, TWSError error) : base(client) { RequestId = tickerId; Error = error; Contract = contract; }
public TWSContractDetailsEventArgs(TWSClient client, IBContractDetails contractDetails) : base(client) { ContractDetails = contractDetails; }
public TWSRealtimeBarEventArgs(TWSClient client) : base(client) { }
public TWSTickSizeEventArgs(TWSClient client, int requestId, IBTickType sizeTickType, int size) : base(client) { RequestId = requestId; TickType = sizeTickType; Size = size; }
public TWSCurrentTimeEventArgs(TWSClient client, long time) : base(client) { Time = DateTime.FromFileTimeUtc(time); }
public TWSExecutionDetailsEventArgs(TWSClient client) : base(client) { }