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); + } +}