InteractiveBrokersMessageAdapter
The messages adapter for InteractiveBrokers.
Inherits: MessageAdapter
Implements: IAddressAdapter<EndPoint>
Constructors
public InteractiveBrokersMessageAdapter(IdGenerator transactionIdGenerator)
interactiveBrokersMessageAdapter = InteractiveBrokersMessageAdapter(transactionIdGenerator)
Initializes a new instance of the InteractiveBrokersMessageAdapter.
- transactionIdGenerator
- Transaction id generator.
Properties
public EndPoint Address { get; set; }
value = interactiveBrokersMessageAdapter.Address
interactiveBrokersMessageAdapter.Address = value
Address.
public static IEnumerable<TimeSpan> AllTimeFrames { get; }
value = InteractiveBrokersMessageAdapter.AllTimeFrames
Possible time-frames.
public override IEnumerable<Level1Fields> CandlesBuildFrom { get; }
value = interactiveBrokersMessageAdapter.CandlesBuildFrom
Possible options for candles building.
public bool CheckCertificateRevocation { get; set; }
value = interactiveBrokersMessageAdapter.CheckCertificateRevocation
interactiveBrokersMessageAdapter.CheckCertificateRevocation = value
Check certificate revocation.
public int ClientId { get; set; }
value = interactiveBrokersMessageAdapter.ClientId
interactiveBrokersMessageAdapter.ClientId = value
Unique ID. Used when several clients are connected to one terminal or gateway.
public DateTime? ConnectedTime { get; private set; }
value = interactiveBrokersMessageAdapter.ConnectedTime
interactiveBrokersMessageAdapter.ConnectedTime = value
The connection time.
public bool ExtraAuth { get; set; }
value = interactiveBrokersMessageAdapter.ExtraAuth
interactiveBrokersMessageAdapter.ExtraAuth = value
Extra authentication.
public override bool ExtraSetup { get; }
value = interactiveBrokersMessageAdapter.ExtraSetup
The adapter requires extra setup.
public override string FeatureName { get; }
value = interactiveBrokersMessageAdapter.FeatureName
Feature name.
public override bool IsAutoReplyOnTransactonalUnsubscription { get; }
value = interactiveBrokersMessageAdapter.IsAutoReplyOnTransactonalUnsubscription
Send auto response for OrderStatusMessage and PortfolioLookupMessage unsubscribes.
public InteractiveBrokersMarketDataTypes MarketDataType { get; set; }
value = interactiveBrokersMessageAdapter.MarketDataType
interactiveBrokersMessageAdapter.MarketDataType = value
Whether to use RealTime data or Frozen on the broker server. By default, the RealTime data is used.
public ServerVersions MaxVersion { get; set; }
value = interactiveBrokersMessageAdapter.MaxVersion
interactiveBrokersMessageAdapter.MaxVersion = value
Max support version.
public string OptionalCapabilities { get; set; }
value = interactiveBrokersMessageAdapter.OptionalCapabilities
interactiveBrokersMessageAdapter.OptionalCapabilities = value
Optional capabilities.
public ServerLogLevels ServerLogLevel { get; set; }
value = interactiveBrokersMessageAdapter.ServerLogLevel
interactiveBrokersMessageAdapter.ServerLogLevel = value
The server messages logging level. The default is Information.
public string SslCertificate { get; set; }
value = interactiveBrokersMessageAdapter.SslCertificate
interactiveBrokersMessageAdapter.SslCertificate = value
SSL certificate.
public SecureString SslCertificatePassword { get; set; }
value = interactiveBrokersMessageAdapter.SslCertificatePassword
interactiveBrokersMessageAdapter.SslCertificatePassword = value
SSL certificate password.
public SslProtocols SslProtocol { get; set; }
value = interactiveBrokersMessageAdapter.SslProtocol
interactiveBrokersMessageAdapter.SslProtocol = value
SSL protocol to establish connect.
public override IEnumerable<int> SupportedOrderBookDepths { get; }
value = interactiveBrokersMessageAdapter.SupportedOrderBookDepths
Available options for MaxDepth.
public string TargetHost { get; set; }
value = interactiveBrokersMessageAdapter.TargetHost
interactiveBrokersMessageAdapter.TargetHost = value
The name of the server that shares SSL connection.
public bool UseV100Plus { get; set; }
value = interactiveBrokersMessageAdapter.UseV100Plus
interactiveBrokersMessageAdapter.UseV100Plus = value
Use V100 plus version at the connect time.
public bool ValidateRemoteCertificates { get; set; }
value = interactiveBrokersMessageAdapter.ValidateRemoteCertificates
interactiveBrokersMessageAdapter.ValidateRemoteCertificates = value
Validate remove certificates.
Methods
private ValueTask CancelHistogramData(long requestId, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.CancelHistogramData(requestId, cancellationToken)
Cancels an active data histogram request.
- requestId
- Identifier specified in CancellationToken) request.
- cancellationToken
- CancellationToken
protected override ValueTask CancelOrderAsync(OrderCancelMessage cancelMsg, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.CancelOrderAsync(cancelMsg, cancellationToken)
protected override ValueTask CancelOrderGroupAsync(OrderGroupCancelMessage cancelMsg, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.CancelOrderGroupAsync(cancelMsg, cancellationToken)
private ValueTask CancelTickByTickData(long requestId, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.CancelTickByTickData(requestId, cancellationToken)
Cancels tick-by-tick data.
private ValueTask CancelWshEventData(long requestId, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.CancelWshEventData(requestId, cancellationToken)
Cancels pending WSH event data request.
private ValueTask CancelWshMetaData(long requestId, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.CancelWshMetaData(requestId, cancellationToken)
Cancels pending request for WSH metadata.
protected override ValueTask ConnectAsync(ConnectMessage connectMsg, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.ConnectAsync(connectMsg, cancellationToken)
private static string ConvertPeriod(DateTime startTime, DateTime endTime)
result = InteractiveBrokersMessageAdapter.ConvertPeriod(startTime, endTime)
used for reqHistoricalData.
protected override ValueTask DisconnectAsync(DisconnectMessage disconnectMsg, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.DisconnectAsync(disconnectMsg, cancellationToken)
private ValueTask ExerciseOptions(OrderRegisterMessage message, bool isExercise, decimal volume, string portfolioName, bool isOverride, DateTime? manualOrderTime, string customerAccount, bool? professionalCustomer, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.ExerciseOptions(message, isExercise, volume, portfolioName, isOverride, manualOrderTime, customerAccount, professionalCustomer, cancellationToken)
Exercises an options contract. This function is affected by a TWS setting which specifies if an exercise request must be finalized.
- message
- this structure contains a description of the contract to be exercised. If no multiplier is specified, a default of 100 is assumed.
- isExercise
- this can have two values: 1 = specifies exercise 2 = specifies lapse.
- volume
- the number of contracts to be exercised.
- portfolioName
- specifies whether your setting will override the system's natural action. For example, if your action is "exercise" and the option is not in-the-money, by natural action the option would not exercise. If you have override set to "yes" the natural action would be overridden and the out-of-the money option would be exercised. Values are: 0 = no 1 = yes.
- isOverride
- specifies whether your setting will override the system's natural action. For example, if your action is "exercise" and the option is not in-the-money, by natural action the option would not exercise. If you have override set to "yes" the natural action would be overridden and the out-of-the money option would be exercised. Values are: 0 = no 1 = yes.
- manualOrderTime
- Manual Order Time.
- customerAccount
- Customer Account.
- professionalCustomer
- Professional Customer.
- cancellationToken
- CancellationToken
public override bool IsAllDownloadingSupported(DataType dataType)
result = interactiveBrokersMessageAdapter.IsAllDownloadingSupported(dataType)
Is for the specified all securities downloading enabled.
- dataType
- Data type info.
Returns: Check result.
public override bool IsSupportCandlesUpdates(MarketDataMessage subscription)
result = interactiveBrokersMessageAdapter.IsSupportCandlesUpdates(subscription)
Support candles subscription and live updates.
- subscription
- MarketDataMessage
Returns: Check result.
public override void Load(SettingsStorage storage)
interactiveBrokersMessageAdapter.Load(storage)
Load settings.
- storage
- Settings storage.
protected override ValueTask MarketDataAsync(MarketDataMessage mdMsg, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.MarketDataAsync(mdMsg, cancellationToken)
protected override ValueTask OrderStatusAsync(OrderStatusMessage statusMsg, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.OrderStatusAsync(statusMsg, cancellationToken)
private ValueTask QueryDisplayGroups(long requestId, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.QueryDisplayGroups(requestId, cancellationToken)
Requests all available Display Groups in TWS.
- requestId
- The ID of this request.
- cancellationToken
- CancellationToken
protected override ValueTask RegisterOrderAsync(OrderRegisterMessage regMsg, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.RegisterOrderAsync(regMsg, cancellationToken)
private ValueTask ReplaceFinancialAdvisor(long requestId, string dataType, string config, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.ReplaceFinancialAdvisor(requestId, dataType, config, cancellationToken)
Replaces Financial Advisor's settings.
- requestId
- dataType
- Specifies the type of Financial Advisor configuration data being requested. Valid values include: Groups Profiles Account Aliases
- config
- The XML string containing the new FA configuration information.
- cancellationToken
- CancellationToken
protected override ValueTask ReplaceOrderAsync(OrderReplaceMessage replaceMsg, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.ReplaceOrderAsync(replaceMsg, cancellationToken)
private ValueTask RequestAllOpenOrders(CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.RequestAllOpenOrders(cancellationToken)
Call this method to request the open orders that were placed from all clients and also from TWS. Each open order will be fed back through the openOrder() and orderStatus() functions on the EWrapper. No association is made between the returned orders and the requesting client.
private ValueTask RequestAutoOpenOrders(bool autoBind, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.RequestAutoOpenOrders(autoBind, cancellationToken)
Call this method to request that newly created TWS orders be implicitly associated with the client. When a new TWS order is created, the order will be associated with the client and fed back through the openOrder() and orderStatus() methods on the EWrapper. TWS orders can only be bound to clients with a clientId of “0”.
- autoBind
- If set to , newly created TWS orders will be implicitly associated with the client. If set to , no association will be made.
- cancellationToken
- CancellationToken
private ValueTask RequestCompletedOrders(bool apiOnly, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.RequestCompletedOrders(apiOnly, cancellationToken)
Requests completed orders.
- apiOnly
- Request only API orders.
- cancellationToken
- CancellationToken
private ValueTask RequestCurrentTime(CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.RequestCurrentTime(cancellationToken)
Returns the current system time on the server side.
private ValueTask RequestFamilyCodes(CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.RequestFamilyCodes(cancellationToken)
Requests family codes for an account, for instance if it is a FA, IBroker, or associated account.
private ValueTask RequestFinancialAdvisor(string dataType, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.RequestFinancialAdvisor(dataType, cancellationToken)
Requests the FA configuration.
- dataType
- Specifies the type of Financial Advisor configuration data being requested. Valid values include: Groups Profiles Account Aliases
- cancellationToken
- CancellationToken
private ValueTask RequestHeadTimestamp(long requestId, SecurityMessage security, string whatToShow, int useRth, int formatDate, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.RequestHeadTimestamp(requestId, security, whatToShow, useRth, formatDate, cancellationToken)
Returns the timestamp of earliest available historical data for a contract and data type.
- requestId
- An identifier for the request.
- security
- Contract object for which head timestamp is being requested.
- whatToShow
- Type of data for head timestamp - "BID", "ASK", "TRADES", etc.
- useRth
- Use regular trading hours only.
- formatDate
- Set to 1 to obtain the bars' time as yyyyMMdd HH:mm:ss, set to 2 to obtain it like system time format in seconds.
- cancellationToken
- CancellationToken
private ValueTask RequestHistogramData(long requestId, SecurityMessage security, bool useRth, string period, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.RequestHistogramData(requestId, security, useRth, period, cancellationToken)
Returns data histogram of specified contract.
- requestId
- An identifier for the request.
- security
- Contract object for which histogram is being requested.
- useRth
- Use regular trading hours only.
- period
- Period of which data is being requested, e.g. "3 days".
- cancellationToken
- CancellationToken
private ValueTask RequestHistoricalNews(long requestId, int? contractId, string providerCodes, DateTime startDateTime, DateTime endDateTime, long totalResults, Tuple<string, string>[] tags, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.RequestHistoricalNews(requestId, contractId, providerCodes, startDateTime, endDateTime, totalResults, tags, cancellationToken)
Requests historical news headlines.
- requestId
- contractId
- Contract id of ticker.
- providerCodes
- A '+'-separated list of provider codes.
- startDateTime
- Marks the (exclusive) start of the date range. The format is yyyy-MM-dd HH:mm:ss.0.
- endDateTime
- Marks the (inclusive) end of the date range. The format is yyyy-MM-dd HH:mm:ss.0.
- totalResults
- The maximum number of headlines to fetch (1 - 300).
- tags
- Reserved for internal use. Should be defined as empty.
- cancellationToken
- CancellationToken
private ValueTask RequestHistoricalTicks(MarketDataMessage message, bool useRth, bool ignoreSize, Tuple<string, string>[] miscOptions, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.RequestHistoricalTicks(message, useRth, ignoreSize, miscOptions, cancellationToken)
Requests historical Time&Sales data for an instrument.
- message
- useRth
- Data from regular trading hours, or all available hours.
- ignoreSize
- miscOptions
- Should be defined as empty, reserved for internal use.
- cancellationToken
- CancellationToken
private ValueTask RequestIds(int numberOfIds, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.RequestIds(numberOfIds, cancellationToken)
Returns one next valid Id.
- numberOfIds
- Has No Effect.
- cancellationToken
- CancellationToken
private ValueTask RequestMarketDataType(CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.RequestMarketDataType(cancellationToken)
indicates the TWS to enable "frozen", "delayed" or "delayed-frozen" market data. Requires TWS/IBG v963+. The API can receive frozen market data from Trader Workstation. Frozen market data is the last data recorded in our system. During normal trading hours, the API receives real-time market data.Invoking this function with argument 2 requests a switch to frozen data immediately or after the close. When the market reopens the next data the market data type will automatically switch back to real time if available.
private ValueTask RequestMarketDepthExchanges(CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.RequestMarketDepthExchanges(cancellationToken)
Requests venues for which market data is returned to updateMktDepthL2 (those with market makers).
private ValueTask RequestMarketRule(int marketRuleId, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.RequestMarketRule(marketRuleId, cancellationToken)
Requests details about a given market rule. The market rule for an instrument on a particular exchange provides details about how the minimum price increment changes with price. A list of market rule ids can be obtained by invoking reqContractDetails on a particular contract. The returned market rule ID list will provide the market rule ID for the instrument in the correspond valid exchange list in contractDetails.
private ValueTask RequestMatchingSymbols(long requestId, string pattern, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.RequestMatchingSymbols(requestId, pattern, cancellationToken)
Requests matching symbols (implements 'google-like' suggestions as user starts typing symbol or contract name).
- requestId
- pattern
- User typed string pattern.
- cancellationToken
- CancellationToken
private ValueTask RequestMyTrades(long requestId, MyTradeFilter filter, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.RequestMyTrades(requestId, filter, cancellationToken)
When this method is called, the execution reports that meet the filter criteria are downloaded to the client via the execDetails() method.
- requestId
- filter
- the filter criteria used to determine which execution reports are returned.
- cancellationToken
- CancellationToken
private ValueTask RequestNewsArticle(long requestId, string providerCode, string articleId, Tuple<string, string>[] tags, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.RequestNewsArticle(requestId, providerCode, articleId, tags, cancellationToken)
Requests news article body given articleId.
- requestId
- Id of the request.
- providerCode
- Short code indicating news provider, e.g. FLY.
- articleId
- Id of the specific article.
- tags
- Reserved for internal use. Should be defined as empty.
- cancellationToken
- CancellationToken
private ValueTask RequestNewsProviders(CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.RequestNewsProviders(cancellationToken)
Requests news providers which the user has subscribed to.
private ValueTask RequestOpenOrders(CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.RequestOpenOrders(cancellationToken)
Call this method to request the open orders that were placed from this client. Each open order will be fed back through the openOrder() and orderStatus() functions on the EWrapper. The client with a clientId of "0" will also receive the TWS-owned open orders. These orders will be associated with the client and a new orderId will be generated. This association will persist over multiple API and TWS sessions.
private ValueTask RequestPortfolios(CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.RequestPortfolios(cancellationToken)
Call this method to request the list of managed accounts. The list will be returned by the managedAccounts() function on the EWrapper. This request can only be made when connected to a Financial Advisor (FA) account.
private ValueTask RequestScannerParameters(CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.RequestScannerParameters(cancellationToken)
Call the reqScannerParameters() method to receive an XML document that describes the valid parameters that a scanner subscription can have.
private ValueTask RequestSecurityDefinitionOptionParams(long requestId, string underlyingSymbol, string futFopExchange, SecurityTypes? underlyingSecType, int? underlyingContractId, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.RequestSecurityDefinitionOptionParams(requestId, underlyingSymbol, futFopExchange, underlyingSecType, underlyingContractId, cancellationToken)
Requests security definition option parameters for viewing a contract's option chain.
- requestId
- The ID chosen for the request.
- underlyingSymbol
- futFopExchange
- The exchange on which the returned options are trading. Can be set to the empty string "" for all exchanges.
- underlyingSecType
- The type of the underlying security.
- underlyingContractId
- The contract ID of the underlying security.
- cancellationToken
- CancellationToken
private ValueTask RequestSecurityInfo(SecurityLookupMessage criteria, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.RequestSecurityInfo(criteria, cancellationToken)
Call this function to download all details for a particular underlying. the contract details will be received via the contractDetails() function on the EWrapper.
- criteria
- summary description of the contract being looked up.
- cancellationToken
- CancellationToken
private ValueTask RequestSmartComponents(long requestId, string bboExchange, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.RequestSmartComponents(requestId, bboExchange, cancellationToken)
Returns the mapping of single letter codes to exchange names given the mapping identifier.
- requestId
- bboExchange
- cancellationToken
- CancellationToken
private ValueTask RequestSoftDollarTiers(long requestId, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.RequestSoftDollarTiers(requestId, cancellationToken)
Requests pre-defined Soft Dollar Tiers. This is only supported for registered professional advisors and hedge and mutual funds who have configured Soft Dollar Tiers in Account Management. Refer to: https://www.interactivebrokers.com/en/software/am/am/manageaccount/requestsoftdollars.htm?Highlight=soft%20dollar%20tier
private ValueTask RequestTickByTickData(long requestId, SecurityMessage security, Level1Fields tickType, int numberOfTicks, bool ignoreSize, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.RequestTickByTickData(requestId, security, tickType, numberOfTicks, ignoreSize, cancellationToken)
Requests tick-by-tick data.
- requestId
- unique identifier of the request.
- security
- the contract for which tick-by-tick data is requested.
- tickType
- tick-by-tick data type: "Last", "AllLast", "BidAsk" or "MidPoint".
- numberOfTicks
- Number of ticks.
- ignoreSize
- Ignore size.
- cancellationToken
- CancellationToken
private ValueTask RequestWshEventData(MarketDataMessage message, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.RequestWshEventData(message, cancellationToken)
Requests event data from the WSH calendar.
private ValueTask RequestWshMetaData(MarketDataMessage message, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.RequestWshMetaData(message, cancellationToken)
Requests metadata from the WSH calendar.
protected override ValueTask ResetAsync(ResetMessage resetMsg, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.ResetAsync(resetMsg, cancellationToken)
public override void Save(SettingsStorage storage)
interactiveBrokersMessageAdapter.Save(storage)
Save settings.
- storage
- Settings storage.
protected override ValueTask SecurityLookupAsync(SecurityLookupMessage lookupMsg, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.SecurityLookupAsync(lookupMsg, cancellationToken)
public override ValueTask SendInMessageAsync(Message message, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.SendInMessageAsync(message, cancellationToken)
Processes a generic message asynchronously.
- message
- The message to process.
- cancellationToken
- CancellationToken
private ValueTask SetServerLogLevel(CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.SetServerLogLevel(cancellationToken)
Changes the TWS/GW log level. The default is Error.
private ValueTask SubscribeCalculateImpliedVolatility(OptionCalcMarketDataMessage message, Tuple<string, string>[] tags, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.SubscribeCalculateImpliedVolatility(message, tags, cancellationToken)
To subscribe for receiving of the implied volatility for the specified instrument.
- message
- tags
- Reserved for future use, must be blank.
- cancellationToken
- CancellationToken
private ValueTask SubscribeCalculateOptionPrice(OptionCalcMarketDataMessage message, Tuple<string, string>[] tags, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.SubscribeCalculateOptionPrice(message, tags, cancellationToken)
To subscribe for Greeks getting for the specified instrument.
- message
- Security.
- tags
- Reserved for future use, must be blank.
- cancellationToken
- CancellationToken
private ValueTask SubscribeHistoricalCandles(MarketDataMessage message, TimeSpan timeFrame, Level1Fields field, bool useRth, Tuple<string, string>[] tags, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.SubscribeHistoricalCandles(message, timeFrame, field, useRth, tags, cancellationToken)
To subscribe for instrument historical values getting at specified intervals.
- message
- The message about subscription or unsubscription for market data.
- timeFrame
- field
- The market data field. Following values are supported: Trades.Bid.Ask.Midpoint.BidAsk.ImpliedVolatility.HistoricalVolatility..
- useRth
- To get data only by the trading time. By default the trading time is used.
- tags
- cancellationToken
- CancellationToken
private ValueTask SubscribeMarketData(MarketDataMessage message, IEnumerable<Level1Fields> genericFields, bool snapshot, bool regulatorySnaphsot, IEnumerable<Tuple<string, string>> mktDataOptions, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.SubscribeMarketData(message, genericFields, snapshot, regulatorySnaphsot, mktDataOptions, cancellationToken)
Call this method to request market data. The market data will be returned by the tickPrice, tickSize, tickOptionComputation(), tickGeneric(), tickString() and tickEFP() methods.
- message
- this structure contains a description of the contract for which market data is being requested.
- genericFields
- comma delimited list of generic tick types. Tick types can be found here: (new Generic Tick Types page).
- snapshot
- Allows client to request snapshot market data.
- regulatorySnaphsot
- Regulatory snapshot requests NBBO snapshots for users which have "US Securities Snapshot Bundle" subscription but not corresponding Network A, B, or C subscription necessary for streaming.
- mktDataOptions
- Market Data Off - used in conjunction with RTVolume Generic tick type causes only volume data to be sent.
- cancellationToken
- CancellationToken
private ValueTask SubscribeMarketDepth(MarketDataMessage message, bool isSmartDepth, Tuple<string, string>[] tags, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.SubscribeMarketDepth(message, isSmartDepth, tags, cancellationToken)
Call this method to request market depth for a specific contract. The market depth will be returned by the updateMktDepth() and updateMktDepthL2() methods.
- message
- this structure contains a description of the contract for which market depth data is being requested.
- isSmartDepth
- Flag indicates that this is smart depth request.
- tags
- cancellationToken
- CancellationToken
private ValueTask SubscribeNewsBulletins(bool allMessages, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.SubscribeNewsBulletins(allMessages, cancellationToken)
Call this method to start receiving news bulletins. Each bulletin will be returned by the updateNewsBulletin() method.
- allMessages
- if set to , returns all the existing bulletins for the current day and any new ones. IF set to , will only return new bulletins.
- cancellationToken
- CancellationToken
private ValueTask SubscribePnL(long requestId, string account, string modelCode, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.SubscribePnL(requestId, account, modelCode, cancellationToken)
Creates subscription for real time daily PnL and unrealized PnL updates.
- requestId
- account
- Account for which to receive PnL updates.
- modelCode
- Specify to request PnL updates for a specific model.
- cancellationToken
- CancellationToken
private ValueTask SubscribePnLSingle(long requestId, string account, string modelCode, long contractId, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.SubscribePnLSingle(requestId, account, modelCode, contractId, cancellationToken)
Requests real time updates for daily PnL of individual positions.
- requestId
- account
- Account for which to receive PnL updates.
- modelCode
- Specify to request PnL updates for a specific model.
- contractId
- Contract ID (conId) of contract to receive daily PnL updates for.
- cancellationToken
- CancellationToken
private ValueTask SubscribePortfolio(string portfolioName, bool isSubscribe, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.SubscribePortfolio(portfolioName, isSubscribe, cancellationToken)
Call this function to start getting account values, portfolio, and last update time information.
- isSubscribe
- If set to , the client will start receiving account and portfolio updates. If set to , the client will stop receiving this information.
- portfolioName
- the account code for which to receive account and portfolio updates.
- cancellationToken
- CancellationToken
private ValueTask SubscribePositionMulti(long requestId, string account, string modelCode, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.SubscribePositionMulti(requestId, account, modelCode, cancellationToken)
Requests positions for account and/or model.
- requestId
- Request's identifier.
- account
- If an account Id is provided, only the account's positions belonging to the specified model will be delivered.
- modelCode
- The code of the model's positions we are interested in.
- cancellationToken
- CancellationToken
private ValueTask SubscribePotfrolioMulti(long requestId, string account, string modelCode, bool ledgerAndNlv, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.SubscribePotfrolioMulti(requestId, account, modelCode, ledgerAndNlv, cancellationToken)
Requests account updates for account and/or model.
- requestId
- Identifier to label the request.
- account
- Account values can be requested for a particular account.
- modelCode
- Values can also be requested for a model.
- ledgerAndNlv
- Returns light-weight request; only currency positions as opposed to account values and currency positions.
- cancellationToken
- CancellationToken
private ValueTask SubscribeRealTimeCandles(MarketDataMessage message, Level1Fields field, bool useRth, Tuple<string, string>[] tags, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.SubscribeRealTimeCandles(message, field, useRth, tags, cancellationToken)
To subscribe for real-time candles receiving.
- message
- field
- Market data fields upon which candles will be created. The following values are supported: Trades.Bid.Ask.Midpoint..
- useRth
- To create candles only by the trading time. By default the trading time is used.
- tags
- cancellationToken
- CancellationToken
private ValueTask SubscribeScanner(ScannerMarketDataMessage message, Tuple<string, string>[] tags, Tuple<string, string>[] filterOptions, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.SubscribeScanner(message, tags, filterOptions, cancellationToken)
To start the instrument scanner based on specified parameters.
- message
- Instrument scanner filter settings.
- tags
- filterOptions
- cancellationToken
- CancellationToken
private ValueTask SubscribeToGroupEvents(long requestId, int groupId, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.SubscribeToGroupEvents(requestId, groupId, cancellationToken)
Integrates API client and TWS window grouping.
- requestId
- The Id chosen for this subscription request.
- groupId
- The display group for integration.
- cancellationToken
- CancellationToken
public override string ToString()
result = interactiveBrokersMessageAdapter.ToString()
Преобразовать к строковому представлению.
Returns: Строковое представление.
private ValueTask UnSubscribeCalculateImpliedVolatility(long requestId, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.UnSubscribeCalculateImpliedVolatility(requestId, cancellationToken)
To stop subscription for receiving of the implied volatility for the specified instrument, created earlier via CancellationToken).
- requestId
- cancellationToken
- CancellationToken
private ValueTask UnSubscribeCalculateOptionPrice(long requestId, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.UnSubscribeCalculateOptionPrice(requestId, cancellationToken)
To stop subscription for receiving of the Greeks for the specified instrument, created earlier via CancellationToken).
- requestId
- cancellationToken
- CancellationToken
private ValueTask UnSubscribeFromGroupEvents(long requestId, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.UnSubscribeFromGroupEvents(requestId, cancellationToken)
Cancels a TWS Window Group subscription.
- requestId
- cancellationToken
- CancellationToken
private ValueTask UnSubscribeMarketData(long requestId, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.UnSubscribeMarketData(requestId, cancellationToken)
After calling this method, market data for the specified Id will stop flowing.
private ValueTask UnSubscribeMarketDepth(long requestId, bool isSmartDepth, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.UnSubscribeMarketDepth(requestId, isSmartDepth, cancellationToken)
After calling this method, market depth data for the specified Id will stop flowing.
private ValueTask UnSubscribeNewsBulletins(CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.UnSubscribeNewsBulletins(cancellationToken)
Call this method to stop receiving news bulletins.
private ValueTask UnSubscribePnL(long requestId, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.UnSubscribePnL(requestId, cancellationToken)
Cancels subscription for real time updated daily PnL.
- requestId
- cancellationToken
- CancellationToken
private ValueTask UnSubscribePnLSingle(long requestId, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.UnSubscribePnLSingle(requestId, cancellationToken)
Cancels real time subscription for a positions daily PnL information.
- requestId
- cancellationToken
- CancellationToken
private ValueTask UnSubscribePositionMulti(long requestId, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.UnSubscribePositionMulti(requestId, cancellationToken)
Cancels positions request for account and/or model.
- requestId
- The identifier of the request to be canceled.
- cancellationToken
- CancellationToken
private ValueTask UnSubscribePotfrolioMulti(long requestId, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.UnSubscribePotfrolioMulti(requestId, cancellationToken)
Cancels account updates request for account and/or model.
- requestId
- cancellationToken
- CancellationToken
private ValueTask UnSubscribeRealTimeCandles(long requestId, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.UnSubscribeRealTimeCandles(requestId, cancellationToken)
To stop the candles receiving subscription, previously created by CancellationToken).
- requestId
- cancellationToken
- CancellationToken
private ValueTask UnSubscribeScanner(long requestId, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.UnSubscribeScanner(requestId, cancellationToken)
To stop the instrument scanner previously started via CancellationToken).
private ValueTask UpdateDisplayGroup(long requestId, string contractInfo, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.UpdateDisplayGroup(requestId, contractInfo, cancellationToken)
Updates the contract displayed in a TWS Window Group.
- requestId
- The ID chosen for this request.
- contractInfo
- Is an encoded value designating a unique IB contract. Possible values include: none = empty selection contractID@exchange - any non-combination contract.Examples 8314@SMART for IBM SMART; 8314@ARCA for IBM ARCA combo = if any combo is selected
- cancellationToken
- CancellationToken
private ValueTask VerifyAndAuthMessage(string apiData, string xyzResponse, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.VerifyAndAuthMessage(apiData, xyzResponse, cancellationToken)
For IB's internal purpose. Allows to provide means of verification between the TWS and third party programs.
private ValueTask VerifyVerifyAndAuthRequest(string apiName, string apiVersion, string opaqueIsvKey, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.VerifyVerifyAndAuthRequest(apiName, apiVersion, opaqueIsvKey, cancellationToken)
For IB's internal purpose. Allows to provide means of verification between the TWS and third party programs.
Fields
public static readonly EndPoint DefaultAddress
value = InteractiveBrokersMessageAdapter.DefaultAddress
Address by default.
public static readonly EndPoint DefaultGatewayAddress
value = InteractiveBrokersMessageAdapter.DefaultGatewayAddress
Address by default.