Login Page - Create Account

Support Board


Date/Time: Tue, 04 Mar 2025 14:54:36 +0000



Global variable persistence. ACSIL

View Count: 3657

[2015-08-27 19:18:46]
User966002 - Posts: 3
hello

Can you please suggest some way to Keep a global variable persistent Between different instances of the same custom study inside the same SC copy session.

Have been tried as documentation suggests but it seems like when Same study called in different charts then the global vars are reinitialized.

Note: compiling with visual express
Date Time Of Last Edit: 2015-08-28 00:07:24
[2015-08-28 19:00:02]
Sierra Chart Engineering - Posts: 104368
Make sure you set sc.FreeDLL = 0.

Also look at the persistent variable functions:
https://www.sierrachart.com/index.php?page=doc/doc_ACSIL_Members_Functions.html#scGetPersistentInt
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, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2015-08-28 20:42:02]
User966002 - Posts: 3
Yes used freeDll=0

Sc persist vars wont do it, as long as Structures and array of objects used. Also because the intention was to keep data shared across study instances .


Will a static of a "global" data structure. ensure inside SC that it will persist only for the current study instance?.


Is it possible to optionally keep study calculation values stored within the chart file, instead of doing a full recalculation?

Does the sqlite engine visible in older versions can be accesed for custom storage or it has been deprecated?
Date Time Of Last Edit: 2015-08-29 05:58:31
[2015-08-28 21:11:44]
Sierra Chart Engineering - Posts: 104368

Will a static of a "global" data structure. ensure inside SC that it will persist only for the current study instance?.

No. It will be global.

Provide the code you are using to define the global object so we can see it.


Is it possible to optionally save study values with the chart data instead of full recalculation?
We do not understand this.
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, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2015-08-28 21:12:15
[2015-08-29 05:55:10]
User966002 - Posts: 3
Thanks for your confirmation , I was complicating the posible situation worried about linkage , When indeed Globals seem to be resulting in globals shared across instances of the same study dll .

so finally the real problem seems to be spotted ( my error: aliases of the global objects not correctly referenced ).
Date Time Of Last Edit: 2015-08-29 05:57:17
[2021-12-16 00:50:26]
ycomp - Posts: 321
are global variables of a study dll confined to:

1) the chart? (i.e. all instances of the study in the dll on a chart share these global variables)

2) the chartbook? (i.e. all instances of the study on all charts in a chartbook share these global variables)

3) the sierra chart instance? (i.e. all instances of the study on all charts in all open chartbooks of the sierra chart instance share these global variables)
Date Time Of Last Edit: 2021-12-16 15:08:34
[2021-12-16 01:49:37]
Sierra Chart Engineering - Posts: 104368
What do you mean by "global variables"? We do not know.

You should already know the answer to your question and should not have to ask.

If you are referring to something part of the C/C++ language you should know the answer. If you are referring to something part of ACSIL, the documentation is very clear.
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, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2021-12-16 15:06:07]
ycomp - Posts: 321
what I mean by global variables is what is mentioned in the documentation:

https://www.sierrachart.com/index.php?l=doc/ACSILProgrammingConcepts.html#GlobalVariables

I guess the answer is #3
Date Time Of Last Edit: 2021-12-16 15:27:18
[2021-12-16 15:45:24]
Sierra Chart Engineering - Posts: 104368
Those are C++ global variables. So they are global to the instance of the DLL. There can only be one DLL instance loaded per Sierra Chart process.

There is no relationship at all, to a chart, study, or a Chartbook.
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, *change* to 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