Search in sources :

Example 6 with OrderBookFrequency

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

the class RawOrderbookManager method unsubscribeOrderbook.

/**
 * Unsubscribe a orderbook
 * @param currencyPair
 * @param orderBookPrecision
 * @param orderBookFrequency
 * @param pricePoints
 */
public void unsubscribeOrderbook(final RawOrderbookConfiguration orderbookConfiguration) {
    final int channel = bitfinexApiBroker.getChannelForSymbol(orderbookConfiguration);
    if (channel == -1) {
        throw new IllegalArgumentException("Unknown symbol: " + orderbookConfiguration);
    }
    final UnsubscribeChannelCommand command = new UnsubscribeChannelCommand(channel);
    bitfinexApiBroker.sendCommand(command);
    bitfinexApiBroker.removeChannelForSymbol(orderbookConfiguration);
}
Also used : UnsubscribeChannelCommand(com.github.jnidzwetzki.bitfinex.v2.commands.UnsubscribeChannelCommand)

Aggregations

UnsubscribeChannelCommand (com.github.jnidzwetzki.bitfinex.v2.commands.UnsubscribeChannelCommand)3 SubscribeOrderbookCommand (com.github.jnidzwetzki.bitfinex.v2.commands.SubscribeOrderbookCommand)1 SubscribeRawOrderbookCommand (com.github.jnidzwetzki.bitfinex.v2.commands.SubscribeRawOrderbookCommand)1 SubscribeTradesCommand (com.github.jnidzwetzki.bitfinex.v2.commands.SubscribeTradesCommand)1