@Test public void naNValuesInIntervall() { BaseBarSeries series = new BaseBarSeries("NaN test"); for (long i = 0; i <= 10; i++) { Num closePrice = i % 2 == 0 ? series.numOf(i) : NaN; series.addBar(ZonedDateTime.now().plusDays(i), NaN, NaN, NaN, closePrice, NaN); } HighestValueIndicator highestValue = new HighestValueIndicator(new ClosePriceIndicator(series), 2); for (int i = series.getBeginIndex(); i <= series.getEndIndex(); i++) { if (i % 2 != 0) assertEquals(series.getBar(i - 1).getClosePrice().toString(), highestValue.getValue(i).toString()); else assertEquals(series.getBar(i).getClosePrice().toString(), highestValue.getValue(i).toString()); } }
@Override public String toString() { return getClass().getSimpleName() + " barCount: " + barCount; }
HighestValueIndicator extends CachedIndicator<Num> { @Override public String toString() { return getClass().getSimpleName() + " barCount: " + barCount; } }
HighestValueIndicator extends CachedIndicator<Num> { @Override public String toString() { return getClass().getSimpleName() + " barCount: " + barCount; } HighestValueIndicator(Indicator<Num> indicator, int barCount); }
HighestValueIndicator extends CachedIndicator<Num> { @Override public String toString() { return getClass().getSimpleName() + " barCount: " + barCount; } HighestValueIndicator(Indicator<Num> indicator, int barCount); @Override String toString(); }
HighestValueIndicator extends CachedIndicator<Num> { @Override public String toString() { return getClass().getSimpleName() + " barCount: " + barCount; } HighestValueIndicator(Indicator<Num> indicator, int barCount); @Override String toString();  }