Get a full snapshot and/or use incremental updates...

Created at 21 Dec 2017, 13:23
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
SV

svanharmelen

Joined 20.12.2017

Get a full snapshot and/or use incremental updates...
21 Dec 2017, 13:23


So I'm trying to gether all the market data and I noticed 2 things...

1. The docs talk about message type W (snapshot/full refresh), but I'm unable to receive those. I can only get X messages (incremental refresh) instead. Is that expected? Or do I use a wron combination and should it be posible?

2. When using the incremental refresh messages, how do I get the inital state of affairs? As in, against what starting point should I apply the incremental updates?

Thanks! 


@svanharmelen
Replies

PanagiotisCharalampous
21 Dec 2017, 16:54

Hi svanharmelen,

Can you please send me message you are sending as well as the ones you are receiving so that I can have a look?

Best Regards

Panagiotis


@PanagiotisCharalampous

svanharmelen
21 Dec 2017, 17:00

Sure thing...

Request:

8=FIX.4.49=14135=V34=249=icmarkets.xxxxxxxxx=QUOTE52=20171221-14:26:12.16556=cServer57=QUOTE146=155=1262=xxxx263=1264=0265=0267=2269=0269=110=137

Responses:

8=FIX.4.49=41735=X34=249=cServer50=QUOTE52=20171221-14:26:12.18856=icmarkets.xxxxxxxxx=QUOTE268=6279=0269=1278=17818100655=1270=1.18603271=8000000279=0269=1278=17818100755=1270=1.18602271=1500000279=0269=1278=17818101055=1270=1.18601271=100000279=0269=0278=17818100555=1270=1.18601271=100000279=0269=0278=17818100455=1270=1.186271=4500000279=0269=0278=17818100355=1270=1.18599271=500000010=103

8=FIX.4.49=35535=X34=349=cServer50=QUOTE52=20171221-14:26:12.27056=icmarkets.xxxxxxxxx=QUOTE268=7279=0269=0278=17818224655=1270=1.18601271=4500000279=0269=0278=17818224455=1270=1.18602271=100000279=0269=1278=17818224855=1270=1.18602271=1600000279=2278=17818100555=1279=2278=17818100455=1279=2278=17818101055=1279=2278=17818100755=110=068

And of course more of these follow...

Thanks,

Sander

 


@svanharmelen

svanharmelen
21 Dec 2017, 17:03

And if I try it with 263=0 I get this:

Request:

8=FIX.4.49=14135=V34=249=icmarkets.xxxxxxxxx=QUOTE52=20171220-16:58:44.32956=cServer57=QUOTE146=155=1262=xtdr263=0264=0265=0267=2269=0269=110=149

Response:

8=FIX.4.49=16335=Y34=249=cServer50=QUOTE52=20171220-16:58:44.34456=icmarkets.xxxxxxxxx=QUOTE58=INVALID_REQUEST: Unsupported SubscriptionRequestType(263)=0262=xxxx281=410=189

Thanks...

 


@svanharmelen

#EOL
21 Dec 2017, 17:34

Take a look into section "6.3. Market Data Request" of the spec

It seems, you can subscribe for full refresh (type W) only for spots (top of the book)

For full book only incremental refresh is supported. With the first response message you should receive initial full book snapshot and with the next ones you should receive incremental refreshes.

Here is the same example in FIX parcer: https://goo.gl/QxPbqR

Just after subscription server responds with a set of quotes with IDs, stored in tag 278 (MDEntryID). All they are new (MDUpdateAction tag 279 is 0) and should be stored somehow in your application

Next message contains some new quotes (tag 279 is 0) and MDEntryIDs of previous quotes that are no longer valid (tag 279 is 2). So you should add new quotes and delete outdated quotes from your application


@#EOL

svanharmelen
21 Dec 2017, 18:02

RE:

#EOL said:

Take a look into section "6.3. Market Data Request" of the spec

It seems, you can subscribe for full refresh (type W) only for spots (top of the book)

Ah... I think I missed the part about the spots... Using 264=1 indeed makes the W messages work :)

For full book only incremental refresh is supported. With the first response message you should receive initial full book snapshot and with the next ones you should receive incremental refreshes.

Cool, my question was indeed about the initial book to start with. So if you can confirm that the initial response contains the current book (with max depth of 4 or 5 I believe, but that's fine), then I'm all good to go.

Thanks for your reaction #EOL!

 


@svanharmelen

#EOL
27 Dec 2017, 14:39

RE: RE:

svanharmelen said:

So if you can confirm that the initial response contains the current book 

Indeed

svanharmelen said:

the initial response contains the current book (with max depth of 4 or 5 I believe

You should receive full book without any depth limitation


@#EOL

#EOL
27 Dec 2017, 14:42

RE: RE: RE:

#EOL said:

You should receive full book without any depth limitation

I mean the full book that is stored on a server. The same book you can see in cTrader desktop application

Not the global-world true-ECN book with five hundred tiers on each side


@#EOL

svanharmelen
27 Dec 2017, 15:04

Yeah of course, that makes sense ;)

I came to the same conclusion after some random testing, but still thanks for the confirmation #EOL! 

 


@svanharmelen