InteractiveBrokersMessageAdapter

StockSharp.InteractiveBrokers

The messages adapter for InteractiveBrokers.

Inherits: MessageAdapter

Implements: IAddressAdapter<EndPoint>

Constructors

InteractiveBrokersMessageAdapter
public InteractiveBrokersMessageAdapter(IdGenerator transactionIdGenerator)
interactiveBrokersMessageAdapter = InteractiveBrokersMessageAdapter(transactionIdGenerator)

Initializes a new instance of the InteractiveBrokersMessageAdapter.

transactionIdGenerator
Transaction id generator.

Properties

Address
public EndPoint Address { get; set; }
value = interactiveBrokersMessageAdapter.Address
interactiveBrokersMessageAdapter.Address = value

Address.

AllTimeFrames
public static IEnumerable<TimeSpan> AllTimeFrames { get; }
value = InteractiveBrokersMessageAdapter.AllTimeFrames

Possible time-frames.

CandlesBuildFrom
public override IEnumerable<Level1Fields> CandlesBuildFrom { get; }
value = interactiveBrokersMessageAdapter.CandlesBuildFrom

Possible options for candles building.

CheckCertificateRevocation
public bool CheckCertificateRevocation { get; set; }
value = interactiveBrokersMessageAdapter.CheckCertificateRevocation
interactiveBrokersMessageAdapter.CheckCertificateRevocation = value

Check certificate revocation.

ClientId
public int ClientId { get; set; }
value = interactiveBrokersMessageAdapter.ClientId
interactiveBrokersMessageAdapter.ClientId = value

Unique ID. Used when several clients are connected to one terminal or gateway.

ConnectedTime
public DateTime? ConnectedTime { get; private set; }
value = interactiveBrokersMessageAdapter.ConnectedTime
interactiveBrokersMessageAdapter.ConnectedTime = value

The connection time.

ExtraAuth
public bool ExtraAuth { get; set; }
value = interactiveBrokersMessageAdapter.ExtraAuth
interactiveBrokersMessageAdapter.ExtraAuth = value

Extra authentication.

ExtraSetup
public override bool ExtraSetup { get; }
value = interactiveBrokersMessageAdapter.ExtraSetup

The adapter requires extra setup.

FeatureName
public override string FeatureName { get; }
value = interactiveBrokersMessageAdapter.FeatureName

Feature name.

IsAutoReplyOnTransactonalUnsubscription
public override bool IsAutoReplyOnTransactonalUnsubscription { get; }
value = interactiveBrokersMessageAdapter.IsAutoReplyOnTransactonalUnsubscription

Send auto response for OrderStatusMessage and PortfolioLookupMessage unsubscribes.

MarketDataType
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.

MaxVersion
public ServerVersions MaxVersion { get; set; }
value = interactiveBrokersMessageAdapter.MaxVersion
interactiveBrokersMessageAdapter.MaxVersion = value

Max support version.

OptionalCapabilities
public string OptionalCapabilities { get; set; }
value = interactiveBrokersMessageAdapter.OptionalCapabilities
interactiveBrokersMessageAdapter.OptionalCapabilities = value

Optional capabilities.

ServerLogLevel
public ServerLogLevels ServerLogLevel { get; set; }
value = interactiveBrokersMessageAdapter.ServerLogLevel
interactiveBrokersMessageAdapter.ServerLogLevel = value

The server messages logging level. The default is Information.

SslCertificate
public string SslCertificate { get; set; }
value = interactiveBrokersMessageAdapter.SslCertificate
interactiveBrokersMessageAdapter.SslCertificate = value

SSL certificate.

SslCertificatePassword
public SecureString SslCertificatePassword { get; set; }
value = interactiveBrokersMessageAdapter.SslCertificatePassword
interactiveBrokersMessageAdapter.SslCertificatePassword = value

SSL certificate password.

SslProtocol
public SslProtocols SslProtocol { get; set; }
value = interactiveBrokersMessageAdapter.SslProtocol
interactiveBrokersMessageAdapter.SslProtocol = value

SSL protocol to establish connect.

SupportedOrderBookDepths
public override IEnumerable<int> SupportedOrderBookDepths { get; }
value = interactiveBrokersMessageAdapter.SupportedOrderBookDepths

Available options for MaxDepth.

TargetHost
public string TargetHost { get; set; }
value = interactiveBrokersMessageAdapter.TargetHost
interactiveBrokersMessageAdapter.TargetHost = value

The name of the server that shares SSL connection.

UseV100Plus
public bool UseV100Plus { get; set; }
value = interactiveBrokersMessageAdapter.UseV100Plus
interactiveBrokersMessageAdapter.UseV100Plus = value

Use V100 plus version at the connect time.

ValidateRemoteCertificates
public bool ValidateRemoteCertificates { get; set; }
value = interactiveBrokersMessageAdapter.ValidateRemoteCertificates
interactiveBrokersMessageAdapter.ValidateRemoteCertificates = value

Validate remove certificates.

Methods

CancelHistogramData
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
CancelOrderAsync
protected override ValueTask CancelOrderAsync(OrderCancelMessage cancelMsg, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.CancelOrderAsync(cancelMsg, cancellationToken)
CancelOrderGroupAsync
protected override ValueTask CancelOrderGroupAsync(OrderGroupCancelMessage cancelMsg, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.CancelOrderGroupAsync(cancelMsg, cancellationToken)
CancelTickByTickData
private ValueTask CancelTickByTickData(long requestId, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.CancelTickByTickData(requestId, cancellationToken)

Cancels tick-by-tick data.

CancelWshEventData
private ValueTask CancelWshEventData(long requestId, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.CancelWshEventData(requestId, cancellationToken)

Cancels pending WSH event data request.

CancelWshMetaData
private ValueTask CancelWshMetaData(long requestId, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.CancelWshMetaData(requestId, cancellationToken)

Cancels pending request for WSH metadata.

ConnectAsync
protected override ValueTask ConnectAsync(ConnectMessage connectMsg, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.ConnectAsync(connectMsg, cancellationToken)
ConvertPeriod
private static string ConvertPeriod(DateTime startTime, DateTime endTime)
result = InteractiveBrokersMessageAdapter.ConvertPeriod(startTime, endTime)

used for reqHistoricalData.

DisconnectAsync
protected override ValueTask DisconnectAsync(DisconnectMessage disconnectMsg, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.DisconnectAsync(disconnectMsg, cancellationToken)
ExerciseOptions
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
IsAllDownloadingSupported
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.

IsSupportCandlesUpdates
public override bool IsSupportCandlesUpdates(MarketDataMessage subscription)
result = interactiveBrokersMessageAdapter.IsSupportCandlesUpdates(subscription)

Support candles subscription and live updates.

subscription
MarketDataMessage

Returns: Check result.

Load
public override void Load(SettingsStorage storage)
interactiveBrokersMessageAdapter.Load(storage)

Load settings.

storage
Settings storage.
MarketDataAsync
protected override ValueTask MarketDataAsync(MarketDataMessage mdMsg, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.MarketDataAsync(mdMsg, cancellationToken)
OrderStatusAsync
protected override ValueTask OrderStatusAsync(OrderStatusMessage statusMsg, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.OrderStatusAsync(statusMsg, cancellationToken)
QueryDisplayGroups
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
RegisterOrderAsync
protected override ValueTask RegisterOrderAsync(OrderRegisterMessage regMsg, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.RegisterOrderAsync(regMsg, cancellationToken)
ReplaceFinancialAdvisor
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
ReplaceOrderAsync
protected override ValueTask ReplaceOrderAsync(OrderReplaceMessage replaceMsg, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.ReplaceOrderAsync(replaceMsg, cancellationToken)
RequestAllOpenOrders
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.

RequestAutoOpenOrders
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
RequestCompletedOrders
private ValueTask RequestCompletedOrders(bool apiOnly, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.RequestCompletedOrders(apiOnly, cancellationToken)

Requests completed orders.

apiOnly
Request only API orders.
cancellationToken
CancellationToken
RequestCurrentTime
private ValueTask RequestCurrentTime(CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.RequestCurrentTime(cancellationToken)

Returns the current system time on the server side.

RequestFamilyCodes
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.

RequestFinancialAdvisor
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
RequestHeadTimestamp
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
RequestHistogramData
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
RequestHistoricalNews
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
RequestHistoricalTicks
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
RequestIds
private ValueTask RequestIds(int numberOfIds, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.RequestIds(numberOfIds, cancellationToken)

Returns one next valid Id.

numberOfIds
Has No Effect.
cancellationToken
CancellationToken
RequestMarketDataType
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.

RequestMarketDepthExchanges
private ValueTask RequestMarketDepthExchanges(CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.RequestMarketDepthExchanges(cancellationToken)

Requests venues for which market data is returned to updateMktDepthL2 (those with market makers).

RequestMarketRule
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.

RequestMatchingSymbols
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
RequestMyTrades
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
RequestNewsArticle
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
RequestNewsProviders
private ValueTask RequestNewsProviders(CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.RequestNewsProviders(cancellationToken)

Requests news providers which the user has subscribed to.

RequestOpenOrders
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.

RequestPortfolios
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.

RequestScannerParameters
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.

RequestSecurityDefinitionOptionParams
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
RequestSecurityInfo
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
RequestSmartComponents
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
RequestSoftDollarTiers
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

RequestTickByTickData
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
RequestWshEventData
private ValueTask RequestWshEventData(MarketDataMessage message, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.RequestWshEventData(message, cancellationToken)

Requests event data from the WSH calendar.

RequestWshMetaData
private ValueTask RequestWshMetaData(MarketDataMessage message, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.RequestWshMetaData(message, cancellationToken)

Requests metadata from the WSH calendar.

ResetAsync
protected override ValueTask ResetAsync(ResetMessage resetMsg, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.ResetAsync(resetMsg, cancellationToken)
Save
public override void Save(SettingsStorage storage)
interactiveBrokersMessageAdapter.Save(storage)

Save settings.

storage
Settings storage.
SecurityLookupAsync
protected override ValueTask SecurityLookupAsync(SecurityLookupMessage lookupMsg, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.SecurityLookupAsync(lookupMsg, cancellationToken)
SendInMessageAsync
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
SetServerLogLevel
private ValueTask SetServerLogLevel(CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.SetServerLogLevel(cancellationToken)

Changes the TWS/GW log level. The default is Error.

SubscribeCalculateImpliedVolatility
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
SubscribeCalculateOptionPrice
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
SubscribeHistoricalCandles
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
SubscribeMarketData
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
SubscribeMarketDepth
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
SubscribeNewsBulletins
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
SubscribePnL
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
SubscribePnLSingle
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
SubscribePortfolio
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
SubscribePositionMulti
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
SubscribePotfrolioMulti
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
SubscribeRealTimeCandles
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
SubscribeScanner
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
SubscribeToGroupEvents
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
ToString
public override string ToString()
result = interactiveBrokersMessageAdapter.ToString()

Преобразовать к строковому представлению.

Returns: Строковое представление.

UnSubscribeCalculateImpliedVolatility
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
UnSubscribeCalculateOptionPrice
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
UnSubscribeFromGroupEvents
private ValueTask UnSubscribeFromGroupEvents(long requestId, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.UnSubscribeFromGroupEvents(requestId, cancellationToken)

Cancels a TWS Window Group subscription.

requestId
cancellationToken
CancellationToken
UnSubscribeMarketData
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.

UnSubscribeMarketDepth
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.

UnSubscribeNewsBulletins
private ValueTask UnSubscribeNewsBulletins(CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.UnSubscribeNewsBulletins(cancellationToken)

Call this method to stop receiving news bulletins.

UnSubscribePnL
private ValueTask UnSubscribePnL(long requestId, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.UnSubscribePnL(requestId, cancellationToken)

Cancels subscription for real time updated daily PnL.

requestId
cancellationToken
CancellationToken
UnSubscribePnLSingle
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
UnSubscribePositionMulti
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
UnSubscribePotfrolioMulti
private ValueTask UnSubscribePotfrolioMulti(long requestId, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.UnSubscribePotfrolioMulti(requestId, cancellationToken)

Cancels account updates request for account and/or model.

requestId
cancellationToken
CancellationToken
UnSubscribeRealTimeCandles
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
UnSubscribeScanner
private ValueTask UnSubscribeScanner(long requestId, CancellationToken cancellationToken)
result = interactiveBrokersMessageAdapter.UnSubscribeScanner(requestId, cancellationToken)

To stop the instrument scanner previously started via CancellationToken).

UpdateDisplayGroup
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
VerifyAndAuthMessage
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.

VerifyVerifyAndAuthRequest
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

DefaultAddress
public static readonly EndPoint DefaultAddress
value = InteractiveBrokersMessageAdapter.DefaultAddress

Address by default.

DefaultGatewayAddress
public static readonly EndPoint DefaultGatewayAddress
value = InteractiveBrokersMessageAdapter.DefaultGatewayAddress

Address by default.