Package com.xeiam.xchange.hitbtc.dto.trade

Examples of com.xeiam.xchange.hitbtc.dto.trade.HitbtcOwnTrade


  public static UserTrades adaptTradeHistory(HitbtcOwnTrade[] tradeHistoryRaw) {

    List<UserTrade> trades = new ArrayList<UserTrade>(tradeHistoryRaw.length);
    for (int i = 0; i < tradeHistoryRaw.length; i++) {
      HitbtcOwnTrade t = tradeHistoryRaw[i];
      OrderType type = t.getSide().equals("buy") ? OrderType.BID : OrderType.ASK;

      String base = t.getSymbol().substring(0, 3);
      String counter = t.getSymbol().substring(3, 6);

      UserTrade trade = new UserTrade(type, t.getExecQuantity().divide(LOT_MULTIPLIER), new CurrencyPair(base, counter), t.getExecPrice(), new Date(t.getTimestamp()), t.getClientOrderId(),
          Long.toString(t.getOriginalOrderId()), t.getFee(), counter);

      trades.add(trade);
    }

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

TOP

Related Classes of com.xeiam.xchange.hitbtc.dto.trade.HitbtcOwnTrade

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.