TimeUnit.MILLISECONDS.sleep((startTime + 500) - System.currentTimeMillis());
} catch (InterruptedException e) {
}
// send two orders, that will (partially) fulfill each other, to generate a trade.
LimitOrder buyLimitOrder = new LimitOrder(OrderType.BID, new BigDecimal(1), new CurrencyPair("BTC", "GBP"), null, null, new BigDecimal(3.20));
resultMap = ((CoinfloorStreamingExchangeService) streamingExchangeService).placeOrder(buyLimitOrder).getPayload();
System.out.println("\n\n\n\n\nBuy Limit Order Placed: ");
System.out.println("Raw Object: " + resultMap.get("raw"));
System.out.println("Generic Object: " + resultMap.get("generic"));
try {
TimeUnit.MILLISECONDS.sleep(1000);
} catch (InterruptedException e) {
}
// check for new balance before submitting second order
System.out.println("\n\n\n\n\nCached Account Info: ");
System.out.println(((CoinfloorStreamingExchangeService) streamingExchangeService).getCachedAccountInfo());
LimitOrder sellLimitOrder = new LimitOrder(OrderType.ASK, new BigDecimal(1.52321512784), new CurrencyPair("BTC", "GBP"), null, null, new BigDecimal(3.19));
resultMap = ((CoinfloorStreamingExchangeService) streamingExchangeService).placeOrder(sellLimitOrder).getPayload();
System.out.println("\n\n\n\n\nSell Limit Order Placed: ");
System.out.println("Raw Object: " + resultMap.get("raw"));
System.out.println("Generic Object: " + resultMap.get("generic"));
try {
TimeUnit.MILLISECONDS.sleep(1000);
} catch (InterruptedException e) {
}
// check for new balance again
System.out.println("\n\n\n\n\nCached Account Info: ");
System.out.println(((CoinfloorStreamingExchangeService) streamingExchangeService).getCachedAccountInfo());
// then send another order, that will never be fulfilled
LimitOrder bigLimitOrder = new LimitOrder(OrderType.ASK, new BigDecimal(1.152), new CurrencyPair("BTC", "GBP"), null, null, new BigDecimal(500));
resultMap = ((CoinfloorStreamingExchangeService) streamingExchangeService).placeOrder(bigLimitOrder).getPayload();
System.out.println("\n\n\n\n\nBig Limit Order Placed: ");
System.out.println("Raw Object: " + resultMap.get("raw"));
System.out.println("Generic Object: " + resultMap.get("generic"));
try {