public void Test() { DateTime date = new DateTime(2015, 5, 19, 9, 31, 00); foreach (var data in TestHelper.GetTradeBarStream("spy_WilliamsWVF.csv", false)) { wvf.Update(data); //System.Diagnostics.Debug.WriteLine(wvf.Current.Value); } Assert.IsTrue(wvf.Current.Value == 1.9321648621164084464915953800m); }
public void ResetsProperly() { var onBalanceVolumeIndicator = new OnBalanceVolume("OBV"); foreach (var data in TestHelper.GetTradeBarStream("spy_with_obv.txt", false)) { onBalanceVolumeIndicator.Update(data); } Assert.IsTrue(onBalanceVolumeIndicator.IsReady); onBalanceVolumeIndicator.Reset(); }
public void ResetsProperly() { var adxIndicator = new AverageDirectionalIndex("ADX", 14); foreach (var data in TestHelper.GetTradeBarStream("spy_with_adx.txt", false)) { adxIndicator.Update(data); } Assert.IsTrue(adxIndicator.IsReady); adxIndicator.Reset(); }
public void ResetsProperly() { var wilr = new WilliamsPercentR(14); foreach (var data in TestHelper.GetTradeBarStream("spy_with_williamsR14.txt", false)) { wilr.Update(data); } Assert.IsTrue(wilr.IsReady); wilr.Reset(); TestHelper.AssertIndicatorIsInDefaultState(wilr); }
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); }
public override void ResetsProperly() { var ind = CreateIndicator(); foreach (var data in TestHelper.GetTradeBarStream(TestFileName)) { ind.Update(data); } Assert.IsTrue(ind.IsReady); ind.Reset(); TestHelper.AssertIndicatorIsInDefaultState(ind); ind.Update(new TradeBar(DateTime.UtcNow, Symbols.SPY, 2m, 2m, 2m, 2m, 1)); Assert.AreEqual(ind.Current.Value, 2m); }
public void ResetsProperly() { var ind = new VolumeWeightedAveragePriceIndicator(50); foreach (var data in TestHelper.GetTradeBarStream("spy_with_vwap.txt")) { ind.Update(data); } Assert.IsTrue(ind.IsReady); ind.Reset(); TestHelper.AssertIndicatorIsInDefaultState(ind); ind.Update(new TradeBar(DateTime.UtcNow, Symbols.SPY, 2m, 2m, 2m, 2m, 1)); Assert.AreEqual(ind.Current.Value, 2m); }
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); }
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); }
public void ResetsProperly() { var stochastics = new Stochastic("sto", 12, 3, 5); foreach (var bar in TestHelper.GetTradeBarStream("spy_with_stoch12k3.txt", false)) { stochastics.Update(bar); } Assert.IsTrue(stochastics.IsReady); Assert.IsTrue(stochastics.FastStoch.IsReady); Assert.IsTrue(stochastics.StochK.IsReady); Assert.IsTrue(stochastics.StochD.IsReady); stochastics.Reset(); TestHelper.AssertIndicatorIsInDefaultState(stochastics); TestHelper.AssertIndicatorIsInDefaultState(stochastics.FastStoch); TestHelper.AssertIndicatorIsInDefaultState(stochastics.StochK); TestHelper.AssertIndicatorIsInDefaultState(stochastics.StochD); }
public new void ResetsProperly() { var stochastics = CreateIndicator() as Stochastic; foreach (var bar in TestHelper.GetTradeBarStream(TestFileName, false)) { stochastics.Update(bar); } Assert.IsTrue(stochastics.IsReady); Assert.IsTrue(stochastics.FastStoch.IsReady); Assert.IsTrue(stochastics.StochK.IsReady); Assert.IsTrue(stochastics.StochD.IsReady); stochastics.Reset(); TestHelper.AssertIndicatorIsInDefaultState(stochastics); TestHelper.AssertIndicatorIsInDefaultState(stochastics.FastStoch); TestHelper.AssertIndicatorIsInDefaultState(stochastics.StochK); TestHelper.AssertIndicatorIsInDefaultState(stochastics.StochD); }
public override void ResetsProperly() { var kch = CreateIndicator() as KeltnerChannels; foreach (var data in TestHelper.GetTradeBarStream(TestFileName, false)) { kch.Update(data); } Assert.IsTrue(kch.IsReady); Assert.IsTrue(kch.UpperBand.IsReady); Assert.IsTrue(kch.LowerBand.IsReady); Assert.IsTrue(kch.MiddleBand.IsReady); Assert.IsTrue(kch.AverageTrueRange.IsReady); kch.Reset(); TestHelper.AssertIndicatorIsInDefaultState(kch); TestHelper.AssertIndicatorIsInDefaultState(kch.UpperBand); TestHelper.AssertIndicatorIsInDefaultState(kch.LowerBand); TestHelper.AssertIndicatorIsInDefaultState(kch.AverageTrueRange); }
public void ResetsProperly() { var kch = new KeltnerChannels(20, 1.5m, MovingAverageType.Simple); foreach (var data in TestHelper.GetTradeBarStream("spy_with_keltner.csv", false)) { kch.Update(data); } Assert.IsTrue(kch.IsReady); Assert.IsTrue(kch.UpperBand.IsReady); Assert.IsTrue(kch.LowerBand.IsReady); Assert.IsTrue(kch.MiddleBand.IsReady); Assert.IsTrue(kch.AverageTrueRange.IsReady); kch.Reset(); TestHelper.AssertIndicatorIsInDefaultState(kch); TestHelper.AssertIndicatorIsInDefaultState(kch.UpperBand); TestHelper.AssertIndicatorIsInDefaultState(kch.LowerBand); TestHelper.AssertIndicatorIsInDefaultState(kch.AverageTrueRange); }