Providers

Reference

Providers

The market-data surface: the provider and its factory, the capability feeds it exposes (backfill, live ticks, depth, summary, fundamentals, open interest), the historical storage seam, and the activity/progress records that report backfill state.

Providers — TradeStrike.Pipeline.Providers

A data provider is one connected venue. Your IDataProviderFactory declares the credentials it needs and builds an IDataProvider; the provider advertises a ProviderCapabilities flag set and exposes the optional feeds it supports as nullable properties.

Type Members
IDataProvider : IDisposable Key, DisplayName, Capabilities, Status; nullable feeds Backfill, LiveTicks, Instruments, Depth, Mbo, OpenInterest, MarketSummary, Fundamentals; bool SupportsBarSpec(BarSpecification); event Action<ProviderConnectionStatus>? ConnectionStatusChanged; Task ConnectAsync(ct), Task DisconnectAsync().
IDataProviderFactory Key, DisplayName, IReadOnlyList<ProviderCredentialField> RequiredCredentials, IDataProvider Create(IReadOnlyDictionary<string,string> credentials).
ProviderCredentialField record (string Key, string DisplayName, ProviderCredentialKind Kind, string? Placeholder = null, bool Required = true).
ProviderCredentialKind enum: Plain, Secret, Choice, Toggle, Url.
ProviderCapabilities [Flags] enum: None, Backfill, LiveTicks, InstrumentMetadata, OrderRouting, OrderbookDepth.
BarSpecKind [Flags] enum: None, Time, Tick, Volume, Range, Renko, HeikinAshi.
ProviderConnectionStatus enum: Disconnected, Connecting, Connected, ConnectionLost.
IDataProviderDecorator IDataProvider Inner { get; } — marker for wrapping providers.
DataProviderCapabilities static: T? AsCapability<T>(this IDataProvider?) — unwraps decorators to a capability.
IActiveDataProviderRegistry IDataProvider? GetActive(string venueKey), IReadOnlyDictionary<string,IDataProvider> ActiveProviders.
IContinuousBarsCapableProvider IHistoricalTimeBarSource HistoricalTimeBarSource { get; }.
IContinuousTicksCapableProvider IRawTickRangeProvider RawTickRange { get; }.
IInstrumentDirectory IReadOnlyList<string> ListInstruments().
IProviderClock DateTime NowUtc { get; }.

Capability feeds

Each optional feed follows the same subscribe-and-dispose shape: Subscribe(instrumentId, onUpdate) returns an IDisposable, and a SubscriptionReset event signals that you must re-subscribe (e.g. after a reconnect).

Type Members
IMarketSummaryFeed : IDisposable IDisposable Subscribe(string instrumentId, Action<MarketSummaryUpdate> onUpdate); event Action? SubscriptionReset.
MarketSummaryUpdate record (string InstrumentId, DateTime ExchangeTimestampUtc, double? SettlementPrice, double? PreviousClose, double? OpeningPrice, double? DailyHigh, double? DailyLow, long? DailyVolume).
IFundamentalsFeed : IDisposable IDisposable Subscribe(string instrumentId, Action<FundamentalUpdate> onUpdate); event Action? SubscriptionReset.
FundamentalUpdate record (string InstrumentId, FundamentalDataType Type, DateTime ExchangeTimestampUtc, double? Value = null, DateTime? DateValue = null).
FundamentalDataType enum: Beta, CurrentRatio, DividendAmount, DividendPayDate, DividendYield, EarningsPerShare, FiveYearsGrowthPercentage, MarketCapitalization, NextYearEarningsPerShare, PercentHeldByInstitutions, PriceEarningsRatio, RevenuePerShare, SharesOutstanding, ShortInterest, ShortInterestRatio, AverageDailyVolume, CalendarYearHigh, CalendarYearHighDate, CalendarYearLow, CalendarYearLowDate, High52Weeks, High52WeeksDate, Low52Weeks, Low52WeeksDate, HistoricalVolatility.
IOpenInterestFeed : IDisposable IDisposable Subscribe(string instrumentId, Action<OpenInterestUpdate> onUpdate); event Action? SubscriptionReset.
OpenInterestUpdate record (string InstrumentId, double OpenInterest, DateTime ExchangeTimestampUtc).
Depth feeds. IMarketDepthFeed (level-2) and IMarketByOrderFeed (MBO / level-3) are documented under the Orderflow & depth reference; IDataProvider exposes them as the Depth and Mbo properties.

Backfill & ticks — TradeStrike.Pipeline.Runtime

Implement IBackfillProvider.Load for history. The aware variants are optional refinements the host probes for — implement only what your venue supports. ITickSource delivers live ticks.

Type Members
IBackfillProvider Task<IReadOnlyList<Bar>> Load(BarSpecification spec, CancellationToken ct = default).
ILookbackAwareBackfillProvider adds Load(spec, TimeSpan lookback, ct).
IRangeAwareBackfillProvider adds Load(spec, DateTime fromUtc, DateTime toUtcExclusive, ct).
IProgressReportingBackfillProvider adds LoadWithProgress(spec, IProgress<BackfillProgress>, ct).
IProgressReportingRangeBackfillProvider adds LoadWithProgress(spec, fromUtc, toUtcExclusive, IProgress<BackfillProgress>, ct).
IOrderFlowAwareBackfillProvider adds Task<BackfillResultWithOrderFlow> LoadWithOrderFlow(spec, OrderFlowBackfillRequest, ct).
ITickSource : IDisposable IDisposable Subscribe(string instrumentId, Action<Tick> onTick).
BackfillProgress record (int BarsReceived, DateTime? LatestBarTimeUtc, double PercentComplete, string StageMessage).
BackfillResultWithOrderFlow Bars, OrderFlow, FirstBarStartUtc, LastBarEndUtc, Count; static Empty.
BackfillDateRange struct (DateTime fromUtc, DateTime toUtcExclusive): FromUtc, ToUtcExclusive, Duration.
IVolumeConsistencyObserver void OnMismatch(in VolumeMismatchEvent); NullVolumeConsistencyObserver.Instance.
VolumeMismatchEvent record (string InstrumentId, DateTime BarStartUtc, long ReportedVolume, long ObservedTradeVolume, long Mismatch).

Storage seam — TradeStrike.Pipeline.Storage

The local tick/bar cache. Stores are keyed by (providerKey, instrumentId[, period]); reads return the data found and the DateRanges still missing so the host can fetch the gaps.

Type Members
ITickStore TickStoreReadResult Read(key, fromUtc, toUtcExclusive), Write(key, fromUtc, toUtcExclusive, ticks), EnumerateKeys(), TickStoreKeyInfo? Describe(key), Clear(key), ClearAll().
IPartialDayTickStore : ITickStore adds WritePartialDay(TickStoreKey key, DateTime dayUtc, IReadOnlyList<Tick> ticks).
ITimeBarStore TimeBarStoreReadResult Read(key, fromUtc, toUtcExclusive), Write(...), EnumerateKeys(), TimeBarStoreKeyInfo? Describe(key), Clear(key), ClearAll().
IPartialDayTimeBarStore : ITimeBarStore adds WritePartialDay(TimeBarStoreKey key, DateTime dayUtc, IReadOnlyList<Bar> closedBars).
IHistoricalTimeBarSource Task<IReadOnlyList<Bar>> LoadTimeBars(string instrumentId, TimeSpan period, DateTime fromUtc, DateTime toUtcExclusive, ct); progress variant IProgressReportingTimeBarSource.
INativeBarSource bool SupportsNativeBars(spec), Task<IReadOnlyList<Bar>> LoadNativeBars(spec, fromUtc, toUtcExclusive, ct); progress variant INativeBarProgressSource.
TickStoreKey record (string providerKey, string instrumentId).
TimeBarStoreKey record (string providerKey, string instrumentId, TimeSpan period, string? adjustmentVersion = null).
TickStoreReadResult record (IReadOnlyList<Tick> Ticks, IReadOnlyList<DateRange> MissingRanges).
TimeBarStoreReadResult record (IReadOnlyList<Bar> Bars, IReadOnlyList<DateRange> MissingRanges).
TickStoreKeyInfo record (TickStoreKey Key, int TickCount, DateTime? FirstTickUtc, DateTime? LastTickUtc, IReadOnlyList<DateRange> CoveredRanges, long ApproxByteSize).
TimeBarStoreKeyInfo record (TimeBarStoreKey Key, int BarCount, DateTime? FirstBarStartUtc, DateTime? LastBarStartUtc, IReadOnlyList<DateRange> CoveredRanges, long ApproxByteSize).
DateRange record (DateTime FromUtc, DateTime ToUtcExclusive): IsEmpty, Length, Contains(utc), Overlaps(other), TouchesOrOverlaps(other).
ISequenceGapObserver void OnGap(in SequenceGapEvent); NullSequenceGapObserver.Instance.
SequenceGapEvent record (string InstrumentId, long LastSeenSequence, long NextSequence, long GapSize, int AtTickIndex, DateTime AtTimestamp).
BackfillSourceUnavailableException Exception thrown when a backfill source cannot serve a request.

Backfill activity

The host surfaces a live progress UI by reading the activity registry; providers/sources report via a handle obtained from the tracker.

Type Members
IBackfillActivityTracker IBackfillActivityHandle Begin(BackfillActivityDescriptor descriptor).
IBackfillActivityHandle : IDisposable Guid Id { get; }, void Update(BackfillActivityStatus status, double percentComplete, int itemsLoaded, string stageMessage).
IBackfillActivityRegistry IReadOnlyList<BackfillActivitySnapshot> Snapshot(), event Action<BackfillActivityChange>? Changed.
BackfillActivityDescriptor record (string instrumentId, BackfillKind kind, TimeSpan? barPeriod, DateTime fromUtc, DateTime toUtcExclusive, string providerKey, string? providerDisplayName = null).
BackfillActivitySnapshot record (Guid Id, BackfillActivityDescriptor Descriptor, BackfillActivityStatus Status, double PercentComplete, int ItemsLoaded, string StageMessage, DateTime StartedUtc, DateTime LastUpdatedUtc).
BackfillActivityChange record (BackfillActivityChangeKind Kind, BackfillActivitySnapshot Snapshot).
BackfillActivityChangeKind enum: Started, Updated, Ended.
BackfillKind enum: Bars, Ticks, NativeBars.
BackfillActivityStatus enum: Queued, Fetching, Done, Failed.

Historical data service — TradeStrike.Pipeline.Services

The host-side facade your plugins call to load history by venue without touching the store/provider seams directly.

Type Members
IHistoricalDataService Task<LoadResult> LoadAsync(string venueKey, BarSpecification spec, DateTime fromUtc, DateTime toUtcExclusive, IProgress<LoadProgress>? progress = null, ct); Task<IReadOnlyList<Tick>> LoadTicksAsync(string venueKey, string instrumentId, DateTime fromUtc, DateTime toUtcExclusive, IProgress<LoadProgress>? progress = null, ct).
LoadProgress record (int BarsReceived, DateTime LatestTimestampUtc, double PercentComplete).
LoadResult record (IReadOnlyList<Bar> Bars, LoadSummary Summary).
LoadSummary record (string VenueKey, string InstrumentId, BarSpecification Spec, DateTime FromUtc, DateTime ToUtcExclusive, int BarCount, DateTime? FirstBarTimeUtc, DateTime? LastBarTimeUtc).