Support Board
Date/Time: Sat, 23 Nov 2024 07:15:17 +0000
Post From: Persistent array variables
[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; } |