public BitfinexWebSocketSubscriber(BitfinexExchangeConfiguration configuration, bool authenticate, ILog log, TimeSpan?heartbeatPeriod = null) : base(new WebSocketTextMessenger(configuration.WebSocketEndpointUrl, log), log, heartbeatPeriod) { _configuration = configuration; _authenticate = authenticate; _log = log; _pingTimer = new Timer(SendPing); }
public BitfinexWebSocketSubscriberTest() { _log = new LogToConsole(); _bitfinexExchangeConfiguration = new BitfinexExchangeConfiguration { ApiKey = ApiKey, ApiSecret = ApiSecret, WebSocketEndpointUrl = WsApiUrl }; }
public BitfinexOrderBookTests() { _log = new LogToConsole(); var settingsManager = BitfinexHelpers.GetBitfinexSettingsMenager(); _bitfinexConfiguration = settingsManager.CurrentValue; _orderBookHandler = new Mock <IHandler <OrderBook> >().Object; _tickPriceHandler = new Mock <IHandler <TickPrice> >().Object; }
public BitfinexOrderBooksHarvester(BitfinexExchangeConfiguration configuration, OrderBookSnapshotsRepository orderBookSnapshotsRepository, OrderBookEventsRepository orderBookEventsRepository, IHandler <OrderBook> orderBookHandler, IHandler <TickPrice> tickPriceHandler, ILog log) : base(BitfinexExchange.Name, configuration, new WebSocketTextMessenger(configuration.WebSocketEndpointUrl, log), log, orderBookSnapshotsRepository, orderBookEventsRepository, orderBookHandler) { _configuration = configuration; _channels = new Dictionary <long, Channel>(); _tickPriceHandler = tickPriceHandler; }
public BitfinexOrderBooksHarvester(BitfinexExchangeConfiguration configuration, IHandler <OrderBook> orderBookHandler, IHandler <TickPrice> tickPriceHandler, ILog log) : base(BitfinexExchange.Name, configuration, new WebSocketTextMessenger(configuration.WebSocketEndpointUrl, log), log, orderBookHandler) { _configuration = configuration; _channels = new Dictionary <long, Channel>(); _tickPriceHandler = tickPriceHandler; var credenitals = new BitfinexServiceClientCredentials(configuration.ApiKey, configuration.ApiSecret); _exchangeApi = new BitfinexApi(credenitals) { BaseUri = new Uri(configuration.EndpointUrl) }; }
public BitfinexExchange(BitfinexExchangeConfiguration configuration, TranslatedSignalsRepository translatedSignalsRepository, BitfinexOrderBooksHarvester orderBooksHarvester, BitfinexExecutionHarvester executionHarvester, ILog log) : base(Name, configuration, translatedSignalsRepository, log) { _modelConverter = new BitfinexModelConverter(configuration); _orderBooksHarvester = orderBooksHarvester; _executionHarvester = executionHarvester; var credenitals = new BitfinexServiceClientCredentials(configuration.ApiKey, configuration.ApiSecret); _exchangeApi = new BitfinexApi(credenitals) { BaseUri = new Uri(configuration.EndpointUrl) }; orderBooksHarvester.MaxOrderBookRate = configuration.MaxOrderBookRate; }
public BitfinexExecutionHarvesterTest() { ILog log = new LogToConsole(); var bitfinexExchangeConfiguration = new BitfinexExchangeConfiguration { ApiKey = ApiKey, ApiSecret = ApiSecret, WebSocketEndpointUrl = WsApiUrl, SupportedCurrencySymbols = new[] { new CurrencySymbol { ExchangeSymbol = "LTCUSD", LykkeSymbol = "LTCUSD" } } }; var subscriber = new BitfinexWebSocketSubscriber(bitfinexExchangeConfiguration, true, log); _harvester = new BitfinexExecutionHarvester(subscriber, new BitfinexModelConverter(bitfinexExchangeConfiguration), _testHandler, log); }
public BitfinexOrderBookTests() { _log = new LogToConsole(); var settingsManager = BitfinexHelpers.GetBitfinexSettingsMenager(); _bitfinexConfiguration = settingsManager.CurrentValue; var orderBookEventsStorage = AzureTableStorage <OrderBookEventEntity> .Create( settingsManager.ConnectionString(i => _tableStorageEndpoint), _orderBookEventsTable, _log); var orderBookSnapshotStorage = AzureTableStorage <OrderBookSnapshotEntity> .Create( settingsManager.ConnectionString(i => _tableStorageEndpoint), _snapshotsTable, _log); var azureBlobStorage = AzureBlobStorage.Create( settingsManager.ConnectionString(i => _blobStorageEndpoint)); _snapshotsRepository = new OrderBookSnapshotsRepository(orderBookSnapshotStorage, azureBlobStorage, _log); _eventsRepository = new OrderBookEventsRepository(orderBookEventsStorage, _log); _orderBookHandler = new Mock <IHandler <OrderBook> >().Object; _tickPriceHandler = new Mock <IHandler <TickPrice> >().Object; }
public BitfinexModelConverter(BitfinexExchangeConfiguration configuration) : base(configuration.SupportedCurrencySymbols, BitfinexExchange.Name, configuration.UseSupportedCurrencySymbolsAsFilter) { }