Table of Contents

Class OkexMessageAdapter

Namespace
StockSharp.Okex
Assembly
StockSharp.Okex.dll

The message adapter for StockSharp.Okex.

[MediaIcon("Okex_logo.svg")]
[Display(ResourceType = typeof(LocalizedStrings), Name = "Okex", Description = "CryptoConnector", GroupName = "Cryptocurrency")]
[MessageAdapterCategory(MessageAdapterCategories.Crypto|MessageAdapterCategories.RealTime|MessageAdapterCategories.Free|MessageAdapterCategories.Ticks|MessageAdapterCategories.MarketDepth|MessageAdapterCategories.Level1|MessageAdapterCategories.Transactions)]
[OrderCondition(typeof(OkexOrderCondition))]
public class OkexMessageAdapter : AsyncMessageAdapter, IMessageAdapter, IMessageChannel, ICloneable<IMessageChannel>, ICloneable, IPersistable, ILogReceiver, ILogSource, IDisposable, INotifyPropertyChanged, IDemoAdapter, IKeySecretAdapter, IPassphraseAdapter
Inheritance
OkexMessageAdapter
Implements
ICloneable<IMessageChannel>
IPersistable
Inherited Members
Extension Methods

Constructors

OkexMessageAdapter(IdGenerator)

Initializes a new instance of the OkexMessageAdapter.

public OkexMessageAdapter(IdGenerator transactionIdGenerator)

Parameters

transactionIdGenerator IdGenerator

Transaction id generator.

Fields

DefaultRecentOrdersRequestLimit

Default number of requested recent orders for each instrument type.

public const int DefaultRecentOrdersRequestLimit = 1000

Field Value

int

DefaultRecentTradesRequestLimit

Default number of requested recent orders for each instrument type.

public const int DefaultRecentTradesRequestLimit = 1000

Field Value

int

Properties

AdminPassword

Administrative password.

[Display(ResourceType = typeof(LocalizedStrings), Name = "Password", Description = "AdminPassword", GroupName = "Withdraw", Order = 0)]
public SecureString AdminPassword { get; set; }

Property Value

SecureString

AllTimeFrames

Possible time-frames.

public static IEnumerable<TimeSpan> AllTimeFrames { get; }

Property Value

IEnumerable<TimeSpan>

AssociatedBoards

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

public override string[] AssociatedBoards { get; }

Property Value

string[]

IsDemo

Is demo.

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

Property Value

bool

IsSupportOrderBookIncrements

Adapter translates incremental order books.

public override bool IsSupportOrderBookIncrements { get; }

Property Value

bool

Key

Key.

[Display(ResourceType = typeof(LocalizedStrings), Name = "Key", Description = "KeyDot", GroupName = "Connection", Order = 0)]
public SecureString Key { get; set; }

Property Value

SecureString

Passphrase

Passphrase.

[Display(ResourceType = typeof(LocalizedStrings), Name = "Passphrase", Description = "PassphraseDot", GroupName = "Connection", Order = 2)]
public SecureString Passphrase { get; set; }

Property Value

SecureString

RecentOrdersRequestLimit

Number of requested recent orders for each instrument type.

[Display(ResourceType = typeof(LocalizedStrings), Name = "RecentOrdersRequestLimit", Description = "RecentOrdersRequestLimit", GroupName = "Connection", Order = 5)]
public int RecentOrdersRequestLimit { get; set; }

Property Value

int

RecentTradesRequestLimit

Number of requested recent trades.

[Display(ResourceType = typeof(LocalizedStrings), Name = "RecentTradesRequestLimit", Description = "RecentTradesRequestLimit", GroupName = "Connection", Order = 6)]
public int RecentTradesRequestLimit { get; set; }

Property Value

int

RestAddress

REST address.

public string RestAddress { get; set; }

Property Value

string

Secret

Secret.

[Display(ResourceType = typeof(LocalizedStrings), Name = "Secret", Description = "SecretDesc", GroupName = "Connection", Order = 1)]
public SecureString Secret { get; set; }

Property Value

SecureString

SupportedOrderBookDepths

Available options for MaxDepth.

public override IEnumerable<int> SupportedOrderBookDepths { get; }

Property Value

IEnumerable<int>

TimeFrames

Get possible time-frames for the specified instrument.

protected override IEnumerable<TimeSpan> TimeFrames { get; }

Property Value

IEnumerable<TimeSpan>

WebSocketAddressBusiness

WebSocket address (business).

public string WebSocketAddressBusiness { get; set; }

Property Value

string

WebSocketAddressPrivate

WebSocket address (private).

public string WebSocketAddressPrivate { get; set; }

Property Value

string

WebSocketAddressPublic

WebSocket address (public).

public string WebSocketAddressPublic { get; set; }

Property Value

string

Methods

CancelOrderAsync(OrderCancelMessage, CancellationToken)

public override ValueTask CancelOrderAsync(OrderCancelMessage cancelMsg, CancellationToken token)

Parameters

cancelMsg OrderCancelMessage

OrderCancelMessage.

token CancellationToken

Returns

ValueTask

ValueTask.

ConnectAsync(ConnectMessage, CancellationToken)

Process ConnectMessage.

public override ValueTask ConnectAsync(ConnectMessage msg, CancellationToken cancellationToken)

Parameters

msg ConnectMessage
cancellationToken CancellationToken

CancellationToken.

Returns

ValueTask

ValueTask.

DisconnectAsync(DisconnectMessage, CancellationToken)

public override ValueTask DisconnectAsync(DisconnectMessage msg, CancellationToken cancellationToken)

Parameters

msg DisconnectMessage
cancellationToken CancellationToken

CancellationToken.

Returns

ValueTask

ValueTask.

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.

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.

OnLevel1SubscriptionAsync(MarketDataMessage, CancellationToken)

protected override ValueTask OnLevel1SubscriptionAsync(MarketDataMessage mdMsg, CancellationToken cancellationToken)

Parameters

mdMsg MarketDataMessage
cancellationToken CancellationToken

Returns

ValueTask

OnMarketDepthSubscriptionAsync(MarketDataMessage, CancellationToken)

protected override ValueTask OnMarketDepthSubscriptionAsync(MarketDataMessage mdMsg, CancellationToken cancellationToken)

Parameters

mdMsg MarketDataMessage
cancellationToken CancellationToken

Returns

ValueTask

OnTFCandlesSubscriptionAsync(MarketDataMessage, CancellationToken)

protected override ValueTask OnTFCandlesSubscriptionAsync(MarketDataMessage mdMsg, CancellationToken cancellationToken)

Parameters

mdMsg MarketDataMessage
cancellationToken CancellationToken

Returns

ValueTask

OnTicksSubscriptionAsync(MarketDataMessage, CancellationToken)

protected override ValueTask OnTicksSubscriptionAsync(MarketDataMessage mdMsg, CancellationToken cancellationToken)

Parameters

mdMsg MarketDataMessage
cancellationToken CancellationToken

Returns

ValueTask

OrderStatusAsync(OrderStatusMessage, CancellationToken)

public override ValueTask OrderStatusAsync(OrderStatusMessage message, CancellationToken token)

Parameters

message OrderStatusMessage
token CancellationToken

Returns

ValueTask

ValueTask.

PortfolioLookupAsync(PortfolioLookupMessage, CancellationToken)

public override ValueTask PortfolioLookupAsync(PortfolioLookupMessage message, CancellationToken token)

Parameters

message PortfolioLookupMessage
token CancellationToken

Returns

ValueTask

ValueTask.

RegisterOrderAsync(OrderRegisterMessage, CancellationToken)

public override ValueTask RegisterOrderAsync(OrderRegisterMessage regMsg, CancellationToken token)

Parameters

regMsg OrderRegisterMessage

OrderRegisterMessage.

token CancellationToken

Returns

ValueTask

ValueTask.

ResetAsync(ResetMessage, CancellationToken)

Process ResetMessage.

public override ValueTask ResetAsync(ResetMessage msg, CancellationToken cancellationToken)

Parameters

msg ResetMessage
cancellationToken CancellationToken

CancellationToken.

Returns

ValueTask

ValueTask.

Remarks

Must NOT throw.

Save(SettingsStorage)

Save settings.

public override void Save(SettingsStorage storage)

Parameters

storage SettingsStorage

Settings storage.

SecurityLookupAsync(SecurityLookupMessage, CancellationToken)

public override ValueTask SecurityLookupAsync(SecurityLookupMessage lookupMsg, CancellationToken token)

Parameters

lookupMsg SecurityLookupMessage

SecurityLookupMessage.

token CancellationToken

Returns

ValueTask

ValueTask.

TimeAsync(TimeMessage, CancellationToken)

Process TimeMessage.

public override ValueTask TimeAsync(TimeMessage timeMsg, CancellationToken cancellationToken)

Parameters

timeMsg TimeMessage

TimeMessage.

cancellationToken CancellationToken

CancellationToken.

Returns

ValueTask

ValueTask.

ToString()

public override string ToString()

Returns

string