/* Copyright (C) 2019 Interactive Brokers LLC. All rights reserved. This code is subject to the terms * and conditions of the IB API Non-Commercial License or the IB API Commercial License, as applicable. */ using System; using System.Collections; using System.Collections.Generic; using System.Runtime.InteropServices; using System.Text; namespace TWSLib { [ComVisible(true)] [Guid("0A77CCF6-052C-11D6-B0EC-00B0D074179C")] [InterfaceType(ComInterfaceType.InterfaceIsIDispatch)] public interface ITws { #region properties [DispId(1)] string account { get; set; } [DispId(2)] string tif { get; set; } [DispId(3)] string oca { get; set; } [DispId(4)] string orderRef { get; set; } [DispId(5)] int origin { get; set; } [DispId(6)] bool transmit { get; set; } [DispId(7)] string openClose { get; set; } [DispId(8)] int parentId { get; set; } [DispId(9)] bool blockOrder { get; set; } [DispId(10)] bool sweepToFill { get; set; } [DispId(11)] int displaySize { get; set; } [DispId(12)] int triggerMethod { get; set; } [DispId(13)] bool outsideRth { get; set; } [DispId(14)] bool hidden { get; set; } [DispId(16)] int clientIdFilter { get; set; } [DispId(17)] string acctCodeFilter { get; set; } [DispId(18)] string timeFilter { get; set; } [DispId(19)] string symbolFilter { get; set; } [DispId(20)] string secTypeFilter { get; set; } [DispId(21)] string exchangeFilter { get; set; } [DispId(22)] string sideFilter { get; set; } [DispId(23)] double discretionaryAmt { get; set; } [DispId(24)] int shortSaleSlot { get; set; } [DispId(25)] string designatedLocation { get; set; } [DispId(26)] int ocaType { get; set; } [DispId(27)] int exemptCode { get; set; } [DispId(28)] string rule80A { get; set; } [DispId(29)] string settlingFirm { get; set; } [DispId(30)] bool allOrNone { get; set; } [DispId(31)] int minQty { get; set; } [DispId(32)] double percentOffset { get; set; } [DispId(36)] int auctionStrategy { get; set; } [DispId(37)] double startingPrice { get; set; } [DispId(38)] double stockRefPrice { get; set; } [DispId(39)] double delta { get; set; } [DispId(40)] double stockRangeLower { get; set; } [DispId(41)] double stockRangeUpper { get; set; } [DispId(42)] string TwsConnectionTime { get; } [DispId(43)] int serverVersion { get; set; } [DispId(44)] bool overridePercentageConstraints { get; set; } [DispId(45)] double volatility { get; set; } [DispId(46)] int volatilityType { get; set; } [DispId(47)] string deltaNeutralOrderType { get; set; } [DispId(48)] double deltaNeutralAuxPrice { get; set; } [DispId(49)] int continuousUpdate { get; set; } [DispId(50)] int referencePriceType { get; set; } [DispId(51)] double trailStopPrice { get; set; } [DispId(52)] int scaleInitLevelSize { get; set; } [DispId(53)] int scaleSubsLevelSize { get; set; } [DispId(54)] double scalePriceIncrement { get; set; } #endregion #region methods [DispId(55)] void cancelMktData(int id); [DispId(57)] void placeOrder(int id, string action, double quantity, string symbol, string secType, string lastTradeDate, double strike, string right, string multiplier, string exchange, string primaryExchange, string curency, string orderType, double price, double auxPrice, string goodAfterTime, string group, string faMethod, string faPercentage, string faProfile, string goodTillDate); [DispId(58)] void disconnect(); [DispId(59)] void connect(string host, int port, int clientId, bool extraAuth); [DispId(60)] void reqMktData(int id, string symbol, string secType, string lastTradeDate, double strike, string right, string multiplier, string exchange, string primaryExchange, string currency, string genericTicks, bool snapshot, bool regulatorySnapshot, ITagValueList options); [DispId(61)] void reqOpenOrders(); [DispId(62)] void reqAccountUpdates(bool subscribe, string acctCode); [DispId(63)] void reqExecutions(); [DispId(64)] void reqIds(int numIds); [DispId(65)] void reqMktData2(int id, string localSymbol, string secType, string exchange, string primaryExchange, string currency, string genericTicks, bool snapshot, bool regulatorySnapshot, ITagValueList options); [DispId(66)] void placeOrder2(int id, string action, double quantity, string localSymbol, string secType, string exchange, string primaryExchange, string curency, string orderType, double lmtPrice, double auxPrice, string goodAfterTime, string group, string faMethod, string faPercentage, string faProfile, string goodTillDate); [DispId(67)] void reqContractDetails(string symbol, string secType, string lastTradeDate, double strike, string right, string multiplier, string exchange, string curency, int includeExpired); [DispId(68)] void reqContractDetails2(string localSymbol, string secType, string exchange, string curency, int includeExpired); [DispId(69)] void reqMktDepth(int id, string symbol, string secType, string lastTradeDate, double strike, string right, string multiplier, string exchange, string curency, int numRows, bool isSmartDepth, ITagValueList options); [DispId(70)] void reqMktDepth2(int id, string localSymbol, string secType, string exchange, string curency, int numRows, bool isSmartDepth, ITagValueList options); [DispId(71)] void cancelMktDepth(int id, bool isSmartDepth); [DispId(72)] void addComboLeg(int conid, string action, int ratio, string exchange, int openClose, int shortSaleSlot, string designatedLocation, int exemptCode); [DispId(73)] void clearComboLegs(); [DispId(74)] void cancelNewsBulletins(); [DispId(75)] void reqNewsBulletins(bool allDaysMsgs); [DispId(76)] void setServerLogLevel(int logLevel); [DispId(77)] void reqAutoOpenOrders(bool bAutoBind); [DispId(78)] void reqAllOpenOrders(); [DispId(79)] void reqManagedAccts(); [DispId(80)] void requestFA(int faDataType); [DispId(81)] void replaceFA(int reqId, int faDataType, string cxml); [DispId(82)] void reqHistoricalData(int id, string symbol, string secType, string lastTradeDate, double strike, string right, string multiplier, string exchange, string curency, int isExpired, string endDateTime, string durationStr, string barSizeSetting, string whatToShow, int useRTH, int formatDate, bool keepUpToDate, ITagValueList options); [DispId(83)] void exerciseOptions(int id, string symbol, string secType, string lastTradeDate, double strike, string right, string multiplier, string exchange, string curency, int exerciseAction, int exerciseQuantity, int @override); [DispId(84)] void reqScannerParameters(); [DispId(85)] void reqScannerSubscription(int tickerId, int numberOfRows, string instrument, string locationCode, string scanCode, double abovePrice, double belowPrice, int aboveVolume, double marketCapAbove, double marketCapBelow, string moodyRatingAbove, string moodyRatingBelow, string spRatingAbove, string spRatingBelow, string maturityDateAbove, string maturityDateBelow, double couponRateAbove, double couponRateBelow, int excludeConvertible, int averageOptionVolumeAbove, string scannerSettingPairs, string stockTypeFilter, string options, string scannerSubscriptionFilterOptions); [DispId(86)] void cancelHistoricalData(int tickerId); [DispId(87)] void cancelScannerSubscription(int tickerId); [DispId(88)] void resetAllProperties(); [DispId(89)] void reqRealTimeBars(int tickerId, string symbol, string secType, string lastTradeDate, double strike, string right, string multiplier, string exchange, string primaryExchange, string currency, int isExpired, int barSize, string whatToShow, int useRTH, ITagValueList options); [DispId(90)] void cancelRealTimeBars(int tickerId); [DispId(91)] void reqCurrentTime(); [DispId(92)] void reqFundamentalData(int reqId, IContract contract, string reportType); [DispId(93)] void cancelFundamentalData(int reqId); [DispId(94)] void calculateImpliedVolatility(int reqId, IContract contract, double optionPrice, double underPrice); [DispId(95)] void calculateOptionPrice(int reqId, IContract contract, double volatility, double underPrice); [DispId(96)] void cancelCalculateImpliedVolatility(int reqId); [DispId(97)] void cancelCalculateOptionPrice(int reqId); [DispId(98)] void reqGlobalCancel(); [DispId(99)] void reqMarketDataType(int marketDataType); [DispId(100)] void reqContractDetailsEx(int reqId, IContract contract); [DispId(101)] void reqMktDataEx(int tickerId, IContract contract, string genericTicks, bool snapshot, bool regulatorySnapshot, ITagValueList options); [DispId(102)] void reqMktDepthEx(int tickerId, IContract contract, int numRows, bool isSmartDepth, ITagValueList options); [DispId(103)] void placeOrderEx(int orderId, IContract contract, IOrder order); [DispId(104)] void reqExecutionsEx(int reqId, IExecutionFilter filter); [DispId(105)] void exerciseOptionsEx(int tickerId, IContract contract, int exerciseAction, int exerciseQuantity, string account, int @override); [DispId(106)] void reqHistoricalDataEx(int tickerId, IContract contract, string endDateTime, string duration, string barSize, string whatToShow, bool useRTH, int formatDate, bool keepUpToDate, ITagValueList options); [DispId(107)] void reqRealTimeBarsEx(int tickerId, IContract contract, int barSize, string whatToShow, bool useRTH, ITagValueList options); [DispId(108)] void reqScannerSubscriptionEx(int tickerId, IScannerSubscription subscription, string options, [Optional] string scannerSubscriptionFilterOptions); [DispId(109)] void addOrderComboLeg(double price); [DispId(110)] void clearOrderComboLegs(); [DispId(111)] void reqPositions(); [DispId(112)] void cancelPositions(); [DispId(113)] void reqAccountSummary(int reqId, string groupName, string tags); [DispId(114)] void cancelAccountSummary(int reqId); [DispId(115)] void verifyRequest(string apiName, string apiVersion); [DispId(116)] void verifyMessage(string apiData); [DispId(117)] void queryDisplayGroups(int reqId); [DispId(118)] void subscribeToGroupEvents(int reqId, int groupId); [DispId(119)] void updateDisplayGroup(int reqId, string contractInfo); [DispId(120)] void unsubscribeFromGroupEvents(int reqId); [DispId(121)] void verifyAndAuthRequest(string apiName, string apiVersion, string opaqueIsvKey); [DispId(122)] void verifyAndAuthMessage(string apiData, string xyzResponse); [DispId(123)] void reqPositionsMulti(int requestId, string account, string modelCode); [DispId(124)] void cancelPositionsMulti(int requestId); [DispId(125)] void reqAccountUpdatesMulti(int requestId, string account, string modelCode, bool ledgerAndNLV); [DispId(126)] void cancelAccountUpdatesMulti(int requestId); [DispId(200)] IContract createContract(); [DispId(201)] IComboLegList createComboLegList(); [DispId(202)] IOrder createOrder(); [DispId(203)] IExecutionFilter createExecutionFilter(); [DispId(204)] IScannerSubscription createScannerSubscription(); [DispId(205)] IDeltaNeutralContract createDeltaNeutralContract(); [DispId(206)] ITagValueList createTagValueList(); [DispId(207)] IOrderComboLegList createOrderComboLegList(); [DispId(208)] void setConnectOptions(string connectOptions); [DispId(209)] void startApi(); [DispId(210)] void disableUseV100Plus(); [DispId(211)] ArrayList ParseConditions(string str); [DispId(212)] string ConditionsToString([MarshalAs(UnmanagedType.IDispatch)] object oConditions); [DispId(213)] void reqSecDefOptParams(int reqId, string underlyingSymbol, string futFopExchange, string underlyingSecType, int underlyingConId); [DispId(214)] void reqSoftDollarTiers(int reqId); [DispId(215)] void reqFamilyCodes(); [DispId(216)] void reqMatchingSymbols(int reqId, string pattern); [DispId(217)] void reqMktDepthExchanges(); [DispId(218)] void reqSmartComponents(int reqId, string bboExchange); [DispId(219)] void reqNewsProviders(); [DispId(220)] void reqNewsArticle(int requestId, string providerCode, string articleId, ITagValueList options); [DispId(221)] void reqHistoricalNews(int requestId, int conId, string providerCodes, string startDateTime, string endDateTime, int totalResults, ITagValueList options); [DispId(222)] void reqHeadTimestamp(int tickerId, IContract contract, string whatToShow, int useRTH, int formatDate); [DispId(223)] void reqHistogramData(int tickerId, IContract contract, bool useRTH, string period); [DispId(224)] void cancelHistogramData(int tickerId); [DispId(225)] void cancelHeadTimestamp(int tickerId); [DispId(226)] void reqMarketRule(int marketRuleId); [DispId(227)] void reqPnL(int reqId, string account, string modelCode); [DispId(228)] void cancelPnL(int reqId); [DispId(229)] void reqPnLSingle(int reqId, string account, string modelCode, int conId); [DispId(230)] void cancelPnLSingle(int reqId); [DispId(231)] void reqTickByTickData(int reqId, IContract contract, string tickType, int numberOfTicks, bool ignoreSize); [DispId(232)] void cancelTickByTickData(int reqId); [DispId(233)] void reqHistoricalTicks(int reqId, IContract contract, string startDateTime, string endDateTime, int numberOfTicks, string whatToShow, int useRth, bool ignoreSize, ITagValueList options); [DispId(234)] void reqCompletedOrders(bool apiOnly); [DispId(235)] void reqWshMetaData(int reqId); [DispId(236)] void reqWshEventData(int reqId, IWshEventData wshEventData); [DispId(237)] void cancelWshMetaData(int reqId); [DispId(238)] void cancelWshEventData(int reqId); [DispId(239)] void reqUserInfo(int reqId); [DispId(240)] void cancelOrder(int reqId, string manualOrderCancelTime); [DispId(241)] IWshEventData createWshEventData(); #endregion } }