Login Page - Create Account

Support Board


Date/Time: Sat, 31 Jan 2026 20:31:52 +0000



[Programming Help] - GetBidMarketDepthEntryAtLevel returns 0 Quantity (Sim/BitMEX)

View Count: 28

[2026-01-31 13:21:52]
Naqh - Posts: 1
I am writing a custom study to process market depth data on XBTUSD-BMEX (Free Trial).

The DOM window correctly shows quantities (e.g., 500 volume). However, when I access the data programmatically, sc.GetBidMarketDepthEntryAtLevel returns true and the correct Price, but returns 0 for Quantity.

I have confirmed:

sc.UsesMarketDepthData = 1 is set.

Chart Settings > "Use Market Depth Data" is checked.

sc.MaintainAdditionalChartDataArrays = 1 is set (tried this as well).

Is there a specific setting required to read depth quantity programmatically, or is this a limitation of the simulated data feed?

C++
// Code Snippet
if (sc.Index == sc.ArraySize - 1) {
s_MarketDepthEntry depth;
if(sc.GetBidMarketDepthEntryAtLevel(depth, 0)) {
// Returns Price=82748.1 (Correct), Quantity=0 (Incorrect)
SCString msg;
msg.Format("Price=%.2f, Qty=%d", depth.Price, depth.Quantity);
sc.AddMessageToLog(msg, 0);
}
}

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

Login

Login Page - Create Account