Login Page - Create Account

Support Board


Date/Time: Sat, 23 Nov 2024 07:49:32 +0000



Persistent array variables

View Count: 2313

[2013-06-18 04:02:33]
jae - Posts: 1
Hello,
I've used up all 9 of the sc.Subgraph[].Arrays[n][n1]. And I need more array variables that can persist. I am able to use about 5 or 6 arrays by adding them to the PersistVars strucure in Sierrachart.h, such as "SCDateTime BarOpenTime[13]". For some reason, bool and int arrays such as "int IndPos[13]", when used in the DLL, are causing Sierrachart to crash on study re-calculation. This happens when I load more than 4 days of intraday 1-minute data. It works fine with 4 days or less of data on the 1 minute chart.
I've set the FreeDLL to 0 and still get the crash. Here's the code that's causing the crash:
if (IndClose > PreviousIndClose)
                {
                  if (sc.PersistVars->IndPos[ChrtNumber] == DN) {
                    sc.PersistVars->NewIndPos[ChrtNumber] = true;
                  }
                  else{
                    sc.PersistVars->NewIndPos[ChrtNumber] = false;
                  }
                  sc.PersistVars->IndPos[ChrtNumber] = UP;
                  
                }
                else if (IndClose < PreviousIndClose)
                {
                  
                  if (sc.PersistVars->IndPos[ChrtNumber] == UP) {
                    sc.PersistVars->NewIndPos[ChrtNumber] = true;
                  }
                  else {
                    sc.PersistVars->NewIndPos[ChrtNumber] = false;
                  }
                  sc.PersistVars->IndPos[ChrtNumber] = DN;
                  
                }
                else { sc.PersistVars->IndPos[ChrtNumber] = FLAT; }

[2013-06-18 04:39:12]
Sierra Chart Engineering - Posts: 104368
Currently there are MAX_STUDY_EXTRA_ARRAYS(12) sc.Subgraph[].Arrays[] available.
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