All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.knowm.xchange.jubi.JubiAdapters Maven / Gradle / Ivy

There is a newer version: 4.3.0
Show newest version
package org.knowm.xchange.jubi;

import java.math.BigDecimal;

import org.knowm.xchange.currency.CurrencyPair;
import org.knowm.xchange.dto.marketdata.Ticker;
import org.knowm.xchange.jubi.dto.marketdata.JubiTicker;

/**
 * Created by Yingzhe on 3/16/2015.
 */
public class JubiAdapters {
  public static Ticker adaptTicker(JubiTicker ticker, CurrencyPair currencyPair) {
    BigDecimal high = ticker.getHigh();
    BigDecimal low = ticker.getLow();
    BigDecimal buy = ticker.getBuy();
    BigDecimal sell = ticker.getSell();
    BigDecimal last = ticker.getLast();
    BigDecimal volume = ticker.getVol();
    return new Ticker.Builder().currencyPair(currencyPair).last(last).high(high).low(low).bid(buy).ask(sell).volume(volume).build();
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy