Exemple #1
0
        public void ComparesAgainstExternalDataAfterReset()
        {
            var cmo = new ChandeMomentumOscillator("CMO", 5);

            TestIndicator(cmo);
            cmo.Reset();
            TestIndicator(cmo);
        }
        public void ComparesAgainstExternalDataAfterReset()
        {
            var cmo = new ChandeMomentumOscillator("CMO", 5);

            TestIndicator(cmo);
            cmo.Reset();
            TestIndicator(cmo);
        }
        public void ResetsProperly()
        {
            var date = DateTime.Today;
            var cmo = new ChandeMomentumOscillator("CMO", 5);
            foreach (var data in TestHelper.GetTradeBarStream("spy_cmo.txt"))
            {
                cmo.Update(date, data.Close);
            }

            Assert.IsTrue(cmo.IsReady);

            cmo.Reset();

            TestHelper.AssertIndicatorIsInDefaultState(cmo);
        }
Exemple #4
0
 private static void TestIndicator(ChandeMomentumOscillator cmo)
 {
     TestHelper.TestIndicator(cmo, "spy_cmo.txt", "CMO_5", (ind, expected) => Assert.AreEqual(expected, (double)ind.Current.Value, 1e-3));
 }
Exemple #5
0
        public void ResetsProperly()
        {
            var cmo = new ChandeMomentumOscillator("CMO", 5);

            TestHelper.TestIndicatorReset(cmo, "spy_cmo.txt");
        }
        /// <summary>
        /// Initialize test
        /// </summary>
        public TestIndicatorChandelMomentumOscillator()
        {
            DataStream stream = new OHLCBarStream(new ForexSecurity("EURUSD"), BarInterval.FiveMin);

            _sut = new ChandeMomentumOscillator(Period, stream.DefaultInterval, stream);
        }
        public void ComparesAgainstExternalData()
        {
            var cmo = new ChandeMomentumOscillator("CMO", 5);

            TestHelper.TestIndicator(cmo, "spy_cmo.txt", "CMO_5", (ind, expected) => Assert.AreEqual(expected, (double)ind.Current.Value, 1e-3));
        }
        public void ResetsProperly()
        {
            var cmo = new ChandeMomentumOscillator("CMO", 5);

            TestHelper.TestIndicatorReset(cmo, "spy_cmo.txt");
        }
Exemple #9
0
 private static void TestIndicator(ChandeMomentumOscillator cmo)
 {
     TestHelper.TestIndicator(cmo, "spy_cmo.txt", "CMO_5",
                              (ind, expected) => ((double)ind.Current.Price).Should().BeApproximately(expected, 1e-3));
 }
 private static void TestIndicator(ChandeMomentumOscillator cmo)
 {
     TestHelper.TestIndicator(cmo, "spy_cmo.txt", "CMO_5", (ind, expected) => Assert.AreEqual(expected, (double)ind.Current.Value, 1e-3));
 }