MultiBitExchange icon indicating copy to clipboard operation
MultiBitExchange copied to clipboard

can market order exist in order book?

Open wanghhao opened this issue 6 years ago • 1 comments

private Optional<Trade> tryToTrade(Order order, Order bestCounterOrder) { if (bestCounterOrder.isLimitOrder()) { LimitOrder bestCounterLimitOrder = (LimitOrder) bestCounterOrder; ItemPrice limitPrice = bestCounterLimitOrder.getLimitPrice(); if (order.crossesAt(limitPrice)) { Trade trade = createTrade(order, bestCounterOrder, limitPrice); return Optional.of(trade); } } return Optional.absent(); }

The code imply there is no market book in order book.

wanghhao avatar Jun 28 '18 02:06 wanghhao

if a market order want to buy 300, there is only 200 in counter order book, how to save the remaining 100 in order book? because it don't have a price, I suggest that use null as key to save market order, the process of match is: firstly match with key is null ones, then the top order.

wanghhao avatar Jun 29 '18 08:06 wanghhao