use of name.abuchen.portfolio.ui.views.SimpleMovingAverage in project portfolio by buchen.
the class SimpleMovingAverageTest method testSufficientPriceDataStartDate.
@Test
public void testSufficientPriceDataStartDate() {
Security security = new Security();
LocalDate date = LocalDate.parse("2016-01-01");
for (int ii = 0; ii < 300; ii++) {
security.addPrice(new SecurityPrice(date, Values.Quote.factorize(10)));
date = date.plusDays(1);
}
LocalDate startDate = LocalDate.parse("2016-06-01");
Date isStartDate = java.sql.Date.valueOf(startDate);
ChartLineSeriesAxes SMALines = new SimpleMovingAverage(10, security, startDate).getSMA();
assertThat(SMALines, is(IsNull.notNullValue()));
assertThat(SMALines.getDates()[0], is(isStartDate));
}
Aggregations