Files
QuanTAlib/lib/feeds/IFeed.cs
T
Miha Kralj 86fe32a682 SIMD Refactor: Merge simd-dev into dev (#55)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat>
Co-authored-by: Warp <agent@warp.dev>
2026-01-18 19:02:03 -08:00

36 lines
1.4 KiB
C#

namespace QuanTAlib;
/// <summary>
/// Interface for data feeds that provide TBar (OHLCV) data.
/// Implementations include synthetic generators (GBM), API-based feeds (AlphaVantage),
/// file readers (CSV), and real-time streams (WebSocket).
/// </summary>
public interface IFeed
{
/// <summary>
/// Gets the next bar from the feed with full bidirectional control.
/// </summary>
/// <param name="isNew">
/// Input: Request for new bar (true) or update current bar (false).
/// Output: Actual behavior - may differ if feed cannot honor request (e.g., end of data).
/// </param>
/// <returns>The bar (new or updated)</returns>
TBar Next(ref bool isNew);
/// <summary>
/// Gets the next bar from the feed with simple control.
/// </summary>
/// <param name="isNew">Request for new bar (true) or update current bar (false). Defaults to true.</param>
/// <returns>The bar (new or updated)</returns>
TBar Next(bool isNew = true);
/// <summary>
/// Gets multiple bars in batch with explicit time parameters.
/// </summary>
/// <param name="count">Number of bars to retrieve</param>
/// <param name="startTime">Starting timestamp for first bar (in ticks)</param>
/// <param name="interval">Time interval between bars</param>
/// <returns>Series containing the requested bars</returns>
TBarSeries Fetch(int count, long startTime, TimeSpan interval);
}