Table of Contents

Class FixMessageAdapter

Namespace
StockSharp.Fix
Assembly
StockSharp.Fix.dll

FIX message adapter.

[MediaIcon("Fix_logo.svg")]
[Display(ResourceType = typeof(LocalizedStrings), Name = "FIX", Description = "FixConnector")]
[MessageAdapterCategory(MessageAdapterCategories.Stock|MessageAdapterCategories.FX|MessageAdapterCategories.RealTime|MessageAdapterCategories.Paid|MessageAdapterCategories.Ticks|MessageAdapterCategories.Candles|MessageAdapterCategories.Level1|MessageAdapterCategories.OrderLog|MessageAdapterCategories.Transactions|MessageAdapterCategories.Futures|MessageAdapterCategories.Options)]
public class FixMessageAdapter : MessageAdapter, IMessageAdapter, IMessageChannel, ICloneable<IMessageChannel>, ICloneable, IPersistable, ILogReceiver, ILogSource, IDisposable, INotifyPropertyChanged, ILoginPasswordAdapter, IAddressAdapter<EndPoint>, ISenderTargetAdapter, IDemoAdapter
Inheritance
FixMessageAdapter
Implements
ICloneable<IMessageChannel>
IPersistable
Derived
Inherited Members
Extension Methods

Constructors

FixMessageAdapter(IdGenerator)

Initializes a new instance of the FixMessageAdapter.

public FixMessageAdapter(IdGenerator transactionIdGenerator)

Parameters

transactionIdGenerator IdGenerator

Transaction id generator.

Properties

Accounts

Accounts associated with FIX login.

[Display(ResourceType = typeof(LocalizedStrings), Name = "Portfolios", GroupName = "Session", Order = 27)]
public string Accounts { get; set; }

Property Value

string

Address

Server address.

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

Property Value

EndPoint

AssociatedBoard

The adapter can process subscription only with instruments associated with the specified board.

public override string AssociatedBoard { get; }

Property Value

string

CancelOnDisconnect

Cancel On Disconnect.

[Display(ResourceType = typeof(LocalizedStrings), Name = "CancelOnDisconnect", Description = "CancelOnDisconnectDot", GroupName = "Session", Order = 24)]
public bool CancelOnDisconnect { get; set; }

Property Value

bool

CandlesBuildFrom

Possible options for candles building.

public override IEnumerable<Level1Fields> CandlesBuildFrom { get; }

Property Value

IEnumerable<Level1Fields>

Categories

Message adapter categories.

public override MessageAdapterCategories Categories { get; }

Property Value

MessageAdapterCategories

CheckCertificateRevocation

Check certificate revocation.

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

Property Value

bool

CheckTimeFrameByRequest

Check possible time-frame by request.

public override bool CheckTimeFrameByRequest { get; }

Property Value

bool

ClientCode

Client code assigned by the broker.

[Display(ResourceType = typeof(LocalizedStrings), Name = "ClientCode", Description = "ClientCodeDesc", GroupName = "Session", Order = 21)]
public string ClientCode { get; set; }

Property Value

string

ClientVersion

[Display(ResourceType = typeof(LocalizedStrings), Name = "Version", Description = "ClientVersion", GroupName = "Session", Order = 27)]
public string ClientVersion { get; set; }

Property Value

string

DateFormat

Date format.

[Display(ResourceType = typeof(LocalizedStrings), Name = "DatesFormat", Description = "DatesFormatDot", GroupName = "Session", Order = 16)]
public string DateFormat { get; set; }

Property Value

string

Dialect

The FIX dialect. The default is DefaultFixDialect.

[Display(ResourceType = typeof(LocalizedStrings), Name = "Dialect", Description = "FixDialectProtocol", GroupName = "Session", Order = 1)]
public Type Dialect { get; set; }

Property Value

Type

DoNotSendAccount

Do not send Account.

[Display(ResourceType = typeof(LocalizedStrings), Name = "Account", Description = "DoNotSendAccount", GroupName = "Session", Order = 25)]
public bool DoNotSendAccount { get; set; }

Property Value

bool

Encoding

The encoding used for data transmission.

[Display(ResourceType = typeof(LocalizedStrings), Name = "Encoding", Description = "EncodingDesc", GroupName = "Session", Order = 11)]
public Encoding Encoding { get; set; }

Property Value

Encoding

EnqueueSubscriptions

Enqueue subscriptions.

public override bool EnqueueSubscriptions { get; set; }

Property Value

bool

Remarks

Do not send new request before received confirmation for previous.

ExchangeBoard

Board, where securities are traded.

[Display(ResourceType = typeof(LocalizedStrings), Name = "Board", Description = "FixConnectorBoard", GroupName = "Session", Order = 21)]
public string ExchangeBoard { get; set; }

Property Value

string

FeatureName

Feature name.

public override string FeatureName { get; }

Property Value

string

FixDialect

The FIX dialect.

[Browsable(false)]
public IFixDialect FixDialect { get; }

Property Value

IFixDialect

GenerateOrderBookFromLevel1

public override bool GenerateOrderBookFromLevel1 { get; set; }

Property Value

bool

Icon

Icon.

public override Uri Icon { get; }

Property Value

Uri

IsAutoReplyOnTransactonalUnsubscription

Send auto response for OrderStatusMessage and PortfolioLookupMessage unsubscribes.

public override bool IsAutoReplyOnTransactonalUnsubscription { get; }

Property Value

bool

IsDemo

Connect to demo trading instead of real trading server.

[Display(ResourceType = typeof(LocalizedStrings), Name = "Demo", Description = "DemoTradingConnect", GroupName = "Session", Order = 8)]
public bool IsDemo { get; set; }

Property Value

bool

IsFullCandlesOnly

Translates CandleMessage as only fully filled.

public override bool IsFullCandlesOnly { get; }

Property Value

bool

IsNativeIdentifiers

Identify security in messages by native identifier Native.

public override bool IsNativeIdentifiers { get; }

Property Value

bool

IsNativeIdentifiersPersistable

Native identifier can be stored.

public override bool IsNativeIdentifiersPersistable { get; }

Property Value

bool

IsPositionsEmulationRequired

Adapter required emulation PositionChangeMessage.

public override bool? IsPositionsEmulationRequired { get; }

Property Value

bool?

Remarks

null means no emulatior, true by order balance, false by trades.

IsReplaceCommandEditCurrent

Is the OrderReplaceMessage command edit a current order.

public override bool IsReplaceCommandEditCurrent { get; }

Property Value

bool

IsResetCounter

Should the sequence counter be reset.

[Display(ResourceType = typeof(LocalizedStrings), Name = "Counter", Description = "ResetCounter", GroupName = "Session", Order = 12)]
public bool IsResetCounter { get; set; }

Property Value

bool

IsSecurityNewsOnly

Adapter provides news related with specified security.

public override bool IsSecurityNewsOnly { get; }

Property Value

bool

IsSupportCandlesPriceLevels

Support candles PriceLevels.

public override bool IsSupportCandlesPriceLevels { get; }

Property Value

bool

IsSupportCandlesUpdates

Support candles subscription and live updates.

public override bool IsSupportCandlesUpdates { get; }

Property Value

bool

IsSupportExecutionsPnL

Adapter fills PnL.

public override bool IsSupportExecutionsPnL { get; }

Property Value

bool

IsSupportOrderBookIncrements

Adapter translates incremental order books.

public override bool IsSupportOrderBookIncrements { get; }

Property Value

bool

IsSupportPartialDownloading

Support partial downloading.

public override bool IsSupportPartialDownloading { get; }

Property Value

bool

IsSupportSubscriptions

Support any subscriptions (ticks, order books etc.).

public override bool IsSupportSubscriptions { get; }

Property Value

bool

IsSupportTransactionLog

Adapter translates orders changes on reply of OrderStatusMessage.

public override bool IsSupportTransactionLog { get; }

Property Value

bool

IterationInterval

Interval between iterations.

public override TimeSpan IterationInterval { get; }

Property Value

TimeSpan

Login

Login.

[Display(ResourceType = typeof(LocalizedStrings), Name = "Login", Description = "LoginDot", GroupName = "Session", Order = 4)]
public string Login { get; set; }

Property Value

string

OrderConditionType

Type of OrderCondition.

public override Type OrderConditionType { get; }

Property Value

Type

Remarks

If the connection does not support the order type Conditional, it will be returned null.

OverrideExecIdByNative

Override exec id by native identifier (if present in FIX message).

[Display(ResourceType = typeof(LocalizedStrings), Name = "ExecId", Description = "OverrideExecIdByNative", GroupName = "Session", Order = 26)]
public bool OverrideExecIdByNative { get; set; }

Property Value

bool

Password

Password.

[Display(ResourceType = typeof(LocalizedStrings), Name = "Password", Description = "PasswordDot", GroupName = "Session", Order = 5)]
public SecureString Password { get; set; }

Property Value

SecureString

PossibleSupportedMessages

Possible supported by adapter message types.

public override IEnumerable<MessageTypeInfo> PossibleSupportedMessages { get; }

Property Value

IEnumerable<MessageTypeInfo>

ReadTimeout

The timeout of reading data. The default value is Zero.

[Display(ResourceType = typeof(LocalizedStrings), Name = "ReadTimeOut", Description = "ReadTimeOutDesc", GroupName = "Session", Order = 19)]
public TimeSpan ReadTimeout { get; set; }

Property Value

TimeSpan

SecurityExtendedFields

Names of extended security fields in SecurityMessage.

public override IEnumerable<Tuple<string, Type>> SecurityExtendedFields { get; }

Property Value

IEnumerable<Tuple<string, Type>>

SenderCompId

Sender ID.

[Display(ResourceType = typeof(LocalizedStrings), Name = "Sender", Description = "SenderCompId", GroupName = "Session", Order = 2)]
public string SenderCompId { get; set; }

Property Value

string

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

StorageName

The storage name, associated with the adapter.

public override string StorageName { get; }

Property Value

string

SupportUnknownExecutions

Support executions processing, generated by third-party software.

[Display(ResourceType = typeof(LocalizedStrings), Name = "UnknownTransactions", Description = "UnknownTransactionsDesc", GroupName = "Session", Order = 23)]
public bool SupportUnknownExecutions { get; set; }

Property Value

bool

SupportedInMessages

Supported by adapter message types.

public override IEnumerable<MessageTypes> SupportedInMessages { get; set; }

Property Value

IEnumerable<MessageTypes>

SupportedMarketDataTypes

Supported by adapter market data types.

public override IEnumerable<DataType> SupportedMarketDataTypes { get; }

Property Value

IEnumerable<DataType>

SupportedOrderBookDepths

Available options for MaxDepth.

public override IEnumerable<int> SupportedOrderBookDepths { get; }

Property Value

IEnumerable<int>

SupportedResultMessages

Supported by adapter result message types.

public override IEnumerable<MessageTypes> SupportedResultMessages { get; }

Property Value

IEnumerable<MessageTypes>

TargetCompId

Target ID.

[Display(ResourceType = typeof(LocalizedStrings), Name = "Target", Description = "TargetCompId", GroupName = "Session", Order = 3)]
public string TargetCompId { get; set; }

Property Value

string

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

TimeFormat

Time format.

[Display(ResourceType = typeof(LocalizedStrings), Name = "TimeFormat", Description = "TimeFormatDot", GroupName = "Session", Order = 18)]
public string TimeFormat { get; set; }

Property Value

string

TimeStampFormat

Timestamp format.

[Display(ResourceType = typeof(LocalizedStrings), Name = "DateTimeFormat", Description = "DateTimeFormatDot", GroupName = "Session", Order = 17)]
public string TimeStampFormat { get; set; }

Property Value

string

UseChannels

Use channels for in and out messages.

public override bool UseChannels { get; }

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

WriteTimeout

The timeout of sending data. The default value is Zero.

[Display(ResourceType = typeof(LocalizedStrings), Name = "WriteTimeOut", Description = "WriteTimeOutDesc", GroupName = "Session", Order = 20)]
public TimeSpan WriteTimeout { get; set; }

Property Value

TimeSpan

YearMonthFormat

Year month format.

[Display(ResourceType = typeof(LocalizedStrings), Name = "YearMonth", Description = "YearMonthFormat", GroupName = "Session", Order = 18)]
public string YearMonthFormat { get; set; }

Property Value

string

Methods

CreateOrderLogMarketDepthBuilder(SecurityId)

Create market depth builder.

public override IOrderLogMarketDepthBuilder CreateOrderLogMarketDepthBuilder(SecurityId securityId)

Parameters

securityId SecurityId

Security ID.

Returns

IOrderLogMarketDepthBuilder

Order log to market depth builder.

GetCandleArgs(Type, SecurityId, DateTimeOffset?, DateTimeOffset?)

Get possible args for the specified candle type and instrument.

public override IEnumerable<object> GetCandleArgs(Type candleType, SecurityId securityId, DateTimeOffset? from, DateTimeOffset? to)

Parameters

candleType Type

The type of the message CandleMessage.

securityId SecurityId

Security ID.

from DateTimeOffset?

The initial date from which you need to get data.

to DateTimeOffset?

The final date by which you need to get data.

Returns

IEnumerable<object>

Possible args.

GetHistoryStepSize(DataType, out TimeSpan)

Get maximum size step allowed for historical download.

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

Parameters

dataType DataType

Data type info.

iterationInterval TimeSpan

Interval between iterations.

Returns

TimeSpan

Step.

GetMaxCount(DataType)

Get maximum possible items count per single subscription request.

public override int? GetMaxCount(DataType dataType)

Parameters

dataType DataType

Data type info.

Returns

int?

Max items count.

IsAllDownloadingSupported(DataType)

Is for the specified dataType all securities downloading enabled.

public override bool IsAllDownloadingSupported(DataType dataType)

Parameters

dataType DataType

Data type info.

Returns

bool

Check result.

IsSecurityRequired(DataType)

Support filtering subscriptions (subscribe/unsubscribe for specified security).

public override bool IsSecurityRequired(DataType dataType)

Parameters

dataType DataType

Data type info.

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