예제 #1
0
        public void ResetsProperly()
        {
            var date = DateTime.Today;
            var variance = new Variance("VAR", 10);
            foreach (var data in TestHelper.GetTradeBarStream("spy_var.txt"))
            {
                variance.Update(date, data.Close);
            }

            Assert.IsTrue(variance.IsReady);

            variance.Reset();

            TestHelper.AssertIndicatorIsInDefaultState(variance);
        }
예제 #2
0
        public void ResetsProperly()
        {
            var date     = DateTime.Today;
            var variance = new Variance("VAR", 10);

            foreach (var data in TestHelper.GetTradeBarStream("spy_var.txt"))
            {
                variance.Update(date, data.Close);
            }

            Assert.IsTrue(variance.IsReady);

            variance.Reset();

            TestHelper.AssertIndicatorIsInDefaultState(variance);
        }
예제 #3
0
 public void Update(Security security, BaseData data)
 {
     _variance.Update(data.EndTime, data.Price - _previousPrice);
     _previousPrice = data.Price;
 }
예제 #4
0
 public void Update(Security security, BaseData data)
 {
     _variance.Update(data.EndTime, data.Price);
 }