use of org.knowm.xchange.bitstamp.BitstampV2 in project XChange by knowm.
the class BitstampTradeService method getOpenOrders.
@Override
public OpenOrders getOpenOrders(OpenOrdersParams params) throws ExchangeException, IOException {
BitstampOrder[] openOrders = getBitstampOpenOrders();
List<LimitOrder> limitOrders = new ArrayList<>(openOrders.length);
for (BitstampOrder bitstampOrder : openOrders) {
OrderType orderType = bitstampOrder.getType() == 0 ? OrderType.BID : OrderType.ASK;
String id = Long.toString(bitstampOrder.getId());
BigDecimal price = bitstampOrder.getPrice();
limitOrders.add(new LimitOrder(orderType, bitstampOrder.getAmount(), new BitstampV2.Pair(bitstampOrder.getCurrencyPair()).pair, id, bitstampOrder.getDatetime(), price, // avgPrice
null, // cumAmount
null, // fee
null, Order.OrderStatus.NEW));
}
return new OpenOrders(limitOrders);
}
Aggregations