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