Table of Contents

Interface ITradingStatisticsProvider

Namespace
ATAS.DataFeedsCore.Statistics
Assembly
ATAS.DataFeedsCore.dll

Source of the trading statistics shown by the Statistics module: the round trips, trades, orders and metrics of the user's accounts, filtered by period, accounts, securities and playbooks.

public interface ITradingStatisticsProvider
Extension Methods

Fields

NoPlaybookId

Special ID to filter trades without any playbook assigned. Include this ID in the Playbooks filter to show trades with no playbooks.

Added in ATAS 8.0.15.

public const long NoPlaybookId = -1

Field Value

long

Properties

Accounts

Account ids to include; null includes all accounts. Changing it reloads FilteredStatistics.

Added in ATAS 8.0.15.

IReadOnlySet<string>? Accounts { get; set; }

Property Value

IReadOnlySet<string>

FilteredStatistics

Statistics restricted by the filters (From, To, Accounts, Securities, Playbooks), with calculated metrics and equity. The instance is replaced when a replay connection starts or ends; see FilteredStatisticsSourceChanged.

Added in ATAS 8.0.15.

ITradingStatistics FilteredStatistics { get; }

Property Value

ITradingStatistics

From

Start of the filter period. Changing it reloads FilteredStatistics.

Added in ATAS 8.0.15.

DateTime From { get; set; }

Property Value

DateTime

Playbooks

Playbook ids to include: a round trip is included when it has any of them, and a round trip without playbooks only when the set contains NoPlaybookId. null disables the filter; an empty set excludes every round trip. Changing it reloads FilteredStatistics.

Added in ATAS 8.0.15.

IReadOnlySet<long>? Playbooks { get; set; }

Property Value

IReadOnlySet<long>

RawStatistics

Statistics of the stored data not restricted by the filters. It is a view of the stored orders, trades, round trips and notes and may not calculate metrics (Statistics and Equity can stay empty). The instance is replaced when a replay connection starts or ends; see RawStatisticsSourceChanged.

Added in ATAS 8.0.15.

ITradingStatistics RawStatistics { get; }

Property Value

ITradingStatistics

Realtime

Statistics of the real (non-replay) data.

[Obsolete("Use FilteredStatistics instead")]
ITradingStatistics Realtime { get; }

Property Value

ITradingStatistics

Replay

Statistics of the replay data.

[Obsolete("Use FilteredStatistics instead")]
ITradingStatistics Replay { get; }

Property Value

ITradingStatistics

Securities

Security ids to include; null includes all securities. Changing it reloads FilteredStatistics.

Added in ATAS 8.0.15.

IReadOnlySet<string>? Securities { get; set; }

Property Value

IReadOnlySet<string>

To

End of the filter period. Changing it reloads FilteredStatistics.

Added in ATAS 8.0.15.

DateTime To { get; set; }

Property Value

DateTime

Methods

LoadHistoryAsync(DateTime, DateTime, ICollection<string>?, ICollection<string>?)

Loads the stored round trips and own trades of a period that do not come from replay, and the orders of the period, into a new statistics object.

[Obsolete]
Task<ITradingStatistics> LoadHistoryAsync(DateTime from, DateTime to, ICollection<string>? accounts = null, ICollection<string>? securities = null)

Parameters

from DateTime

Start of the period.

to DateTime

End of the period.

accounts ICollection<string>

Account ids to include, null for all.

securities ICollection<string>

Security ids to include, null for all.

Returns

Task<ITradingStatistics>

The loaded statistics.

Events

FilteredStatisticsSourceChanged

Raised with the new instance when FilteredStatistics is replaced.

Added in ATAS 8.0.15.

event Action<ITradingStatistics>? FilteredStatisticsSourceChanged

Event Type

Action<ITradingStatistics>

RawStatisticsSourceChanged

Raised with the new instance when RawStatistics is replaced.

Added in ATAS 8.0.15.

event Action<ITradingStatistics>? RawStatisticsSourceChanged

Event Type

Action<ITradingStatistics>

StatisticsRebuilt

Raised after the statistics were rebuilt from the trade history or the statistics database was cleared.

Added in ATAS 8.0.15.

event Action? StatisticsRebuilt

Event Type

Action