Search in sources :

Example 1 with DonchianChannelUpper

use of com.github.jnidzwetzki.cryptobot.strategy.indicator.DonchianChannelUpper in project crypto-bot by jnidzwetzki.

the class DonchianBot method getUpperChannelValue.

/**
 * Get the upper channel value
 * @param currencyPair
 * @return
 */
private Decimal getUpperChannelValue(final BitfinexCurrencyPair currencyPair) {
    final TimeSeries currencyTimeSeries = timeSeries.get(currencyPair);
    final MaxPriceIndicator maxPrice = new MaxPriceIndicator(currencyTimeSeries);
    final DonchianChannelUpper donchianChannelUpper = new DonchianChannelUpper(maxPrice, periodIn);
    return donchianChannelUpper.getValue(currencyTimeSeries.getEndIndex());
}
Also used : MaxPriceIndicator(org.ta4j.core.indicators.helpers.MaxPriceIndicator) TimeSeries(org.ta4j.core.TimeSeries) DonchianChannelUpper(com.github.jnidzwetzki.cryptobot.strategy.indicator.DonchianChannelUpper)

Aggregations

DonchianChannelUpper (com.github.jnidzwetzki.cryptobot.strategy.indicator.DonchianChannelUpper)1 TimeSeries (org.ta4j.core.TimeSeries)1 MaxPriceIndicator (org.ta4j.core.indicators.helpers.MaxPriceIndicator)1