예제 #1
0
        public override void ComparesAgainstExternalDataAfterReset()
        {
            var indicator = new HeikinAshi();

            for (var i = 1; i <= 2; i++)
            {
                TestHelper.TestIndicator(indicator, TestFileName, "HA_Open",
                                         (ind, expected) => ((double)((HeikinAshi)ind).Open.Current.Price).Should()
                                         .BeApproximately(expected, 1e-3));
                indicator.Reset();
                TestHelper.TestIndicator(indicator, TestFileName, "HA_High",
                                         (ind, expected) => ((double)((HeikinAshi)ind).High.Current.Price).Should()
                                         .BeApproximately(expected, 1e-3));
                indicator.Reset();
                TestHelper.TestIndicator(indicator, TestFileName, "HA_Low",
                                         (ind, expected) => ((double)((HeikinAshi)ind).Low.Current.Price).Should()
                                         .BeApproximately(expected, 1e-3));
                indicator.Reset();
                TestHelper.TestIndicator(indicator, TestFileName, "HA_Close",
                                         (ind, expected) => ((double)((HeikinAshi)ind).Close.Current.Price).Should()
                                         .BeApproximately(expected, 1e-3));
                indicator.Reset();
                TestHelper.TestIndicator(indicator, TestFileName, "Volume",
                                         (ind, expected) => ((double)((HeikinAshi)ind).Volume.Current.Price).Should()
                                         .BeApproximately(expected, 1e-3));
                indicator.Reset();
            }
        }
예제 #2
0
        public override void ComparesAgainstExternalDataAfterReset()
        {
            var indicator = new HeikinAshi();

            for (var i = 1; i <= 2; i++)
            {
                TestHelper.TestIndicator(indicator, TestFileName, "HA_Open", (ind, expected) => Assert.AreEqual(expected, (double)((HeikinAshi)ind).Open.Current.Value, 1e-3));
                indicator.Reset();
                TestHelper.TestIndicator(indicator, TestFileName, "HA_High", (ind, expected) => Assert.AreEqual(expected, (double)((HeikinAshi)ind).High.Current.Value, 1e-3));
                indicator.Reset();
                TestHelper.TestIndicator(indicator, TestFileName, "HA_Low", (ind, expected) => Assert.AreEqual(expected, (double)((HeikinAshi)ind).Low.Current.Value, 1e-3));
                indicator.Reset();
                TestHelper.TestIndicator(indicator, TestFileName, "HA_Close", (ind, expected) => Assert.AreEqual(expected, (double)((HeikinAshi)ind).Close.Current.Value, 1e-3));
                indicator.Reset();
            }
        }