public static Ticker adaptTicker(BitfinexTicker bitfinexTicker) { BigDecimal last = bitfinexTicker.getLastPrice(); BigDecimal bid = bitfinexTicker.getBid(); BigDecimal bidSize = bitfinexTicker.getBidSize(); BigDecimal ask = bitfinexTicker.getAsk(); BigDecimal askSize = bitfinexTicker.getAskSize(); BigDecimal high = bitfinexTicker.getHigh(); BigDecimal low = bitfinexTicker.getLow(); BigDecimal volume = bitfinexTicker.getVolume(); CurrencyPair currencyPair = CurrencyPairDeserializer.getCurrencyPairFromString(bitfinexTicker.getSymbol().substring(1)); return new Ticker.Builder() .currencyPair(currencyPair) .last(last) .bid(bid) .ask(ask) .high(high) .low(low) .volume(volume) .bidSize(bidSize) .askSize(askSize) .build(); }
public static Ticker adaptTicker(BitfinexTicker bitfinexTicker) { BigDecimal last = bitfinexTicker.getLastPrice(); BigDecimal bid = bitfinexTicker.getBid(); BigDecimal bidSize = bitfinexTicker.getBidSize(); BigDecimal ask = bitfinexTicker.getAsk(); BigDecimal askSize = bitfinexTicker.getAskSize(); BigDecimal high = bitfinexTicker.getHigh(); BigDecimal low = bitfinexTicker.getLow(); BigDecimal volume = bitfinexTicker.getVolume(); CurrencyPair currencyPair = CurrencyPairDeserializer.getCurrencyPairFromString(bitfinexTicker.getSymbol().substring(1)); return new Ticker.Builder() .currencyPair(currencyPair) .last(last) .bid(bid) .ask(ask) .high(high) .low(low) .volume(volume) .bidSize(bidSize) .askSize(askSize) .build(); }
public synchronized Ticker toTicker() { CurrencyPair currencyPair = pair; if (currencyPair == null) { currencyPair = BinanceAdapters.adaptSymbol(symbol); } if (ticker == null) { ticker = new Ticker.Builder() .currencyPair(currencyPair) .open(openPrice) .ask(askPrice) .bid(bidPrice) .last(lastPrice) .high(highPrice) .low(lowPrice) .volume(volume) .vwap(weightedAvgPrice) .askSize(askQty) .bidSize(bidQty) .quoteVolume(quoteVolume) .build(); } return ticker; } }
public synchronized Ticker toTicker() { CurrencyPair currencyPair = pair; if (currencyPair == null) { currencyPair = BinanceAdapters.adaptSymbol(symbol); } if (ticker == null) { ticker = new Ticker.Builder() .currencyPair(currencyPair) .open(openPrice) .ask(askPrice) .bid(bidPrice) .last(lastPrice) .high(highPrice) .low(lowPrice) .volume(volume) .vwap(weightedAvgPrice) .askSize(askQty) .bidSize(bidQty) .quoteVolume(quoteVolume) .build(); } return ticker; } }
public static Ticker adaptTicker(CurrencyPair currencyPair, ItBitTicker itBitTicker) { BigDecimal bid = itBitTicker.getBid(); BigDecimal ask = itBitTicker.getAsk(); BigDecimal high = itBitTicker.getHighToday(); BigDecimal low = itBitTicker.getLowToday(); BigDecimal last = itBitTicker.getLastPrice(); BigDecimal volume = itBitTicker.getVolume24h(); Date timestamp = itBitTicker.getTimestamp() != null ? parseDate(itBitTicker.getTimestamp()) : null; return new Ticker.Builder() .currencyPair(currencyPair) .last(last) .bid(bid) .ask(ask) .high(high) .low(low) .volume(volume) .timestamp(timestamp) .bidSize(itBitTicker.getBidAmt()) .askSize(itBitTicker.getAskAmt()) .build(); }