MarketDataProvider<T>
Models & Types · AiDotNet.Finance.Data
Stores and serves market data for finance workflows.
For Beginners
This is like a small database of price bars. You can add data points, slice out date ranges, or convert the series into tensors for model training.
How It Works
MarketDataProvider is a lightweight in-memory store for OHLCV data. It is intentionally simple so it can be used by loaders, preprocessors, and trading environments without extra dependencies.
Constructors
| Constructor | Summary |
|---|---|
MarketDataProvider() |
Properties
| Property | Summary |
|---|---|
int Count { get; } |
Gets the number of data points stored. |
Methods
| Method | Summary |
|---|---|
IReadOnlyList<MarketDataPoint<T>> GetAll() |
Returns all stored points as a read-only list. |
IReadOnlyList<MarketDataPoint<T>> GetRange(DateTime start, DateTime end) |
Returns points within a specific time range. |
IReadOnlyList<MarketDataPoint<T>> GetWindow(int startIndex, int length) |
Returns a fixed-size window of points by index. |
Tensor<T> ToTensor(bool includeVolume) |
Converts the stored OHLCV data into a tensor. |
void Add(MarketDataPoint<T> point) |
Adds a single market data point. |
void AddRange(IEnumerable<MarketDataPoint<T>> points) |
Adds multiple market data points at once. |
void Clear() |
Clears all stored market data points. |