Table of Contents

Class InteractiveBrokersMessageAdapter

Namespace
StockSharp.InteractiveBrokers
Assembly
StockSharp.InteractiveBrokers.dll

The messages adapter for InteractiveBrokers.

[OrderCondition(typeof(InteractiveBrokersOrderCondition))]
[MediaIcon("InteractiveBrokers_logo.svg")]
[Display(ResourceType = typeof(LocalizedStrings), Name = "InteractiveBrokers", Description = "StockConnector", GroupName = "America")]
[MessageAdapterCategory(MessageAdapterCategories.US|MessageAdapterCategories.Stock|MessageAdapterCategories.FX|MessageAdapterCategories.RealTime|MessageAdapterCategories.Free|MessageAdapterCategories.Ticks|MessageAdapterCategories.Candles|MessageAdapterCategories.Level1|MessageAdapterCategories.Transactions|MessageAdapterCategories.Futures|MessageAdapterCategories.Options)]
public class InteractiveBrokersMessageAdapter : MessageAdapter, IMessageAdapter, IMessageChannel, ICloneable<IMessageChannel>, ICloneable, IPersistable, ILogReceiver, ILogSource, IDisposable, INotifyPropertyChanged, IAddressAdapter<EndPoint>
Inheritance
InteractiveBrokersMessageAdapter
Implements
ICloneable<IMessageChannel>
IPersistable
Inherited Members
Extension Methods

Constructors

InteractiveBrokersMessageAdapter(IdGenerator)

Initializes a new instance of the InteractiveBrokersMessageAdapter.

public InteractiveBrokersMessageAdapter(IdGenerator transactionIdGenerator)

Parameters

transactionIdGenerator IdGenerator

Transaction id generator.

Fields

DefaultAddress

Address by default.

public static readonly EndPoint DefaultAddress

Field Value

EndPoint

DefaultGatewayAddress

Address by default.

public static readonly EndPoint DefaultGatewayAddress

Field Value

EndPoint

Properties

Address

Address.

[Display(ResourceType = typeof(LocalizedStrings), Name = "Address", Description = "AddressDot", GroupName = "Connection", Order = 0)]
public EndPoint Address { get; set; }

Property Value

EndPoint

AllTimeFrames

Possible time-frames.

public static IEnumerable<TimeSpan> AllTimeFrames { get; }

Property Value

IEnumerable<TimeSpan>

CandlesBuildFrom

Possible options for candles building.

public override IEnumerable<Level1Fields> CandlesBuildFrom { get; }

Property Value

IEnumerable<Level1Fields>

CheckCertificateRevocation

Check certificate revocation.

[Display(ResourceType = typeof(LocalizedStrings), Name = "CheckCertificateRevocation", Description = "CheckCertificateRevocationDesc", GroupName = "Ssl", Order = 204)]
public bool CheckCertificateRevocation { get; set; }

Property Value

bool

ClientId

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

[Display(ResourceType = typeof(LocalizedStrings), Name = "Identifier", Description = "IBClientId", GroupName = "Connection", Order = 1)]
public int ClientId { get; set; }

Property Value

int

ConnectedTime

The connection time.

[Browsable(false)]
public DateTimeOffset? ConnectedTime { get; }

Property Value

DateTimeOffset?

ExtraAuth

Extra authentication.

[Browsable(false)]
public bool ExtraAuth { get; set; }

Property Value

bool

ExtraSetup

The adapter requires extra setup.

public override bool ExtraSetup { get; }

Property Value

bool

FeatureName

Feature name.

public override string FeatureName { get; }

Property Value

string

MarketDataType

Whether to use RealTime data or Frozen on the broker server. By default, the RealTime data is used.

[Display(ResourceType = typeof(LocalizedStrings), Name = "RealTime", Description = "IBRealTime", GroupName = "Connection", Order = 2)]
public InteractiveBrokersMarketDataTypes MarketDataType { get; set; }

Property Value

InteractiveBrokersMarketDataTypes

MaxVersion

Max support version.

[Display(ResourceType = typeof(LocalizedStrings), Name = "Version", Description = "MaxSupportVersion", GroupName = "Connection", Order = 10)]
public ServerVersions MaxVersion { get; set; }

Property Value

ServerVersions

OptionalCapabilities

Optional capabilities.

[Browsable(false)]
public string OptionalCapabilities { get; set; }

Property Value

string

ServerLogLevel

The server messages logging level. The default is Information.

[Display(ResourceType = typeof(LocalizedStrings), Name = "LogLevel", Description = "ServerLogLevel", GroupName = "Connection", Order = 3)]
public ServerLogLevels ServerLogLevel { get; set; }

Property Value

ServerLogLevels

SslCertificate

SSL certificate.

[Display(ResourceType = typeof(LocalizedStrings), Name = "Certificate", Description = "SslCertificate", GroupName = "Ssl", Order = 202)]
public string SslCertificate { get; set; }

Property Value

string

SslCertificatePassword

SSL certificate password.

[Display(ResourceType = typeof(LocalizedStrings), Name = "Password", Description = "SslCertificatePassword", GroupName = "Ssl", Order = 203)]
public SecureString SslCertificatePassword { get; set; }

Property Value

SecureString

SslProtocol

SSL protocol to establish connect.

[Display(ResourceType = typeof(LocalizedStrings), Name = "Protocol", Description = "SslProtocol", GroupName = "Ssl", Order = 201)]
public SslProtocols SslProtocol { get; set; }

Property Value

SslProtocols

SupportedOrderBookDepths

Available options for MaxDepth.

public override IEnumerable<int> SupportedOrderBookDepths { get; }

Property Value

IEnumerable<int>

TargetHost

The name of the server that shares SSL connection.

[Display(ResourceType = typeof(LocalizedStrings), Name = "TargetHost", Description = "TargetHostDesc", GroupName = "Ssl", Order = 206)]
public string TargetHost { get; set; }

Property Value

string

TimeFrames

Get possible time-frames for the specified instrument.

protected override IEnumerable<TimeSpan> TimeFrames { get; }

Property Value

IEnumerable<TimeSpan>

UseV100Plus

Use V100 plus version at the connect time.

[Browsable(false)]
public bool UseV100Plus { get; set; }

Property Value

bool

ValidateRemoteCertificates

Validate remove certificates.

[Display(ResourceType = typeof(LocalizedStrings), Name = "ValidateRemoteCertificates", Description = "ValidateRemoteCertificatesDesc", GroupName = "Ssl", Order = 205)]
public bool ValidateRemoteCertificates { get; set; }

Property Value

bool

Methods

GetHistoryStepSize(SecurityId, DataType, out TimeSpan)

Get maximum size step allowed for historical download.

public override TimeSpan GetHistoryStepSize(SecurityId securityId, DataType dataType, out TimeSpan iterationInterval)

Parameters

securityId SecurityId

SecurityId

dataType DataType

Data type info.

iterationInterval TimeSpan

Interval between iterations.

Returns

TimeSpan

Step.

IsSupportCandlesUpdates(MarketDataMessage)

Support candles subscription and live updates.

public override bool IsSupportCandlesUpdates(MarketDataMessage subscription)

Parameters

subscription MarketDataMessage

MarketDataMessage

Returns

bool

Check result.

Load(SettingsStorage)

Load settings.

public override void Load(SettingsStorage storage)

Parameters

storage SettingsStorage

Settings storage.

OnSendInMessage(Message)

Send message.

protected override bool OnSendInMessage(Message message)

Parameters

message Message

Message.

Returns

bool

true if the specified message was processed successfully, otherwise, false.

Save(SettingsStorage)

Save settings.

public override void Save(SettingsStorage storage)

Parameters

storage SettingsStorage

Settings storage.

ToString()

public override string ToString()

Returns

string