public static Ticker adaptTicker ( MercadoBitcoinTicker mercadoBitcoinTicker , CurrencyPair currencyPair ) { BigDecimal last = mercadoBitcoinTicker . getTicker ( ) . getLast ( ) ; BigDecimal bid = mercadoBitcoinTicker . getTicker ( ) . getBuy ( ) ; BigDecimal ask = mercadoBitcoinTicker . getTicker ( ) . getSell ( ) ; BigDecimal high = mercadoBitcoinTicker . getTicker ( ) . getHigh ( ) ; BigDecimal low = mercadoBitcoinTicker . getTicker ( ) . getLow ( ) ; BigDecimal volume = mercadoBitcoinTicker . getTicker ( ) . getVol ( ) ; Date timestamp = new Date ( mercadoBitcoinTicker . getTicker ( ) . getDate ( ) * 1000L ) ; return new Ticker . Builder ( ) . currencyPair ( currencyPair ) . last ( last ) . bid ( bid ) . ask ( ask ) . high ( high ) . low ( low ) . volume ( volume ) . timestamp ( timestamp ) . build ( ) ; }
Adapts a MercadoBitcoinTicker to a Ticker Object