/// <summary> /// Exposes a means to update underlying indicator /// </summary> /// <param name="data"></param> public override void Update(BaseData data) { _donchian.Update((IBaseDataBar)data); Indicator.Update(new IndicatorDataPoint(data.Time, data.Value)); base.Update(data); }
public void ResetsProperly() { var donchianChannelIndicator = new DonchianChannel("DCH", 50); foreach (var data in TestHelper.GetTradeBarStream("spy_with_don50.txt", false)) { donchianChannelIndicator.Update(data); } Assert.IsTrue(donchianChannelIndicator.IsReady); Assert.IsTrue(donchianChannelIndicator.UpperBand.IsReady); Assert.IsTrue(donchianChannelIndicator.LowerBand.IsReady); donchianChannelIndicator.Reset(); TestHelper.AssertIndicatorIsInDefaultState(donchianChannelIndicator); TestHelper.AssertIndicatorIsInDefaultState(donchianChannelIndicator.UpperBand); TestHelper.AssertIndicatorIsInDefaultState(donchianChannelIndicator.LowerBand); }