public IsinAdderService( IIsinsRepository isinsRepository, IMarketDataRepository marketDataCsvFileRepository) { _isinsCsvFileRepository = isinsRepository; _marketDataCsvFileRepository = marketDataCsvFileRepository; }
public SwapManager( IAccount account, ISwapClient swapClient, ICurrencyQuotesProvider quotesProvider, IMarketDataRepository marketDataRepository) { _account = account ?? throw new ArgumentNullException(nameof(account)); _swapClient = swapClient ?? throw new ArgumentNullException(nameof(swapClient)); _quotesProvider = quotesProvider; _marketDataRepository = marketDataRepository ?? throw new ArgumentNullException(nameof(marketDataRepository)); var currencySwaps = _account.Currencies .Select(c => { var currencySwap = CurrencySwapCreator.Create( currency: c, account: _account); currencySwap.InitiatorPaymentConfirmed += InitiatorPaymentConfirmed; currencySwap.AcceptorPaymentConfirmed += AcceptorPaymentConfirmed; currencySwap.AcceptorPaymentSpent += AcceptorPaymentSpent; currencySwap.SwapUpdated += SwapUpdatedHandler; return(currencySwap); }); _currencySwaps = currencySwaps.ToDictionary(cs => cs.Currency); }
public MarketController(IMarketDataRepository marketDataRepository, IAssetsRepository assetsRepository, IAssetPairBestPriceRepository marketProfileRepo) { _marketDataRepository = marketDataRepository; _assetsRepository = assetsRepository; _marketProfileRepo = marketProfileRepo; }
public RegistryService( IMarketDataRepository marketDataRepository, IRegistryRepository registryRepository) { _marketDataRepository = marketDataRepository; _registryRepository = registryRepository; }
public Service() { try { _financialAnalysesCsvFileRepository = new AnalysesCsvFileRepository(); _marketDataRepository = new MarketDataCsvFileRepository(); _registryRepository = new RegistryCsvFileRepository(); var reader = new AppSettingsReader(); _buyingPacketInEuro = (int)reader.GetValue("BuyingPacketInEuro", typeof(int)); _fastMovingAverage = (int)reader.GetValue("FastMovingAverage", typeof(int)); _slowMovingAverage = (int)reader.GetValue("SlowMovingAverage", typeof(int)); _logger.Debug($"Buying Packet is {_buyingPacketInEuro} EUR from config file."); _logger.Debug($"Fast Moving Average subset size is {_fastMovingAverage} from config file."); _logger.Debug($"Slow Moving Average subset size is {_slowMovingAverage} from config file."); if (_fastMovingAverage >= _slowMovingAverage) { throw new BusinessException("The timespan for the fast moving average must be lower than of the slow moving average."); } if (_buyingPacketInEuro <= 0 || _fastMovingAverage <= 0 || _slowMovingAverage <= 0) { throw new BusinessException("Buying packet and moving average subset sizes must be positive numbers."); } } catch (Exception ex) { _logger.Error(ex); throw new BusinessException($"Error when initializing {GetType().Name}.", ex); } }
public QuoteCalculator( IMarketDataRepository marketDataRepository, IMarketCalculator marketCalculator) { this.marketDataRepository = marketDataRepository; this.marketCalculator = marketCalculator; }
/// <summary> /// Instantiates a <see cref="SubscriptionManager"/> /// </summary> /// <param name="logger"></param> /// <param name="repository"></param> /// <param name="subscriptionFactory"></param> public SubscriptionManager(ILog logger, IMarketDataRepository repository, ISubscriptionFactory subscriptionFactory) { _logger = logger; _repository = repository; _subscriptionFactory = subscriptionFactory; // set up timer - wait five minutes, then update data every minute _dataUpdateTimer = new Timer(UpdateSubscriptionData); }
public MarketController(IMarketDataRepository marketDataRepository, IAssetPairBestPriceRepository marketProfileRepo, CachedDataDictionary <string, IAssetPair> assetPairsDictionary, IMarketCapitalizationService marketCapitalizationService) { _marketDataRepository = marketDataRepository; _marketProfileRepo = marketProfileRepo; _assetPairsDictionary = assetPairsDictionary; _marketCapitalizationService = marketCapitalizationService; }
// Constructor dependency injection public MarketFactory(IMarketDataRepository marketDataRepo, IMarketFactorySettings settings) { if (marketDataRepo == null) throw new ArgumentNullException("marketDataRepo"); if (settings == null) throw new ArgumentNullException("settings"); _marketDataRepo = marketDataRepo; _settings = settings; }
public WebService( IEnvironmentVariableReader environmentVariableReader, IHttpFacade httpFacade, IMarketDataRepository marketDataRepository) { _environmentVariableReader = environmentVariableReader ?? throw new ArgumentNullException(nameof(environmentVariableReader)); _httpFacade = httpFacade ?? throw new ArgumentNullException(nameof(httpFacade)); _marketDataCsvFileRepository = marketDataRepository ?? throw new ArgumentNullException(nameof(marketDataRepository)); }
public TradeDataAggregationService( IMarketDataRepository marketDataRepository, IAssetsService assetsService, ITradeOperationsRepositoryClient tradeOperationsRepositoryClient, ILykkeMarketProfile marketProfileService, ILog log) { _marketDataRepository = marketDataRepository; _assetsService = assetsService; _tradeOperationsRepositoryClient = tradeOperationsRepositoryClient; _marketProfileService = marketProfileService; _log = log; }
public void SetUp() { var options = new DbContextOptionsBuilder <MarketContext>() .UseInMemoryDatabase(databaseName: Convert.ToBase64String(Guid.NewGuid().ToByteArray()).Substring(0, 8)) .Options; _inMemoryContext = new MarketContext(options); _repo = new MarketDataRepository(_inMemoryContext); var mockCache = new Moq.Mock <ICacheRepository>(); _service = new MarketDataService(_repo, mockCache.Object); }
public MarketFactory(IMarketDataRepository marketDataRepo, IMarketFactorySettings settings) // Constructor dependency injection { if (marketDataRepo == null) { throw new ArgumentNullException("marketDataRepo"); } if (settings == null) { throw new ArgumentNullException("settings"); } _marketDataRepo = marketDataRepo; _settings = settings; }
public Service( IAnalysesRepository analysesRepository, IMarketDataRepository marketDataRepository, IRegistryRepository registryRepository, IConfigReader config) { try { _financialAnalysesCsvFileRepository = analysesRepository; _marketDataRepository = marketDataRepository; _registryRepository = registryRepository; _configReader = config; _buyingPacketInEuro = _configReader.Settings.BuyingPacketInEuro; _fastMovingAverage = _configReader.Settings.FastMovingAverage; _slowMovingAverage = _configReader.Settings.SlowMovingAverage; _logger.Debug($"Buying Packet is {_buyingPacketInEuro} EUR from config file."); _logger.Debug($"Fast Moving Average subset size is {_fastMovingAverage} from config file."); _logger.Debug($"Slow Moving Average subset size is {_slowMovingAverage} from config file."); if (_fastMovingAverage >= _slowMovingAverage) { throw new BusinessException("The timespan for the fast moving average must be lower than of the slow moving average."); } if (_buyingPacketInEuro <= 0 || _fastMovingAverage <= 0 || _slowMovingAverage <= 0) { throw new BusinessException("Buying packet and moving average subset sizes must be positive numbers."); } } catch (Exception ex) { _logger.Error(ex); throw new BusinessException($"Error when initializing {GetType().Name}.", ex); } }
/// <summary> /// Instantiates a <see cref="StaticStockListProvider"/> /// </summary> /// <param name="marketDataRepository"></param> public StaticStockListProvider(IMarketDataRepository marketDataRepository) { _marketDataRepository = marketDataRepository; }
public FixedMarketFactory(IMarketDataRepository marketDataRepo, IMarketFactorySettings settings) : base(marketDataRepo, settings) { }
public RandomMarketFactory(IMarketDataRepository marketDataRepo, IMarketFactorySettings settings) : base(marketDataRepo, settings) { }
public WebService(IMarketDataRepository marketDataRepository) { _marketDataCsvFileRepository = marketDataRepository; }
/// <summary> /// Instantiates a <see cref="OldService"/> /// </summary> /// <param name="marketDataRepository"></param> public OldService(IMarketDataRepository marketDataRepository) { _marketDataRepository = marketDataRepository; }
/// <summary> /// Instantiates a <see cref="StockRetriever"/> /// </summary> /// <param name="marketDataRepository"></param> public StockRetriever(IMarketDataRepository marketDataRepository) { _marketDataRepository = marketDataRepository; }
public MarketDataService(IMarketDataRepository repository, ICacheRepository cacheRepository) { _repository = repository ?? throw new ArgumentNullException(nameof(repository)); _cacheRepository = cacheRepository; }