Login Page - Create Account

Support Board


Date/Time: Sun, 08 Sep 2024 00:21:04 +0000



[Programming Help] - .depth Files Clarification

View Count: 165

[2024-06-25 14:09:39]
skalaydzhiyski - Posts: 41
Hi guys, I am currently getting external historical MBO data and encoding it in .depth files. Everything seems to work fine when it comes to Sierra and I can replay days as far back as 2017 in the DOM.

So far so good apart from my paranoia about the static const uint8_t FLAG_END_OF_BATCH = 0x01 flag...

Can someone please explain what is meant by Batch here and what is the significance of a batch ?

I am currently doing the following to generate the .depth file.

1. Generate .scid file with Trades from my external provider
2. Create a pandas dataframe and Add 1 row of CLEAR_BOOK command
3. Add ADD_BID/ADD_ASK 200 rows (1 for each level, 100 bid and 100 ask levels)
4. From here on I have noticed Sierra's depth files have timestamp resolution of a millisecond, so I append to the dataframe in the following manner:
I get the diff between book state (external) for timestamp 3902734068951000 (for example) and timestamp 3902734068952000, for all prices not found in the first but found in the second - ADD_BID/ASK, for all prices found in the first but not found in the second, CANCEL_BID/ASK, for all prices found in both - MODIFY.
4. Use this dataframe to encode the .depth file in bytes.

Note for the initial rows (ADDS immediately after CLEAR_BOOK) I have the batch flag set to 0 (replicating what .depth files usually have)
for all the rest I have the flag set to 1.

I know this is a bit of a confusing explanation, but I just need to know more about how the flag might impact my encoding of the files and how this affects Sierra's replays, because I need to be able to trust them...

All the best,
Spas
[2024-06-28 12:39:40]
skalaydzhiyski - Posts: 41
P.S. All sorted. I will write a study for Data Bento one of those days to get depth data back to 2017. Bento + Sierra is a match made in heaven.

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account