Пример #1
0
        public void ResetsProperly()
        {
            var bop = new BalanceOfPower("BOP");

            foreach (var data in TestHelper.GetTradeBarStream("spy_bop.txt", false))
            {
                bop.Update(data);
            }

            Assert.IsTrue(bop.IsReady);

            bop.Reset();

            TestHelper.AssertIndicatorIsInDefaultState(bop);
        }
Пример #2
0
        public void ComparesAgainstExternalData()
        {
            var bop = new BalanceOfPower("BOP");

            TestHelper.TestIndicator(bop, "spy_bop.txt", "BOP", (ind, expected) => Assert.AreEqual(expected, (double)bop.Current.Value, 1e-3));
        }
Пример #3
0
        /// <summary>
        /// Initialize test
        /// </summary>
        public TestIndicatorBalanceOfPower()
        {
            DataStream stream = new OHLCBarStream(new ForexSecurity("EURUSD"), BarInterval.FiveMin);

            _sut = new BalanceOfPower(stream, TimeSpan.FromMinutes(5));
        }