private void GenerateLow() { var LowData = new LowestLow(this.Candles.Select(y => y.Candle), 12).Compute(); if (LowData.Last().Tick != null) { this.LowestLow.Add(LowData.Last().Tick.ChangeType <double>()); if (this.LowestLow.Count() > 1) { switch (this.LowestLow.HasChange()) { ///Raise signal and update index case List.GenericChangeType.Down: IndexLowestLow = this.LowestLow.Count() - 1; break; case List.GenericChangeType.Up: IndexLowestLow = this.LowestLow.Count() - 1; break; case List.GenericChangeType.Same: break; } } } }
public async Task TestLowestLowAsync() { var candles = await ImportCandlesAsync(); var indicator = new LowestLow(candles, 10); var result = indicator[candles.Count - 1]; Assert.IsTrue(136.99m.IsApproximatelyEquals(result.Value)); }
public async Task TestLowestLowAsync() { var equity = await ImportEquityAsync(); var indicator = new LowestLow(equity, 10); var result = indicator.ComputeByIndex(equity.Count - 1); Assert.IsTrue(136.99m.IsApproximatelyEquals(result.LowestLow.Value)); }