Support Board
Date/Time: Sat, 17 Jan 2026 12:33:38 +0000
Post From: Historical market depth for chart with custom bars
| [2026-01-17 08:58:38] |
| curious16 - Posts: 22 |
|
I found that historical market depth does not take into account custom bars. For a chart constructed with (sc.IsCustomChart = 1), the call to sc.GetMarketDepthBars() links to the underlying bars (base chart bars) that were used to build the custom output bars, not to the custom bars themselves. This results in incorrect mapping between custom bar index and depth data. I found the same problem also with your built-in Market Depth Historical Graph study. It works fine on a base chart but shows incorrect data when a study that generates custom bars is loaded. It appears that the GetMarketDepthBars() call is hard-linked to the underlying base bars of the chart. A custom study can aggregate base bars in some customized way (e.g. a study uses underlying 10-trade bars and aggregates them to bars representing a different total number of trades depending on the time of the day). Such custom charts have fewer output bars than underlying base bars. The expected behaviour would be for GetMarketDepthBars() to sync with the custom bars. Could this be changed or can this already be done in code? It would be very valuable to get market depth data also for custom charts. |
