Login Page - Create Account

Support Board


Date/Time: Thu, 28 Nov 2024 08:28:47 +0000



[User Discussion] - Custom Study access to Historical Market Depth

View Count: 653

[2023-04-28 16:04:20]
sola5180 - Posts: 13
Hi,

Is it possible to get Market Depth data (specifically, pull/stack) not just by price (on the latest bar) but on past bars?

I am developing a simple Custom Study that plots the Pull/Stack imbalance as a zero-referenced difference.

However, I'm never able to see any data prior to current activity.

When running a replay, I am able to generate historical plots which leads me to believe there is a way to generate it programatically.

Current code:

double sumB;
  double sumA;
  double avg;
    
sumA = sc.GetAskMarketDepthStackPullSum();
sumB = sc.GetBidMarketDepthStackPullSum();
  avg = (sumA + sumB) / 2;
  sumA = sumA - avg;
  sumB = sumB - avg;
  
  int start = sc.Index;

  
  Bid.Data[start] = sumB ;
  Ask.Data[start] = sumA ;
  BidL.Data[start] = sumB ;
  AskL.Data[start] = sumA ;



Thanks
Date Time Of Last Edit: 2023-04-28 16:05:28
[2023-05-01 13:04:13]
sola5180 - Posts: 13
Are you actively supporting your product, or no? If not, I will have to find alternate ways to make progress.

I hope we can have a more active discussion than this when encountering issues.

I currently have some other observations that point to issues in the tool but am not sure if you're willing to engage.

Thanks
[2023-05-01 17:16:22]
John - SC Support - Posts: 36350
As a general rule we do not give support for Programming issues. This thread has been set as "Programming Help", which means that we will not respond, but other community members may offer their help.
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2023-05-01 17:19:43]
sola5180 - Posts: 13
John,

My question is a question about your API.

Do you not provide feedback on such questions as I have asked?
[2023-05-13 14:30:58]
sola5180 - Posts: 13
I have set the type to "User Discussion". Will you respond now? Is it so difficult to give a little guidance to those who want to use your ACSIL API?
Date Time Of Last Edit: 2023-05-13 14:32:06
[2023-05-13 15:10:56]
User431178 - Posts: 544
Is it possible to get Market Depth data (specifically, pull/stack)
Not pull/stack data you would have to calculate it yourself.

When running a replay, I am able to generate historical plots which leads me to believe there is a way to generate it programatically.
Because in replay the values are being generated as equivalent real time, there is not a built in way to generate pull/stack programatically.

You can access the historical depth - ACSIL Interface Members - Historical Market Depth Data (c_ACSILDepthBars)
or read the depth file directly yourself - Market Depth Data File Format

You can read the intraday data file - sc.ReadIntradayFileRecordAtIndex()
or read the data file yourself - Intraday Data File Format

The information is available for anyone to find.
[2023-05-13 17:27:25]
sola5180 - Posts: 13
<<The information is available for anyone to find.

I'm not stupid, or failing to read the documentation, this just isn't that straightforward to someone new to the API, ok?

Can you provide the code for sc.GetAskMarketDepthStackPullSum() so that I can accurately recreate it on the historical data? It must be doing something very similar.

Or, confirm that this is the appropriate usage of c_ACSILDepthBars:

GetLastBidQuantity --> At each bar, for N Tick levels calculate the sum of current bids
GetLastAskQuantity --> At each bar, for N Tick levels get the sum of current asks

Then continually compare sums between current bar and last bar? Will this give the same result as the GetAskMarketDepthStackPullSum()

Alternately, you could provide a simple pseudo code that depicts the high level calculations done in GetAskMarketDepthStackPullSum(). I really don't want to waste my time guessing and checking for hours.

Thanks
[2023-05-13 18:12:05]
sola5180 - Posts: 13
By the way, I have read through Global Trade Settings Windows: Bid Market Depth Pulling/Stacking - Left/Center/Right Aligned summary.

It seems like the GetAskMarketDepthStackPullSum() also takes into consideration the volume traded at the bid and ask for the duration of the bid and ask not changing.

That doesn't seem like something that the c_ACSILDepthBars handles, especially given that the best bid and offer may change and probably will not stay stable throughout the entire bar.

So - I would have to look at the tick level data to see when, for the current bar close, was the last transition to the closing bid and offer, and calculate the bid & ask volume from that point on, in order to get a similar calcucation as to GetAskMarketDepthStackPullSum()

I'm also not sure how to differentiate between limit orders being pulled vs. executed via the market order using this API. It seems likely to 'double count' pulling if one were to look at them independently. Especially if you were to look at the 'max' and 'last' and calculate the difference as the pulling or stacking.

This would be much easier if the API offered a function like GetHistoricalAskMarketDepthStackPullSum() for populating past chart bars.

I dont think this is very trivial, but this functionality is important and accurately graphing this is very valuable.
Date Time Of Last Edit: 2023-05-13 18:12:50
[2023-05-13 18:24:25]
User431178 - Posts: 544
Let me preface this by pointing out that I am not SC support.

That doesn't seem like something that the c_ACSILDepthBars handles
Yes, this is true, my intention was to show you links to what was possible.
This is also why I follwed each link with another link to the file formats for depth and intraday data.

You are also right when you say it is not a trivial task.
Date Time Of Last Edit: 2023-05-13 18:25:06
[2023-05-13 18:33:59]
sola5180 - Posts: 13
Thanks for the inputs!

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

Login

Login Page - Create Account