Table of Contents

Interface IMarketDataSubscription

Namespace
ATAS.Indicators
Assembly
ATAS.Indicators.dll

A live market-data subscription for one instrument. Dispose to release.

Threading: every event fires on the SOURCE instrument's data-processing thread - for another instrument this is a different thread than the chart's own callbacks. Handlers must be fast (a slow handler stalls that instrument's data pipeline); use DoActionInGuiThread(Action) for UI work.

Added in ATAS 8.0.15.

public interface IMarketDataSubscription
Extension Methods

Properties

BestAsk

The latest best ask, when known.

MarketDataArg? BestAsk { get; }

Property Value

MarketDataArg

BestBid

The latest best bid, when known.

MarketDataArg? BestBid { get; }

Property Value

MarketDataArg

Instrument

The resolved instrument name.

string Instrument { get; }

Property Value

string

IsLoaded

True when the feed is established.

bool IsLoaded { get; }

Property Value

bool

Loaded

Completes when the feed subscription is established and the current best bid/ask (when the feed already knows them) are cached in BestBid/BestAsk; faults with the error otherwise. Event handlers receive the cached best prices via the BestBidAskChanged replay-on-attach, not through this task. A failed feed subscription is retried when a new subscription for the instrument is created; this property then returns the new attempt's task.

Task Loaded { get; }

Property Value

Task

Request

The request this subscription was created from.

MarketDataSubscriptionRequest Request { get; }

Property Value

MarketDataSubscriptionRequest

Methods

GetMarketDepthSnapshot()

The current order book snapshot (bids and asks). Returns an empty sequence when the subscription was created without MarketDepth.

IEnumerable<MarketDataArg> GetMarketDepthSnapshot()

Returns

IEnumerable<MarketDataArg>

Events

BestBidAskChanged

Best bid or ask change. Requires BestBidAsk. A newly attached handler is invoked immediately with the cached best bid and ask (when known) - on the attaching thread - so it does not wait for the next live quote.

event Action<MarketDataArg>? BestBidAskChanged

Event Type

Action<MarketDataArg>

MarketDepthsChanged

Market depth changes (batched; Volume == 0 means the level was removed). Requires MarketDepth.

event Action<IEnumerable<MarketDataArg>>? MarketDepthsChanged

Event Type

Action<IEnumerable<MarketDataArg>>

NewTrades

New trades of the instrument (batched). Requires Trades.

event Action<IEnumerable<MarketDataArg>>? NewTrades

Event Type

Action<IEnumerable<MarketDataArg>>