public void ValueLessThenTimeFrame()
        {
            var wr = new WilliamsRIndicator(new ClosePriceIndicator(_data), 100, new MaxPriceIndicator(_data), new MinPriceIndicator(_data));

            TaTestsUtils.AssertDecimalEquals(wr.GetValue(0), -100d * (0.12 / 0.21));
            TaTestsUtils.AssertDecimalEquals(wr.GetValue(1), -100d * (0.07 / 0.21));
            TaTestsUtils.AssertDecimalEquals(wr.GetValue(2), -100d * (0.13 / 0.36));
            TaTestsUtils.AssertDecimalEquals(wr.GetValue(3), -100d * (0.18 / 0.36));
        }
        public void WilliamsRUsingTimeFrame10UsingClosePrice()
        {
            var wr = new WilliamsRIndicator(new ClosePriceIndicator(_data), 10, new MaxPriceIndicator(_data), new MinPriceIndicator(_data));

            TaTestsUtils.AssertDecimalEquals(wr.GetValue(9), -4.0816);
            TaTestsUtils.AssertDecimalEquals(wr.GetValue(10), -11.7647);
            TaTestsUtils.AssertDecimalEquals(wr.GetValue(11), -8.9286);
            TaTestsUtils.AssertDecimalEquals(wr.GetValue(12), -10.5263);
        }
        public void valueLessThenTimeFrame()
        {
            WilliamsRIndicator wr = new WilliamsRIndicator(new ClosePriceIndicator(data), 100, new MaxPriceIndicator(data),
                                                           new MinPriceIndicator(data));

            Assert.AreEqual(-100M * (0.12M / 0.21M), wr.GetValue(0));
            Assert.AreEqual(-100M * (0.07M / 0.21M), wr.GetValue(1));
            Assert.AreEqual(-100M * (0.13M / 0.36M), wr.GetValue(2));
            Assert.AreEqual(-100M * (0.18M / 0.36M), wr.GetValue(3));
        }
        public void williamsRUsingTimeFrame10UsingClosePrice()
        {
            WilliamsRIndicator wr = new WilliamsRIndicator(new ClosePriceIndicator(data), 10, new MaxPriceIndicator(data),
                                                           new MinPriceIndicator(data));

            Assert.AreEqual(wr.GetValue(9), -4.0816326530612244897959183700M);
            Assert.AreEqual(wr.GetValue(10), -11.764705882352941176470588240M);
            Assert.AreEqual(wr.GetValue(11), -8.928571428571428571428571430M);
            Assert.AreEqual(wr.GetValue(12), -10.526315789473684210526315790M);
        }
        public void WilliamsRUsingTimeFrame5UsingClosePrice()
        {
            var wr = new WilliamsRIndicator(new ClosePriceIndicator(_data), 5, new MaxPriceIndicator(_data), new MinPriceIndicator(_data));

            TaTestsUtils.AssertDecimalEquals(wr.GetValue(4), -47.2222);
            TaTestsUtils.AssertDecimalEquals(wr.GetValue(5), -54.5454);
            TaTestsUtils.AssertDecimalEquals(wr.GetValue(6), -78.5714);
            TaTestsUtils.AssertDecimalEquals(wr.GetValue(7), -47.6190);
            TaTestsUtils.AssertDecimalEquals(wr.GetValue(8), -25d);
            TaTestsUtils.AssertDecimalEquals(wr.GetValue(9), -5.2632);
            TaTestsUtils.AssertDecimalEquals(wr.GetValue(10), -13.9535);
        }
        public void williamsRUsingTimeFrame5UsingClosePrice()
        {
            WilliamsRIndicator wr = new WilliamsRIndicator(new ClosePriceIndicator(data), 5,
                                                           new MaxPriceIndicator(data),
                                                           new MinPriceIndicator(data));

            Assert.AreEqual(wr.GetValue(4), -47.222222222222222222222222220M);
            Assert.AreEqual(wr.GetValue(5), -54.545454545454545454545454550M);
            Assert.AreEqual(wr.GetValue(6), -78.571428571428571428571428570M);
            Assert.AreEqual(wr.GetValue(7), -47.619047619047619047619047620M);
            Assert.AreEqual(wr.GetValue(8), -25M);
            Assert.AreEqual(wr.GetValue(9), -5.2631578947368421052631578900M);
            Assert.AreEqual(wr.GetValue(10), -13.953488372093023255813953490M);
        }