Login Page - Create Account

Support Board


Date/Time: Tue, 16 Apr 2024 18:10:30 +0000



Historical Market Depth Data Recording

View Count: 1930

[2020-01-14 21:02:40]
User41727 - Posts: 124
I am trying to understand how the historical market depth data, as for instance used by the "Bid & Ask Depth Bars" study, is recorded when only L1 data is available, e.g. when using the SC data feed for equities. My assumption was that SC would record the latest bid/ask volume at each level as the L1 quotes become available in order to build up the book data.

Now, I have attempted to recreate that approach by recording sc.BidSize/sc.AskSize for their respective levels. But while the data looks overall reasonably similar, there are usually some discrepancies for each bar between the data collected this way and the data available via the market depth API. The question is why. Do I misunderstand the way SC does collect this data? Is there a way to receive the same data that is saved into as the depth data in real time without having to read from the file and thus avoid the costly I/O? And which set of data is more accurate?

'MaintainAdditionalChartDataArrays' and 'UpdateAlways' are enabled, so this should not be the case that the study is simply not being called when the data changes.
[2020-01-15 19:11:27]
User41727 - Posts: 124
A response would be appreciated.
[2020-01-16 09:29:12]
Sierra Chart Engineering - Posts: 104368
The only way to re-create this is to access the bid and ask updates through the Time and Sales data:
sc.GetTimeAndSales()

But this is only valid in the case of when there is no market depth data and only the top of the book.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2020-01-16 09:29:33
[2020-01-16 17:32:06]
User41727 - Posts: 124
So, the problem is essentially that you do not receive all of the updates, and the only way to mitigate that would be by lowering the chart update interval.

Does sc.GetTimeAndSales() read the data from the respective SCID file, or is this cached in memory somewhere? The reason I am asking is because it seems that the files can sometimes take a bit of time do be updated, at least the .depth files do, which may have something to do with having a large number of charts open that each collect depth data. This regularly creates situations where the calculated value of the "Bid & Ask Depth Bar" study is not correct when calculated in real time, and it changes after recalculation. I had opened a thread about this some months ago, but never really got an answer. Presumably, there is a race going on between the study reading the data and whatever thread is updating the .depth files. Hence, why I am trying to do the entire calculation in memory and avoid reading stale data.

BTW, are you ever going to offer L2 for equities via the SC feed? Not having that data mean flying half blind, although the current solutions seems to work reasonably well.

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

Login

Login Page - Create Account