Esempio n. 1
0
        public async Task TestClosePricePercentageChangedAsync()
        {
            var equity = await ImportEquityAsync();

            var indicator = new ClosePricePercentageChange(equity);
            var result    = indicator.ComputeByIndex(equity.Count - 1);

            Assert.IsTrue(0.1145m.IsApproximatelyEquals(result.PercentageChange.Value));
        }
Esempio n. 2
0
        public async Task TestClosePricePercentageChangedAsync()
        {
            var candles = await ImportCandlesAsync();

            var indicator = new ClosePricePercentageChange(candles);
            var result    = indicator[candles.Count - 1];

            Assert.IsTrue(0.1145m.IsApproximatelyEquals(result.Value));

            indicator = new ClosePricePercentageChange(candles, 20);
            result    = indicator[candles.Count - 1];
            Assert.IsTrue(4.800m.IsApproximatelyEquals(result.Value));
        }