Login Page - Create Account

Support Board


Date/Time: Sat, 10 Oct 2026 01:01:40 +0000



[API Design] Consistent Naming for t_ChartArrayDataType Arrays

View Count: 27

[2026-10-09 19:20:17]
User719512 - Posts: 497
Hi Sierra Chart Engineering,

I suggested some possible changes in my post here:
v2966 sierrachart.h still uses define SC_DLL_VERSION 2964 | Post: 450690

You implemented changes in response to that suggestion, although not quite along the lines I had envisioned. The approach I had in mind would involve a fairly significant refactor, with potential downstream refactoring for custom study developers as well.

Personally, the impact on my code would be minimal. For the affected items, this would largely be a matter of renaming them, with any necessary changes readily identified by compiler errors. However, I recognize that other custom study developers may have different perspectives on the impact of such a change.

The underlying intent of my suggestion was to consider whether Sierra Chart should eliminate the remaining `Float`/`float` terminology in the API where `t_ChartArrayDataType` is used, given that this type is now `double`.

For example, the current API includes:


void GetStudyArrayFromChartUsingID(
int ChartNumber,
int StudyID,
int SubgraphIndex,
SCFloatArrayRef SubgraphArray
);

typedef c_ArrayWrapper<t_ChartArrayDataType>& SCFloatArrayRef;

Custom study code typically uses this API along with declarations such as:


SCFloatArray sourceArray1;

sc.GetStudyArrayFromChartUsingID(
sc.ChartNumber,
SourceStudyID1,
SourceSubgraph1,
sourceArray1
);

Despite the `Float` naming, `SCFloatArray` is an array of `t_ChartArrayDataType`, which is now `double`. The terminology therefore no longer accurately reflects the underlying data type.

My proposed approach would be to introduce more appropriately named types, such as `SCChartDataArray` and `SCChartDataArrayRef`, and use them consistently for arrays based on `t_ChartArrayDataType`. This would also raise the question of whether the existing `SCFloatArray` types should remain for compatibility or for any remaining use cases involving actual `float` data.

Ultimately, I think this comes down to where Sierra Chart wants to draw the line between API consistency and correctness, backward compatibility, and the refactoring burden placed on custom study developers. There is also the practical consideration of how the SDK, documentation, and code samples should read going forward, and how much legacy `Float` terminology is worth removing.

I've included the broader typedef changes I had envisioned below for reference. However, having considered the scope of the changes and their potential downstream impact, I'm not suggesting that this full refactor is necessarily worth undertaking.

Thank you for considering these points. I appreciate that decisions like this involve balancing multiple considerations, and I trust Sierra Chart will determine the most appropriate approach.

---

Proposed typedef changes for reference

The following illustrates the naming changes I had envisioned, rather than a recommendation that they necessarily all be implemented.

[Existing typedefs]


typedef SCDateTimeArray &SCDateTimeArrayRef;
typedef c_ArrayWrapper<uint16_t> SCUShortArray;
typedef c_ArrayWrapper<unsigned int> SCUIntArray;
typedef c_ArrayWrapper<unsigned int>& SCUIntArrayRef;
typedef c_ArrayWrapper<SCUIntArray> SCUIntArrayArray;
typedef c_ArrayWrapper<t_ChartArrayDataType> SCFloatArray;

typedef c_ArrayWrapper<t_ChartArrayDataType> SCChartDataArray;

typedef c_ArrayWrapper<uint32_t> SCColorArray;
typedef c_ArrayWrapper<uint32_t>& SCColorArrayRef;
typedef c_ConstArrayWrapper<uint16_t> SCConstUShortArray;
typedef c_ConstArrayWrapper<char> SCConstCharArray;

typedef c_ArrayWrapper<t_ChartArrayDataType> SCConstFloatArray;

typedef c_ArrayWrapper<SCFloatArray>& SCBaseDataRef;
typedef c_ArrayWrapper<t_ChartArrayDataType>& SCFloatArrayRef;
typedef c_ArrayWrapper<t_ChartArrayDataType>& SCConstFloatArrayRef;
typedef const c_ArrayWrapper<t_ChartArrayDataType>& SCFloatArrayInRef;

typedef c_ArrayWrapper<SCConstFloatArray> SCConstFloatArrayArray;
typedef c_ArrayWrapper<SCFloatArray> SCFloatArrayArray;

[Proposed typedefs]


typedef SCDateTimeArray &SCDateTimeArrayRef;
typedef c_ArrayWrapper<uint16_t> SCUShortArray;
typedef c_ArrayWrapper<unsigned int> SCUIntArray;
typedef c_ArrayWrapper<unsigned int>& SCUIntArrayRef;
typedef c_ArrayWrapper<SCUIntArray> SCUIntArrayArray;

// If anything still needs actual float data, retain the existing
// float types and introduce separate double/chart-data types.
// typedef c_ArrayWrapper<t_ChartArrayDataType> SCFloatArray;

typedef c_ArrayWrapper<t_ChartArrayDataType> SCChartDataArray;

typedef c_ArrayWrapper<uint32_t> SCColorArray;
typedef c_ArrayWrapper<uint32_t>& SCColorArrayRef;
typedef c_ConstArrayWrapper<uint16_t> SCConstUShortArray;
typedef c_ConstArrayWrapper<char> SCConstCharArray;

typedef c_ArrayWrapper<t_ChartArrayDataType> SCConstChartDataArray;

typedef c_ArrayWrapper<SCChartDataArray>& SCBaseDataRef;
typedef c_ArrayWrapper<t_ChartArrayDataType>& SCChartDataArrayRef;
typedef c_ArrayWrapper<t_ChartArrayDataType>& SCConstChartDataArrayRef;
typedef const c_ArrayWrapper<t_ChartArrayDataType>& SCChartDataArrayInRef;

typedef c_ArrayWrapper<SCConstChartDataArray> SCConstChartDataArrayArray;
typedef c_ArrayWrapper<SCChartDataArray> SCChartDataArrayArray;

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

Login

Login Page - Create Account