Package com.xeiam.xchange.dto.marketdata

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


      if (tradeId > lastTradeId)
        lastTradeId = tradeId;
      trades.add(adaptPublicTrade(currencyPair, trade));
    }

    return new Trades(trades, lastTradeId, TradeSortType.SortByID);
  }
View Full Code Here


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

    // Use Jackson to parse it
    ObjectMapper mapper = new ObjectMapper();
    JavaType type = mapper.getTypeFactory().constructParametricType(VosResponse.class, VosTrade[].class);
    VosResponse<VosTrade[]> vosTrades = mapper.readValue(is, type);

    Trades trades = VaultOfSatoshiAdapters.adaptTrades(vosTrades.getData(), CurrencyPair.BTC_USD);
    assertThat(trades.getTrades().size()).isEqualTo(2);

    // Verify all fields filled
    assertThat(trades.getTrades().get(0).getPrice()).isEqualTo("641.17165850");
    assertThat(trades.getTrades().get(0).getTradableAmount()).isEqualTo(".25000000");
    assertThat(trades.getTrades().get(0).getCurrencyPair().baseSymbol == "BTC");
    assertThat(trades.getlastID()).isEqualTo(294649);
    assertThat(DateUtils.toUTCString(trades.getTrades().get(0).getTimestamp())).isEqualTo("2014-06-21 01:06:53 GMT");
  }
View Full Code Here

      poloniexPublicTrades = getPoloniexPublicTrades(currencyPair);
    }
    else {
      poloniexPublicTrades = getPoloniexPublicTrades(currencyPair, startTime, endTime);
    }
    Trades trades = PoloniexAdapters.adaptPoloniexPublicTrades(poloniexPublicTrades, currencyPair);
    return trades;
  }
View Full Code Here

    List<Trade> trades = new ArrayList<Trade>();
    for (KrakenPublicTrade krakenTrade : krakenTrades) {
      trades.add(adaptTrade(krakenTrade, currencyPair));
    }

    return new Trades(trades, last, TradeSortType.SortByTimestamp);
  }
View Full Code Here

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

    Trades trades = VirtExAdapters.adaptTrades(VirtExTrades.getTrades(), CurrencyPair.BTC_CAD);
    assertThat(trades.getTrades().size()).isEqualTo(632);

    // Verify all fields filled
    assertThat(trades.getTrades().get(0).getPrice().doubleValue() == 545.060000000);
    assertThat(trades.getTrades().get(0).getTradableAmount().doubleValue() == 1.189100000);
    assertThat(trades.getTrades().get(0).getCurrencyPair().baseSymbol == "BTC");
    assertThat(DateUtils.toUTCString(trades.getTrades().get(0).getTimestamp())).isEqualTo("2014-05-21 20:45:15 GMT");
  }
View Full Code Here

    // Use Jackson to parse it
    ObjectMapper mapper = new ObjectMapper();
    VirtExTrade[] VirtExTrades = mapper.readValue(is, VirtExTrade[].class);

    Trades trades = VirtExAdapters.adaptTrades(VirtExTrades, CurrencyPair.BTC_CAD);
    assertThat(trades.getTrades().size()).isEqualTo(558);

    // Verify all fields filled
    assertThat(trades.getTrades().get(0).getPrice().doubleValue() == 11.500000000);
    assertThat(trades.getTrades().get(0).getTradableAmount().doubleValue() == 13.000000000);
    assertThat(trades.getTrades().get(0).getCurrencyPair().baseSymbol == "BTC");
    assertThat(DateUtils.toUTCString(trades.getTrades().get(0).getTimestamp())).isEqualTo("2012-09-26 15:23:19 GMT");
  }
View Full Code Here

        lastTradeId = longTradeId;
      Trade trade = new Trade(null, amount, currencyPair, price, timestamp, tid);
      trades.add(trade);
    }

    return new Trades(trades, lastTradeId, Trades.TradeSortType.SortByTimestamp);
  }
View Full Code Here

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

    Trades trades = KrakenAdapters.adaptTrades(krakenTrades.getResult().getTrades(), CurrencyPair.BTC_USD, krakenTrades.getResult().getLast());

    Assert.assertEquals(14, trades.getTrades().size());
    assertThat(trades.getTrades().get(0).getPrice()).isEqualTo("1023.82219");
    assertThat(trades.getTrades().get(0).getType()).isEqualTo(OrderType.ASK);
    assertThat(trades.getTrades().get(0).getTimestamp()).isEqualTo(new Date(1385579841777L));
    assertThat(trades.getTrades().get(1).getTradableAmount()).isEqualTo("0.01500000");
    assertThat(trades.getlastID()).isEqualTo(1385579841881785998L);

  }
View Full Code Here

    List<Trade> tradesList = new ArrayList<Trade>();
    for (VirtExTrade virtexTrade : virtexTrades) {
      tradesList.add(adaptTrade(virtexTrade, currencyPair));
    }
    return new Trades(tradesList, TradeSortType.SortByID);
  }
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.