Login Page - Create Account

Support Board


Date/Time: Sat, 29 Aug 2026 05:05:46 +0000



[Programming Help] - GetBid/AskMarketLimitOrdersForPrice returns zero in standalone Trade DOM

View Count: 451

[2026-07-14 02:11:42]
User860690 - Posts: 12
We have an ACSIL study using sc.GetBidMarketLimitOrdersForPrice() and sc.GetAskMarketLimitOrdersForPrice(). Native Bid/Ask Market Orders columns display live MBO data.

With the same DLL and symbol:
On a normal chart with Trading Chart DOM enabled, the functions return live results (81 bid and 54 ask orders in one diagnostic scan).
On a standalone Trade DOM, both functions return zero for every visible depth price, although GetBid/AskMarketDepthEntryAtLevel() returns approximately 47 levels per side.
Sierra-native custom Subgraph Label Column rendering works on the standalone Trade DOM, proven by a forced test label.
sc.UsesMarketDepthData = 1 and sc.UpdateAlways = 1.

Are GetBidMarketLimitOrdersForPrice() and GetAskMarketLimitOrdersForPrice() officially supported for an ACSIL study attached directly to a standalone Trade DOM? If so, is another setting or API required? If not, is there a documented public ACSIL method for accessing that Trade DOM’s MBO data?
[2026-07-15 07:37:39]
Sierra_Chart Engineering - Posts: 24699
We need to test this.
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, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2026-07-21 05:00:57]
Sierra_Chart Engineering - Posts: 24699
We do not see any problems with this. Here is a code example:

SCSFExport scsf_MarketLimitOrdersForPriceExample(SCStudyInterfaceRef sc)
{
  if (sc.SetDefaults)
  {
    // Set the configuration and defaults

    sc.GraphName = "MarketLimitOrdersForPrice Example";

    sc.UsesMarketDepthData = 1;

    sc.AutoLoop = 0;

    sc.GraphRegion = 0;

    return;
  }

  if (sc.ServerConnectionState != SCS_CONNECTED)
    return;

  // Do data processing
  int BidNumLevels = sc.GetBidMarketDepthNumberOfLevels();
  int AskNumLevels = sc.GetAskMarketDepthNumberOfLevels();

  const int NumberOfMarketOrderDataElements = 20;
  n_ACSIL::s_MarketOrderData MarketOrderData[NumberOfMarketOrderDataElements] = {};

  if (BidNumLevels > 5)
  {
    BidNumLevels = 5;
  }
  if (AskNumLevels > 5)
  {
    AskNumLevels = 5;
  }
    
  for (int LevelIndex = 0; LevelIndex < BidNumLevels; LevelIndex++)
  {
    s_MarketDepthEntry MarketDepthEntry;
    sc.GetBidMarketDepthEntryAtLevel(MarketDepthEntry, LevelIndex);

    int ActualLevels = sc.GetBidMarketLimitOrdersForPrice(sc.Round(MarketDepthEntry.AdjustedPrice / sc.TickSize), NumberOfMarketOrderDataElements, MarketOrderData);

    for (int OrderDataIndex = 0; OrderDataIndex < ActualLevels; OrderDataIndex++)
    {
      uint64_t OrderID = MarketOrderData[OrderDataIndex].OrderID;
      t_MarketDataQuantity MarketDataQuantity = MarketOrderData[OrderDataIndex].OrderQuantity;
      
      if(OrderDataIndex < 1)
      {
        SCString LogString;
        LogString.Format("Bid Limit order | Price:%f, Quantity:%f, OrderId:%llu", MarketDepthEntry.AdjustedPrice, MarketDataQuantity, OrderID);
        sc.AddMessageToLog(LogString, false);
      }
    }

  }

  for (int LevelIndex = 0; LevelIndex < AskNumLevels; LevelIndex++)
  {
    s_MarketDepthEntry MarketDepthEntry;
    sc.GetAskMarketDepthEntryAtLevel(MarketDepthEntry, LevelIndex);

    int ActualLevels = sc.GetAskMarketLimitOrdersForPrice(sc.Round(MarketDepthEntry.AdjustedPrice / sc.TickSize), NumberOfMarketOrderDataElements, MarketOrderData);

    for (int OrderDataIndex = 0; OrderDataIndex < ActualLevels; OrderDataIndex++)
    {
      uint64_t OrderID = MarketOrderData[OrderDataIndex].OrderID;
      t_MarketDataQuantity MarketDataQuantity = MarketOrderData[OrderDataIndex].OrderQuantity;

      if(OrderDataIndex < 1)
      {
        SCString LogString;
        LogString.Format("Ask Limit order | Price:%f, Quantity:%f, OrderId:%llu", MarketDepthEntry.AdjustedPrice, MarketDataQuantity, OrderID);
        sc.AddMessageToLog(LogString, false);
      }
    }

  }

}

When using the above study on a Chart or Trade DOM, we recommend setting the chart update interval to about 2000 to 5000 ms. So the Message Log does not fill with too many messages too quickly.

We also see you are running older versions of Sierra Chart. It is essential to update and may resolve the problem. Instructions:

Software Download: Fast Update
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, use the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2026-07-21 05:01:57
[2026-07-24 15:41:27]
User860690 - Posts: 12
let me try update this weekend and report back again!
[2026-07-27 04:22:26]
User860690 - Posts: 12
Correction and follow-up after updating and performing controlled tests.

i have updated to latest SC version.

The MBO API and Label Column issues are separate:

1. On a standalone Trade DOM using the native ES 0.25 price increment,
GetBidMarketLimitOrdersForPrice/GetAskMarketLimitOrdersForPrice work.

Example diagnostic result:
chartTick=0.25 symbolTick=0.25
bidMBOResults=15 askMBOResults=10
bidQualifying=10 askQualifying=10 liveWrites=20

2. On the same symbol with the Trade DOM combining 4 ticks into 1.00 rows,
sc.TickSize and sc.SymbolData->TickSize both report 1.00, depth entries advance
by 1.00, and both MBO functions return zero. The native Bid/Ask Market Orders
columns still display the underlying queues, overlaid on the combined rows.

Is there a documented public ACSIL method to obtain the native 0.25 tick size
and query all underlying MBO prices when the Trade DOM combines four ticks?

There is also a corrected finding regarding the Label Column. My original post
said the forced label worked. It did not appear in the Label Column; the value
was only visible in the normal chart's study-values line.

The study uses the documented recipe exactly:

sc.GraphRegion = 0;
Subgraph.DrawStyle =
DRAWSTYLE_SUBGRAPH_NAME_AND_VALUE_LABELS_ONLY;
Subgraph.LineLabel =
LL_DISPLAY_VALUE |
LL_VALUE_ALIGN_DOM_LABELS_COLUMN |
LL_DISPLAY_CUSTOM_VALUE_AT_Y;

Subgraph.Data[sc.ArraySize - 1] = 123.0f;
Subgraph.Arrays[0][sc.ArraySize - 1] = currentBidPrice;

The log proves ArraySize and the index are valid, the lifecycle gates have
passed, and the write occurred:

ArraySize=1730 lastIdx=1729 FullRecalc=0
forcedIndex=1729 forcedQty=123 forcedY=7499
liveWrites=20

Labels Column 1 is visible and the study is not hidden. The result is blank on
both a chart with Chart DOM columns and a standalone Trade DOM. I also tested
both the default scale behavior and SCALE_INDEPENDENT with the same result.

Is another documented study or Subgraph setting required for this recipe in
the current Sierra Chart version? If not, could you provide a minimal
single-Subgraph example confirmed to render in a standalone Trade DOM?

i have attached the CPP files for reference.
attachmentMBOLens.cpp - Attached On 2026-07-27 04:21:43 UTC - Size: 14.38 KB - 26 views
[2026-07-27 04:49:23]
Sierra_Chart Engineering - Posts: 24699
Did you change the chart Tick Size to 1? That is going to be a problem doing that. It must remain at .25.

We will look over the Subgraph Label issue a little later.
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, use the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2026-07-27 04:50:27
[2026-07-29 05:01:12]
User860690 - Posts: 12
i tried on tick size 1 and 0.25. both didnt work
[2026-07-30 21:27:25]
Sierra_Chart Engineering - Posts: 24699
We do not observe any problems with this. Using the "MarketLimitOrdersForPrice Example" study, the individual working limit orders can be accessed. We did test on a trading DOM but that does not matter.

Here is the logging:

2026-07-30 17:26:06.327 | Chart: MESU26_FUT_CME[M] #2 | Study: MarketLimitOrdersForPrice Example | Bid Limit order | Price:7473.750000, Quantity:4.000000, OrderId:6880487382120
2026-07-30 17:26:06.327 | Chart: MESU26_FUT_CME[M] #2 | Study: MarketLimitOrdersForPrice Example | Bid Limit order | Price:7473.500000, Quantity:5.000000, OrderId:6880487376232
2026-07-30 17:26:06.327 | Chart: MESU26_FUT_CME[M] #2 | Study: MarketLimitOrdersForPrice Example | Ask Limit order | Price:7475.500000, Quantity:4.000000, OrderId:6880487383267
2026-07-30 17:26:06.327 | Chart: MESU26_FUT_CME[M] #2 | Study: MarketLimitOrdersForPrice Example | Ask Limit order | Price:7476.000000, Quantity:4.000000, OrderId:6880487392187
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, use the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2026-07-30 21:28:19

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

Login

Login Page - Create Account