Login Page - Create Account

Support Board


Date/Time: Thu, 03 Dec 2026 00:31:54 +0000



[API Design] Consistent Naming for t_ChartArrayDataType Arrays

View Count: 487

[2026-10-09 19:20:17]
User719512 - Posts: 554
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;

[2026-10-11 20:55:38]
User719512 - Posts: 554
I may have submitted my original post before seeing your note in
https://www.sierrachart.com/index.php?page=doc/Whats_New.php#SCVer2969
stating that the ACSIL interface changes are now finalized. I only noticed that note just now, so I'm not certain of the timing.

I wanted to share one additional observation. Your API is very well structured, and I found that a global search-and-replace of `FloatArray` with `ChartDataArray` across all my .h and .cpp files worked perfectly. It updated the typedef names and their uses in function prototypes without requiring any further changes.

For example, this:


void GetStudyArrayFromChartUsingID(const s_ChartStudySubgraphValues& ChartStudySubgraphValues, SCFloatArrayRef SubgraphArray)

Becomes:


void GetStudyArrayFromChartUsingID(const s_ChartStudySubgraphValues& ChartStudySubgraphValues, SCChartDataArrayRef SubgraphArray)

I've attached a VS Code IntelliSense screenshot showing the updated naming applied to the example GetStudyArrayFromChartUsingID() function.

To be clear, I'm not advocating for or against any further changes to the API. I simply wanted to share the practical result of applying the naming convention I proposed, in case it's useful.

Respectfully submitted, @User719512
imageSierra-FloatArray-to-ChartDataArray-global-replace.png / V - Attached On 2026-10-11 20:54:58 UTC - Size: 35.76 KB - 63 views
[2026-10-14 06:14:20]
Sierra_Chart Engineering - Posts: 25536
Thank you. There is a lot here. It takes time to review all of this. But we generally understand what you are asking for. We do not want to make too many name changes even if the code still compiles because it can make code look different to a developer compared to our examples and they might wonder why.

The use of the word "Float" is not really improper because the FIX protocol uses the term float for double precision floating point values:
https://fix.dev/kb/data-types/float

This definitely in this case refers to a double because it makes reference to 15 significant digits and we know that because we have implemented our own FIX encoder and decoder.

The word double simply means double precision floating point. So the term float is not really wrong. This is why we are in favor of just leaving it.
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

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

Login

Login Page - Create Account