Login Page - Create Account

Support Board


Date/Time: Sun, 05 May 2024 14:31:23 +0000



[Programming Help] - Persisitent variables and DateTime Variables

View Count: 882

[2019-02-20 07:05:02]
lightbeckons - Posts: 11
Hi,
1.I am trying to use persistent variables (for study) in a daily chart to store the VAP elements and this data is being referenced by a 30min chart. The problem is I havent been able to get too clear the persistent variables at the start of every DAILY candle. How would one go about this.

2. My second question is again about daily charts and the SCDateTime variables associated with a single bar in the daily chart. Say i have to store the low values of the price every 4 hour window, while at the still same bar (sc.Index variable is same), can I take a snapshot of these values using persistent variables?

Thanks in advance.
[2019-02-20 18:57:00]
Sierra Chart Engineering - Posts: 104368
1. We are not understanding this.

2. For the second question it might be best to allocate your own custom data array that you require:
ACSIL Programming Concepts: Dynamic Memory Allocations Within Study Instance

Here is the documentation for persistent variables:
sc.GetPersistentInt()
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
[2019-02-21 06:30:50]
lightbeckons - Posts: 11
Thank you for the reply. I am in fact working with dynamic memory, but then how do i clear the dynamic array at the close of the daily candle. I am not able to achieve this even with the persistent variables i mentioned in (1). I want to clear whatever data im storing in the persistent variables and dynamic memory at the close of a daily candle (the chart is ofcourse daily).
I would greatly appreciate an help regarding this. There seems to be no specific trigger that is, firstly triggered only once at the close of the day during all the update calls, and secondly, should reinitialize the structures at the updated start index to begin fresh recording of day's data. I am trying this with manual looping, auto-looping and have tried out many functions as trigger but unsuccessfully.

I may add that this has been requested before:ACSIL - UDP request for resetting Persistent Variables re sc.SetDefaults but no viable solution seems to exist. I think i have gone through almost every one of your functions and variables to somehow trigger this clearing of persistent variables.

thanks in advance
Date Time Of Last Edit: 2019-02-22 07:06:08

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

Login

Login Page - Create Account