Login Page - Create Account

Support Board


Date/Time: Wed, 04 Mar 2026 19:52:51 +0000



Post From: Historical market depth for chart with custom bars

[2026-01-21 12:38:40]
curious16 - Posts: 36
I started looking into this method using your sample code.

One question came up regarding the use of persistent variables that are set in the calling study function by the custom chart bar function. The custom chart bar function gets a reference to a s_CustomChartBarInterface struct. This has methods for loading persistent scalar variables (Int, Float etc), but there is no method for getting a persistent pointer, that is, passing a pointer to a vector of values.

Could this be added or is there a fundamental limitation that makes it impossible to pass, e.g., a pointer to a std::vector<int> to the custom chart bar function?

Another question I have is about selectively setting the color of selected custom bars. Can this be done by adding a manual loop,
for (int i=sc.UpdateStartIndex; i<sc.ArraySize; i++),
to the calling study function and do the coloring there? Your examples do not do any manual looping in the calling study function. They only manage the input parameters and let the custom chart bar function know when an input has changed and the entire chart needs to be redrawn.