From aba6b773cef2d8c016874c5858971a41fff4f7e0 Mon Sep 17 00:00:00 2001 From: Jkorf Date: Wed, 17 Sep 2025 10:55:48 +0200 Subject: [PATCH] Added ITrackerFactory interface --- .../Interfaces/ITrackerFactory.cs | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 CryptoExchange.Net/Interfaces/ITrackerFactory.cs diff --git a/CryptoExchange.Net/Interfaces/ITrackerFactory.cs b/CryptoExchange.Net/Interfaces/ITrackerFactory.cs new file mode 100644 index 0000000..f18cb4e --- /dev/null +++ b/CryptoExchange.Net/Interfaces/ITrackerFactory.cs @@ -0,0 +1,45 @@ +using CryptoExchange.Net.SharedApis; +using CryptoExchange.Net.Trackers.Klines; +using CryptoExchange.Net.Trackers.Trades; +using System; + +namespace CryptoExchange.Net.Interfaces +{ + /// + /// Tracker factory + /// + public interface ITrackerFactory + { + /// + /// Whether the factory supports creating a KlineTracker instance for this symbol and interval + /// + /// The symbol + /// The kline interval + bool CanCreateKlineTracker(SharedSymbol symbol, SharedKlineInterval interval); + + /// + /// Create a new kline tracker + /// + /// The symbol + /// Kline interval + /// The max amount of klines to retain + /// The max period the data should be retained + /// + IKlineTracker CreateKlineTracker(SharedSymbol symbol, SharedKlineInterval interval, int? limit = null, TimeSpan? period = null); + + /// + /// Whether the factory supports creating a TradeTracker instance for this symbol + /// + /// The symbol + bool CanCreateTradeTracker(SharedSymbol symbol); + + /// + /// Create a new trade tracker for a symbol + /// + /// The symbol + /// The max amount of trades to retain + /// The max period the data should be retained + /// + ITradeTracker CreateTradeTracker(SharedSymbol symbol, int? limit = null, TimeSpan? period = null); + } +}