public void indicatorShouldRetrieveBarVariation() { Assert.AreEqual(variationIndicator.GetValue(0), 1); for (int i = 1; i < 10; i++) { decimal previousBarClosePrice = timeSeries.GetBar(i - 1).ClosePrice; decimal currentBarClosePrice = timeSeries.GetBar(i).ClosePrice; Assert.AreEqual(variationIndicator.GetValue(i), currentBarClosePrice.DividedBy(previousBarClosePrice)); } }
public void IndicatorShouldRetrieveTickVariation() { TaTestsUtils.AssertDecimalEquals(_variationIndicator.GetValue(0), 1); for (var i = 1; i < 10; i++) { var previousTickClosePrice = _timeSeries.GetTick(i - 1).ClosePrice; var currentTickClosePrice = _timeSeries.GetTick(i).ClosePrice; Assert.AreEqual(_variationIndicator.GetValue(i), currentTickClosePrice.DividedBy(previousTickClosePrice)); } }