Examples of Trade


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

    return new Trades(trades, TradeSortType.SortByTimestamp);
  }

  public static Trade adaptPublicTrade(final CurrencyPair currencyPair, final MintPalPublicTrade mintPalTrade) {

    return new Trade(mintPalTrade.getType().equalsIgnoreCase("buy") ? OrderType.BID : OrderType.ASK, mintPalTrade.getAmount(), currencyPair, mintPalTrade.getPrice(), mintPalTrade.getTime(), null);
  }
View Full Code Here

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

    Trades tradeHistory = marketDataService.getTrades(CurrencyPair.BTC_CNY);
    System.out.println(tradeHistory);

    List<Trade> trades = tradeHistory.getTrades();
    if (trades.size() > 1) {
      Trade trade = trades.get(trades.size() - 2);
      tradeHistory = marketDataService.getTrades(CurrencyPair.BTC_CNY, Long.valueOf(trade.getId()));
      System.out.println(tradeHistory);
    }
  }
View Full Code Here

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

      @Override
      public void onEvent(String channelName, String eventName, String data) {

        ExchangeEvent xevt = null;
        try {
          Trade t = parseTrade(data);
          xevt = new DefaultExchangeEvent(ExchangeEventType.TRADE, data, t);
        } catch (IOException e) {
          log.error("JSON stream error", e);
        }
        if (xevt != null) {
View Full Code Here

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

    String tradableIdentifier = bTCETrade.getTradeableIdentifier();
    CurrencyPair currencyPair = new CurrencyPair(tradableIdentifier, currency);
    Date date = DateUtils.fromMillisUtc(bTCETrade.getDate() * 1000L);

    final String tradeId = String.valueOf(bTCETrade.getTid());
    return new Trade(orderType, amount, currencyPair, price, date, tradeId);
  }
View Full Code Here

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

    BigDecimal amount = bTCETrade.getAmount();
    BigDecimal price = bTCETrade.getPrice();
    Date date = DateUtils.fromMillisUtc(bTCETrade.getDate() * 1000L);

    final String tradeId = String.valueOf(bTCETrade.getTid());
    return new Trade(orderType, amount, currencyPair, price, date, tradeId);
  }
View Full Code Here

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

    assertThat(adaptedTrades.getlastID()).isEqualTo(0);
    assertThat(adaptedTrades.getTradeSortType()).isEqualTo(TradeSortType.SortByTimestamp);
    final List<Trade> tradesList = adaptedTrades.getTrades();
    assertThat(tradesList).hasSize(2);

    final Trade trade = tradesList.get(0);
    assertThat(trade.getTimestamp().getTime()).isEqualTo(1405056569000L);
    assertThat(trade.getType()).isEqualTo(OrderType.ASK);
    assertThat(trade.getPrice()).isEqualTo("0.00000004");
    assertThat(trade.getTradableAmount()).isEqualTo("2299494.19282106");
    assertThat(trade.getCurrencyPair()).isEqualTo(CurrencyPair.LTC_BTC);
  }
View Full Code Here

Examples of controller.commands.Trade

  public void actionPerformed(ActionEvent e) {
    //Should display all item to screen.
    //Player will click item from screen and then return the number of item.
    Character ally = map.getSelectedAlly();
    Character tradeToAlly = map.getTradeOrHealAlly();
    Trade trading = new Trade();
    trading.execute(ally, tradeToAlly);
  }
View Full Code Here

Examples of org.apache.openjpa.trader.domain.Trade

        return t;
    }

    @Override
    public Trade trade(Match match) {
        Trade trade = new Trade(match.getAsk(), match.getBid());
        return trade;
    }
View Full Code Here

Examples of org.apache.openjpa.trader.domain.Trade

     * Because an instance display either the Trades sold or bought.
     * If relevant then updates the display.
     */
    public void onTradeCommitted(ServiceEvent.TradeCommitted event) {
        Trader trader = session.getTrader();
        Trade trade = event.getPayload();
        if ((trader.equals(trade.getSeller()) && _type == Ask.class)
         || (trader.equals(trade.getBuyer())  && _type == Bid.class)) {  
            insert(trade);
        }
    }
View Full Code Here

Examples of org.apache.openjpa.trader.domain.Trade

    public Trade trade(Match match) {
        EntityManager em = getEntityManager();
        begin();
        Ask ask = em.merge(match.getAsk());
        Bid bid = em.merge(match.getBid());
        Trade trade = new Trade(ask, bid);
        em.persist(trade);
        commit();
        return trade;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.