Package com.xeiam.xchange.dto.marketdata

Examples of com.xeiam.xchange.dto.marketdata.Trades


    // Use Jackson to parse it
    ObjectMapper mapper = new ObjectMapper();
    CryptsyMarketTradesReturn cryptsyTrades = mapper.readValue(is, CryptsyMarketTradesReturn.class);

    Trades adaptedTrades = CryptsyAdapters.adaptTrades(cryptsyTrades, CurrencyPair.WDC_BTC);

    assertEquals(adaptedTrades.getTrades().size(), cryptsyTrades.getReturnValue().size());
  }
View Full Code Here


    ObjectMapper mapper = new ObjectMapper();
    Map<Integer, CryptsyPublicMarketData> cryptsyMarketData = CryptsyAdapters.adaptPublicMarketDataMap(mapper.readValue(is, CryptsyPublicMarketDataReturn.class).getReturnValue());

    Map<CurrencyPair, Trades> adaptedTradesMap = CryptsyAdapters.adaptPublicTrades(cryptsyMarketData);

    Trades adaptedTrades = adaptedTradesMap.get(CurrencyPair.DOGE_LTC);
    List<Trade> adaptedTradesList = adaptedTrades.getTrades();
    assertThat(adaptedTradesList).hasSize(2);

    Trade adaptedTrade = adaptedTradesList.get(1);
    assertThat(adaptedTrade.getCurrencyPair()).isEqualTo(CurrencyPair.DOGE_LTC);
    assertThat(adaptedTrade.getId()).isEqualTo("47692497");
View Full Code Here

    ObjectMapper mapper = new ObjectMapper();
    Map<Integer, CryptsyPublicMarketData> cryptsyMarketData = CryptsyAdapters.adaptPublicMarketDataMap(mapper.readValue(is, CryptsyPublicMarketDataReturn.class).getReturnValue());

    Map<CurrencyPair, Trades> adaptedTradesMap = CryptsyAdapters.adaptPublicTrades(cryptsyMarketData);

    Trades adaptedTrades = adaptedTradesMap.get(CurrencyPair.FTC_USD);
    List<Trade> adaptedTradesList = adaptedTrades.getTrades();
    assertThat(adaptedTradesList).hasSize(0);
  }
View Full Code Here

    List<Trade> tradesList = new ArrayList<Trade>();
    for (BTCETrade BTCETrade : BTCETrades) {
      // Date is reversed order. Insert at index 0 instead of appending
      tradesList.add(0, adaptTrade(BTCETrade));
    }
    return new Trades(tradesList, TradeSortType.SortByID);
  }
View Full Code Here

      String orderId = String.valueOf(result.getOrderId());
      CurrencyPair currencyPair = new CurrencyPair(pair[0].toUpperCase(), pair[1].toUpperCase());

      trades.add(new Trade(type, tradableAmount, currencyPair, price, timeStamp, tradeId, orderId));
    }
    return new Trades(trades, TradeSortType.SortByTimestamp);
  }
View Full Code Here

      long tradeId = bTCETrade.getTid();
      if (tradeId > lastTradeId)
        lastTradeId = tradeId;
      tradesList.add(0, adaptTrade(bTCETrade, currencyPair));
    }
    return new Trades(tradesList, lastTradeId, TradeSortType.SortByID);
  }
View Full Code Here

      String orderId = String.valueOf(result.getOrderId());
      String tradeId = String.valueOf(entry.getKey());
      CurrencyPair currencyPair = new CurrencyPair(pair[0].toUpperCase(), pair[1].toUpperCase());
      trades.add(new Trade(type, tradableAmount, currencyPair, price, timeStamp, tradeId, orderId));
    }
    return new Trades(trades, TradeSortType.SortByTimestamp);
  }
View Full Code Here

TOP

Related Classes of com.xeiam.xchange.dto.marketdata.Trades

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.