public static Builder from(UserTrade trade) { return new Builder() .type(trade.getType()) .originalAmount(trade.getOriginalAmount()) .currencyPair(trade.getCurrencyPair()) .price(trade.getPrice()) .timestamp(trade.getTimestamp()) .id(trade.getId()) .orderId(trade.getOrderId()) .feeAmount(trade.getFeeAmount()) .feeCurrency(trade.getFeeCurrency()); }
private static LimitOrder createOrder( CurrencyPair currencyPair, Order.OrderType orderType, BigDecimal originalAmount, BigDecimal limitPric) { return new LimitOrder(orderType, originalAmount, currencyPair, "", null, limitPric); }
private static LimitOrder withAmount(LimitOrder limitOrder, BigDecimal tradeableAmount) { OrderType type = limitOrder.getType(); CurrencyPair currencyPair = limitOrder.getCurrencyPair(); String id = limitOrder.getId(); Date date = limitOrder.getTimestamp(); BigDecimal limit = limitOrder.getLimitPrice(); return new LimitOrder(type, tradeableAmount, currencyPair, id, date, limit); }
public static LimitOrder adaptOrder( CoinEggOrder order, OrderType type, CurrencyPair currencyPair) { BigDecimal quantity = order.getQuantity(); BigDecimal price = order.getPrice(); LimitOrder limitOrder = new LimitOrder.Builder(type, currencyPair) .originalAmount(quantity) .limitPrice(price) .build(); return limitOrder; }
@Override public UserTrade build() { return new UserTrade( type, originalAmount, currencyPair, price, timestamp, id, orderId, feeAmount, feeCurrency); } }
public MarketOrder build() { MarketOrder order = new MarketOrder( orderType, originalAmount, currencyPair, id, timestamp, averagePrice, cumulativeAmount, fee, status); order.setOrderFlags(flags); return order; } }
private static void generic(TradeService tradeService) throws IOException, InterruptedException { List<LimitOrder> limitOrders = tradeService.getOpenOrders().getOpenOrders(); for (LimitOrder temp : limitOrders) { System.out.println(temp.toString()); } } }
@Override public int compareTo(FloatingRateLoanOrder order) { return this.getDayPeriod() - order.getDayPeriod(); } }
public List<UserTrade> getUserTrades() { return (List) getTrades(); } }
public static LimitOrder adaptOrder( BigDecimal amount, BigDecimal price, CurrencyPair currencyPair, OrderType orderType, String id) { // place a limit order return new LimitOrder(orderType, amount, currencyPair, "", null, price); }
public static LimitOrder adaptOrders( BigDecimal amount, BigDecimal price, CurrencyPair currencyPair, OrderType orderType, String id) { return new LimitOrder(orderType, amount, currencyPair, id, null, price); }
private static LimitOrder adaptLimitOrder( Order.OrderType type, BigDecimal[] data, CurrencyPair currencyPair, String id, Date timestamp) { return new LimitOrder(type, data[1], currencyPair, id, timestamp, data[0]); } }
private static LimitOrder adaptOrder( BigDecimal amount, BigDecimal price, CurrencyPair currencyPair, String orderId, OrderType orderType, Date timestamp) { return new LimitOrder(orderType, amount, currencyPair, orderId, timestamp, price); }
public static LimitOrder adaptOrder( BigDecimal amount, BigDecimal price, CurrencyPair currencyPair, OrderType orderType, Date timestamp) { return new LimitOrder(orderType, amount, currencyPair, "", timestamp, price); }
public static LimitOrder adaptOrder( BigDecimal originalAmount, BigDecimal price, CurrencyPair currencyPair, OrderType orderType, Date timestamp) { return new LimitOrder(orderType, originalAmount, currencyPair, "", timestamp, price); }
private static LimitOrder adaptLimitOrder( BigDecimal[] order, CurrencyPair currencyPair, OrderType type) { return new LimitOrder(type, order[1], currencyPair, null, null, order[0]); }
public static LimitOrder createOrder( CurrencyPair currencyPair, BigDecimal[] priceAndAmount, OrderType orderType) { return new LimitOrder(orderType, priceAndAmount[1], currencyPair, "", null, priceAndAmount[0]); }
private static LimitOrder adaptLimitOrder( OrderType type, BigDecimal[] data, CurrencyPair currencyPair, String id, Date timestamp) { return new LimitOrder(type, data[1], currencyPair, id, timestamp, data[0]); }
public static LimitOrder adaptOrder( BigDecimal amount, BigDecimal price, CurrencyPair currencyPair, String orderTypeString, String id) { OrderType orderType = orderTypeString.equalsIgnoreCase("bid") ? OrderType.BID : OrderType.ASK; return new LimitOrder(orderType, amount, currencyPair, id, null, price); }
public static LimitOrder createOrder( CurrencyPair currencyPair, List<BigDecimal> priceAndAmount, Order.OrderType orderType) { return new LimitOrder( orderType, priceAndAmount.get(1), currencyPair, "", null, priceAndAmount.get(0)); }