コード例 #1
0
        public void withSma()
        {
            AwesomeOscillatorIndicator awesome = new AwesomeOscillatorIndicator(new MedianPriceIndicator(series));

            Assert.AreEqual(awesome.GetValue(0), 0);
            Assert.AreEqual(awesome.GetValue(1), 0);
            Assert.AreEqual(awesome.GetValue(2), 0);
            Assert.AreEqual(awesome.GetValue(3), 0);
            Assert.AreEqual(awesome.GetValue(4), 0);
        }
コード例 #2
0
        public void withSma1AndSma2()
        {
            AwesomeOscillatorIndicator awesome = new AwesomeOscillatorIndicator(new MedianPriceIndicator(series), 1, 2);

            Assert.AreEqual(awesome.GetValue(0), 0);
            Assert.AreEqual(awesome.GetValue(1), -1.5M);
            Assert.AreEqual(awesome.GetValue(2), 3.5M);
            Assert.AreEqual(awesome.GetValue(3), -4);
            Assert.AreEqual(awesome.GetValue(4), -1);
        }
コード例 #3
0
        public void CalculateWithSma2AndSma3()
        {
            AwesomeOscillatorIndicator awesome = new AwesomeOscillatorIndicator(new MedianPriceIndicator(series), 2, 3);

            Assert.AreEqual(awesome.GetValue(0), 0);
            Assert.AreEqual(awesome.GetValue(1), 0);
            Assert.AreEqual(awesome.GetValue(2), 0.166666666666666666666666667M);
            Assert.AreEqual(awesome.GetValue(3), 1);
            Assert.AreEqual(awesome.GetValue(4), -3);
        }
コード例 #4
0
        public void WithSmaDefault()
        {
            var awesome = new AwesomeOscillatorIndicator(new MedianPriceIndicator(_series));

            TaTestsUtils.AssertDecimalEquals(awesome.GetValue(0), 0);
            TaTestsUtils.AssertDecimalEquals(awesome.GetValue(1), 0);
            TaTestsUtils.AssertDecimalEquals(awesome.GetValue(2), 0);
            TaTestsUtils.AssertDecimalEquals(awesome.GetValue(3), 0);
            TaTestsUtils.AssertDecimalEquals(awesome.GetValue(4), 0);
        }
コード例 #5
0
        public void WithSma1AndSma2()
        {
            var awesome = new AwesomeOscillatorIndicator(new MedianPriceIndicator(_series), 1, 2);

            TaTestsUtils.AssertDecimalEquals(awesome.GetValue(0), 0);
            TaTestsUtils.AssertDecimalEquals(awesome.GetValue(1), "-1.5");
            TaTestsUtils.AssertDecimalEquals(awesome.GetValue(2), "3.5");
            TaTestsUtils.AssertDecimalEquals(awesome.GetValue(3), -4);
            TaTestsUtils.AssertDecimalEquals(awesome.GetValue(4), -1);
        }
コード例 #6
0
        public void CalculateWithSma2AndSma3()
        {
            var awesome = new AwesomeOscillatorIndicator(new MedianPriceIndicator(_series), 2, 3);

            TaTestsUtils.AssertDecimalEquals(awesome.GetValue(0), 0);
            TaTestsUtils.AssertDecimalEquals(awesome.GetValue(1), 0);
            TaTestsUtils.AssertDecimalEquals(awesome.GetValue(2), 1d / 6);
            TaTestsUtils.AssertDecimalEquals(awesome.GetValue(3), 1);
            TaTestsUtils.AssertDecimalEquals(awesome.GetValue(4), -3);
        }