Login Page - Create Account

Support Board

Date/Time: Wed, 28 Jul 2021 23:16:33 +0000

Post From: Notice: Study Exceptions in New Versions and Code Efficiency

[2020-05-22 04:06:44]
Sierra Chart Engineering - Posts: 96981 | Ending Date: 2022-04-10
No not now in regards to post #7.

A safety problem was discovered involving these functions:
int& sc.GetPersistentIntFast(int32_t Index);
float& sc.GetPersistentFloatFast(int32_t Index);
double& sc.GetPersistentDoubleFast(int32_t Index);
SCDateTime& sc.GetPersistentSCDateTimeFast(int32_t Index);

There was not consideration to how when the internal vector is increased in size, that the memory addresses can change which means that as references are being made to the returned values, prior references made during the same call to the custom study function could change meaning the study function could be writing to an address which is no longer valid. And in that case the reference address would change on the next call into the study function.

This is now resolved in version 2109.

Effective with that version the valid range for the Index parameter is now 0 to 999.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. If possible please keep your questions brief and to the point. Please be aware of support policy:

If your question/request has been answered and you do not have anything further, then it is easiest for us if you do not reply again to say thank you.
Date Time Of Last Edit: 2020-05-22 04:08:23