public void GetValueWithCacheLengthIncrease() { var data = new double[200]; TaTestsUtils.ArraysFill(data, 10); var sma = new SmaIndicator(new ClosePriceIndicator(GenerateTimeSeries.From(data)), 100); TaTestsUtils.AssertDecimalEquals(sma.GetValue(105), 10); }
public void GetValueWithOldResultsRemoval() { var data = new double[20]; TaTestsUtils.ArraysFill(data, 1); TimeSeries timeSeries = GenerateTimeSeries.From(data); var sma = new SmaIndicator(new ClosePriceIndicator(timeSeries), 10); TaTestsUtils.AssertDecimalEquals(sma.GetValue(5), 1); TaTestsUtils.AssertDecimalEquals(sma.GetValue(10), 1); timeSeries.MaximumTickCount = 12; TaTestsUtils.AssertDecimalEquals(sma.GetValue(19), 1); }