How to get BTCChina full Orderbook (FIX or alt API)

3

I have worked through BTCChina's FIX APi (using their java example). Creating a subscription request message such as:

public static Message marketDataIncrementalRequest(String symbol) {
    quickfix.fix44.MarketDataRequest tickerRequest = new quickfix.fix44.MarketDataRequest();

    quickfix.fix44.MarketDataRequest.NoRelatedSym noRelatedSym = new quickfix.fix44.MarketDataRequest.NoRelatedSym();
    noRelatedSym.set(new Symbol(symbol));
    tickerRequest.addGroup(noRelatedSym);

    tickerRequest.set(new MDReqID("123"));      
    tickerRequest.set(new SubscriptionRequestType('1'));
    tickerRequest.set(new MarketDepth(0));

    addMDType(tickerRequest, '0');
    addMDType(tickerRequest, '1');
    addMDType(tickerRequest, '2');

    return tickerRequest;
}

The above message request is documented to provide full orderbook + trades snapshot + incremental refresh. Unfortunately it just provides top-of-book with no sizes + trades with no size. I suspect their FIX server implementation is not complete. The same standard FIX message on OKCoin, works fine, providing full book.

The alternative API via websockets provides a call to get depth of book, however, according to documentation only provides 5 levels.

Various real-time OB viewers are showing deeper-than-5 depth, so assume there is an API for this. Can anyone point me in the right direction?

Jonathan Shore

Posted 2015-02-08T01:23:42.250

Reputation: 173

Have you got this to work using FIX? I have the same problem.James Moore 2015-02-18T18:39:11.027

No, unfortunately not. BTC China seems to be ignoring it. Their web socket API may provide a reasonable alternative. I have not looked at it yet.Jonathan Shore 2015-02-18T22:19:39.520

1Ended up using their REST API and polling periodically (why do bitcoin exchanges use something so inefficient, very poor design).Jonathan Shore 2015-03-02T15:03:45.570

No answers