Package com.xeiam.xchange.dto.trade

Examples of com.xeiam.xchange.dto.trade.UserTrades


    final List<UserTrade> openOrders = new ArrayList<UserTrade>();
    for (final JustcoinTrade justcoinOrder : justoinOrders) {
      openOrders.add(adaptTrade(justcoinOrder));
    }

    return new UserTrades(openOrders, TradeSortType.SortByID);
  }
View Full Code Here


      final BigDecimal amount = order.getUnits().getValue();
      final BigDecimal feeAmount = order.getFee().getValue();
      trades.add(new UserTrade(orderType, amount, currPair, price, timestamp, orderId, orderId, feeAmount, currPair.counterSymbol));
    }

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

      for (PoloniexUserTrade poloniexUserTrade : poloniexUserTrades) {
        trades.add(PoloniexAdapters.adaptPoloniexUserTrade(poloniexUserTrade, currencyPair));
      }
    }

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

    List<UserTrade> trades = new ArrayList<UserTrade>();
    for (Entry<String, KrakenTrade> krakenTradeEntry : krakenTrades.entrySet()) {
      trades.add(adaptTrade(krakenTradeEntry.getValue(), krakenTradeEntry.getKey()));
    }

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

          Long.toString(t.getOriginalOrderId()), t.getFee(), counter);

      trades.add(trade);
    }

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

    ObjectMapper mapper = new ObjectMapper();
    KrakenTradeHistoryResult krakenResult = mapper.readValue(is, KrakenTradeHistoryResult.class);
    KrakenTradeHistory krakenTradeHistory = krakenResult.getResult();
    Map<String, KrakenTrade> krakenTradeHistoryMap = krakenTradeHistory.getTrades();

    UserTrades trades = KrakenAdapters.adaptTradesHistory(krakenTradeHistoryMap);
    List<UserTrade> tradeList = trades.getUserTrades();

    assertThat(tradeList.size()).isEqualTo(1);
    UserTrade trade = tradeList.get(0);
    assertThat(trade.getId()).isEqualTo("TY5BYV-WJUQF-XPYEYD");
    assertThat(trade.getPrice()).isEqualTo(new BigDecimal("32.07562"));
View Full Code Here

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

    UserTrades trades = CryptoTradeAdapters.adaptTrades(tradeHistory);

    assertThat(trades.getlastID()).isEqualTo(17);
    assertThat(trades.getTrades()).hasSize(2);

    UserTrade trade = trades.getUserTrades().get(1);
    assertThat(trade.getPrice()).isEqualTo("128");
    assertThat(trade.getType()).isEqualTo(OrderType.ASK);
    assertThat(trade.getTimestamp()).isEqualTo(new Date(1370965122));
    assertThat(trade.getTradableAmount()).isEqualTo("0.1");
    assertThat(trade.getId()).isEqualTo("17");
View Full Code Here

      OrderType orderType = trade.getType().equalsIgnoreCase("buy") ? OrderType.BID : OrderType.ASK;
      Date timestamp = convertBigDecimalTimestampToDate(trade.getTimestamp());
      pastTrades.add(new UserTrade(orderType, trade.getAmount(), currencyPair, trade.getPrice(), timestamp, trade.getTradeId(), trade.getOrderId(), trade.getFeeAmount(), trade.getFeeCurrency()));
    }

    return new UserTrades(pastTrades, TradeSortType.SortByTimestamp);
  }
View Full Code Here

        lastTradeId = tradeId;
      UserTrade trade = adaptTrade(cryptoTradeTrade);
      tradeList.add(trade);
    }

    return new UserTrades(tradeList, lastTradeId, TradeSortType.SortByTimestamp);
  }
View Full Code Here

    for (ANXTradeResult tradeResult : anxTradeResults) {
      trades.add(adaptUserTrade(tradeResult));
    }

    long lastId = trades.size() > 0 ? anxTradeResults[0].getTimestamp().getTime() : 0L;
    return new UserTrades(trades, lastId, TradeSortType.SortByTimestamp);
  }
View Full Code Here

TOP

Related Classes of com.xeiam.xchange.dto.trade.UserTrades

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.