public CexMarketManager() { _cexApiClient = new CexApiClient(ConfigurationProvider.GetConfigurationByName(ConfigurationNameHolder.CexApiUrl, "")); _elasticClient = new ElasticDatabaseClient(ConfigurationProvider.GetConfigurationByName(ConfigurationNameHolder.ElasticApiUrl, ""), ElasticApiUrlHolder.ExchangeName.CEX); _coinMonitoringApiClient = new CoinMonitoringApiClient(ConfigurationProvider.GetConfigurationByName(ConfigurationNameHolder.CoinMonitoringApi, "")); _rsiManager = new RSIEcoIndexManager(ElasticApiUrlHolder.ExchangeName.CEX); _emaManager = new EMAEcoIndexManager(ElasticApiUrlHolder.ExchangeName.CEX); _forceIndexEcoIndexManager = new ForceIndexEcoIndexManager(ElasticApiUrlHolder.ExchangeName.CEX); }
public void NormalCalculation2() { RSIEcoIndexManager rsiManager = new RSIEcoIndexManager(); List <TickerFormattedDto> tickers = new List <TickerFormattedDto> { new TickerFormattedDto { ExchangeType = ExchangeTypeEnum.Cex, High = 100, Last = 100, Low = 100, PairType = ExchangePairTypeEnum.ETH_BTC, Time = DateTime.Now, Volume = 100 }, new TickerFormattedDto { ExchangeType = ExchangeTypeEnum.Cex, High = 120, Last = 120, Low = 120, PairType = ExchangePairTypeEnum.ETH_BTC, Time = DateTime.Now, Volume = 120 }, new TickerFormattedDto { ExchangeType = ExchangeTypeEnum.Cex, High = 110, Last = 110, Low = 110, PairType = ExchangePairTypeEnum.ETH_BTC, Time = DateTime.Now, Volume = 110 }, new TickerFormattedDto { ExchangeType = ExchangeTypeEnum.Cex, High = 130, Last = 130, Low = 130, PairType = ExchangePairTypeEnum.ETH_BTC, Time = DateTime.Now, Volume = 130 }, }; decimal rsi = rsiManager.CalculateRSI(tickers); Assert.AreNotEqual(0M, rsi); }
public void ZeroReturn() { RSIEcoIndexManager rsiManager = new RSIEcoIndexManager(); List <TickerFormattedDto> tickers = new List <TickerFormattedDto> { new TickerFormattedDto { ExchangeType = ExchangeTypeEnum.Cex, High = 100, Last = -111, Low = 100, PairType = ExchangePairTypeEnum.ETH_BTC, Time = DateTime.Now, Volume = 100 } }; decimal rsi = rsiManager.CalculateRSI(tickers); Assert.AreEqual(0M, rsi); }