@Test public void shouldReturnUnknownTrendForUncompletedCandleSticks() { when(timeFrameConverter.aggregate(any())).thenReturn(empty()) .thenReturn(Optional.of(DUMMY_AGGREGATED_CANDLE_STICK)).thenReturn(empty()); when(orig.indicate(any())).thenReturn(UP); final List<Optional<MarketDirection>> trends = range(0, 3).mapToObj(i -> cut.indicate(DUMMY_INPUT_CANDLE_STICK)) .collect(toList()); assertThat(trends).containsExactly(UNKNOWN, UP, UNKNOWN); }
@Override public Optional<IT> indicate(final CIN candle) { return timeFrameConverter.aggregate(candle).flatMap(c -> orig.indicate(c)); }
DiscreteTimeFrameConvertingIndicator implements Indicator<IT, CIN> { @Override public Optional<IT> indicate(final CIN candle) { return timeFrameConverter.aggregate(candle).flatMap(c -> orig.indicate(c)); } }
DiscreteTimeFrameConvertingIndicator implements Indicator<IT, CIN> { @Override public Optional<IT> indicate(final CIN candle) { return timeFrameConverter.aggregate(candle).flatMap(c -> orig.indicate(c)); } DiscreteTimeFrameConvertingIndicator(final Indicator<IT, DatedCandleStick<OTF>> orig,
            final TimeFrameConverter<CIN, COUT, ITF, OTF> timeFrameConverter); }
DiscreteTimeFrameConvertingIndicator implements Indicator<IT, CIN> { @Override public Optional<IT> indicate(final CIN candle) { return timeFrameConverter.aggregate(candle).flatMap(c -> orig.indicate(c)); } DiscreteTimeFrameConvertingIndicator(final Indicator<IT, DatedCandleStick<OTF>> orig,
            final TimeFrameConverter<CIN, COUT, ITF, OTF> timeFrameConverter); @Override Optional<IT> indicate(final CIN candle); }
DiscreteTimeFrameConvertingIndicator implements Indicator<IT, CIN> { @Override public Optional<IT> indicate(final CIN candle) { return timeFrameConverter.aggregate(candle).flatMap(c -> orig.indicate(c)); } DiscreteTimeFrameConvertingIndicator(final Indicator<IT, DatedCandleStick<OTF>> orig,
            final TimeFrameConverter<CIN, COUT, ITF, OTF> timeFrameConverter); @Override Optional<IT> indicate(final CIN candle);  }