Search in sources :

Example 6 with Timeframe

use of com.github.jnidzwetzki.bitfinex.v2.entity.Timeframe in project bitfinex-v2-wss-api-java by jnidzwetzki.

the class QuoteManager method unsubscribeCandles.

/**
 * Unsubscribe the candles
 * @param currencyPair
 * @param timeframe
 */
public void unsubscribeCandles(final BitfinexCandlestickSymbol symbol) {
    final int channel = bitfinexApiBroker.getChannelForSymbol(symbol);
    if (channel == -1) {
        throw new IllegalArgumentException("Unknown symbol: " + symbol);
    }
    final UnsubscribeChannelCommand command = new UnsubscribeChannelCommand(channel);
    bitfinexApiBroker.sendCommand(command);
    bitfinexApiBroker.removeChannelForSymbol(symbol);
}
Also used : UnsubscribeChannelCommand(com.github.jnidzwetzki.bitfinex.v2.commands.UnsubscribeChannelCommand)

Aggregations

BitfinexApiBroker (com.github.jnidzwetzki.bitfinex.v2.BitfinexApiBroker)4 BitfinexCandlestickSymbol (com.github.jnidzwetzki.bitfinex.v2.entity.symbol.BitfinexCandlestickSymbol)4 TimeSeries (org.ta4j.core.TimeSeries)4 APIException (com.github.jnidzwetzki.bitfinex.v2.entity.APIException)3 BitfinexCurrencyPair (com.github.jnidzwetzki.bitfinex.v2.entity.BitfinexCurrencyPair)3 BitfinexTick (com.github.jnidzwetzki.bitfinex.v2.entity.BitfinexTick)3 Timeframe (com.github.jnidzwetzki.bitfinex.v2.entity.Timeframe)3 HashMap (java.util.HashMap)3 List (java.util.List)3 Map (java.util.Map)3 CountDownLatch (java.util.concurrent.CountDownLatch)3 Logger (org.slf4j.Logger)3 LoggerFactory (org.slf4j.LoggerFactory)3 Bar (org.ta4j.core.Bar)3 BitfinexTickerSymbol (com.github.jnidzwetzki.bitfinex.v2.entity.symbol.BitfinexTickerSymbol)2 BarMerger (com.github.jnidzwetzki.cryptobot.util.BarMerger)2 BitfinexClientFactory (com.github.jnidzwetzki.cryptobot.util.BitfinexClientFactory)2 ArrayList (java.util.ArrayList)2 Arrays (java.util.Arrays)2 TimeUnit (java.util.concurrent.TimeUnit)2