Exemple #1
0
        public void stochasticOscilatorDParam14UsingSMA3AndGenericConstructer()
        {
            StochasticOscillatorKIndicator sof = new StochasticOscillatorKIndicator(data, 14);
            SMAIndicator sma = new SMAIndicator(sof, 3);
            StochasticOscillatorDIndicator sos = new StochasticOscillatorDIndicator(sma);

            Assert.AreEqual(sma.GetValue(0), sos.GetValue(0));
            Assert.AreEqual(sma.GetValue(1), sos.GetValue(1));
            Assert.AreEqual(sma.GetValue(2), sos.GetValue(2));
        }
        public void StochasticOscilatorDParam14UsingSma3()
        {
            var sof = new StochasticOscillatorKIndicator(_data, 14);
            var sos = new StochasticOscillatorDIndicator(sof);
            var sma = new SmaIndicator(sof, 3);

            Assert.AreEqual(sma.GetValue(0), sos.GetValue(0));
            Assert.AreEqual(sma.GetValue(1), sos.GetValue(1));
            Assert.AreEqual(sma.GetValue(2), sos.GetValue(2));
            Assert.AreEqual(sma.GetValue(13), sos.GetValue(13));
        }