Exemple #1
0
 /// <summary>
 /// Create a new instance
 /// </summary>
 /// <param name="symbol">The symbol of the order book</param>
 /// <param name="options">The options for the order book</param>
 public BinanceFuturesUsdtSymbolOrderBook(string symbol, BinanceOrderBookOptions?options = null) : base(symbol, options ?? new BinanceOrderBookOptions())
 {
     _limit          = options?.Limit;
     _updateInterval = options?.UpdateInterval;
     _restClient     = options?.RestClient ?? new BinanceClient();
     _socketClient   = options?.SocketClient ?? new BinanceSocketClient();
     _restOwner      = options?.RestClient == null;
     _socketOwner    = options?.SocketClient == null;
 }
 /// <summary>
 /// Create a new instance
 /// </summary>
 /// <param name="symbol">The symbol of the order book</param>
 /// <param name="options">The options for the order book</param>
 public BinanceSpotSymbolOrderBook(string symbol, BinanceOrderBookOptions?options = null) : base(symbol, options ?? new BinanceOrderBookOptions())
 {
     symbol.ValidateBinanceSymbol();
     Levels          = options?.Limit;
     _updateInterval = options?.UpdateInterval;
     _socketClient   = options?.SocketClient ?? new BinanceSocketClient();
     _restClient     = options?.RestClient ?? new BinanceClient();
     _restOwner      = options?.RestClient == null;
     _socketOwner    = options?.SocketClient == null;
 }
Exemple #3
0
 /// <param name="symbol"></param>
 /// <param name="marketStrategy"></param>
 /// <param name="webSocketClient"></param>
 /// <param name="logger"></param>
 /// <param name="binanceRestClient"></param>
 /// <exception cref="ArgumentNullException"><paramref name="symbol"/> cannot be <see langword="null"/></exception>
 /// <exception cref="ArgumentNullException"><paramref name="marketStrategy"/> cannot be <see langword="null"/></exception>
 /// <exception cref="ArgumentNullException"><paramref name="webSocketClient"/> cannot be <see langword="null"/></exception>
 /// <exception cref="ArgumentNullException"><paramref name="binanceRestClient"/> cannot be <see langword="null"/></exception>
 public MarketMakerBot(
     string symbol,
     NaiveMarketMakerStrategy marketStrategy,
     IBinanceClient binanceRestClient,
     IBinanceSocketClient webSocketClient,
     Logger logger) :
     base(symbol, marketStrategy, logger)
 {
     _marketDepth       = new MarketDepth(symbol);
     _binanceRestClient = binanceRestClient ?? throw new ArgumentNullException(nameof(binanceRestClient));
     _webSocketClient   = webSocketClient ?? throw new ArgumentNullException(nameof(webSocketClient));
 }
        public BinanceDataProvider(IBinanceSocketClient socketClient)
        {
            _socketClient = socketClient;

            Start().Wait(); // Probably want to do this in some initialization step at application startup
        }
 public BinanceDataProvider(IBinanceSocketClient socketClient, IBinanceClient binanceClient)
 {
     _socketClient  = socketClient;
     _binanceClient = binanceClient;
     Start().Wait();
 }
 public BinanceDataProvider(IBinanceClient client, IBinanceSocketClient socketClient)
 {
     _client       = client;
     _socketClient = socketClient;
 }
        public BinanceDataProvider(IBinanceSocketClient socketClient, string pricepairname = "NEBLBTC", KlineInterval kli = KlineInterval.OneMinute)
        {
            _socketClient = socketClient;

            Start(pricepairname, kli).Wait(); // Probably want to do this in some initialization step at application startup
        }
 /// <summary>
 /// Create instance of <see cref="MarketDepthManager"/>
 /// </summary>
 /// <param name="binanceRestClient">Binance REST client</param>
 /// <param name="webSocketClient">Binance WebSocket client</param>
 /// <exception cref="ArgumentNullException"><paramref name="binanceRestClient"/> cannot be <see langword="null"/></exception>
 /// <exception cref="ArgumentNullException"><paramref name="webSocketClient"/> cannot be <see langword="null"/></exception>
 public MarketDepthManager(IBinanceClient binanceRestClient, IBinanceSocketClient webSocketClient)
 {
     _restClient      = binanceRestClient ?? throw new ArgumentNullException(nameof(binanceRestClient));
     _webSocketClient = webSocketClient ?? throw new ArgumentNullException(nameof(webSocketClient));
 }