Login Page - Create Account

Support Board


Date/Time: Mon, 25 Nov 2024 23:33:17 +0000



[Programming Help] - sc.GetPersistentInt() help...

View Count: 154

[2024-01-27 15:39:54]
User895355 - Posts: 55
I have a study that displays lines at NY market open. Either I just want to show the current session, or "historical" going back the length of the chart. The Study displays but it appears only every 5 days when it should show every NY market open. I'm not sure how to set the persistent int. I've tried many different ways to set the persistent int, but it feels like I'm overcomplicating it. I've read the docs but to no avail. Any help here would be greatly appreciated:


int currentDate = sc.BaseDateTimeIn[sc.Index].GetDate();
int currentTime = sc.BaseDateTimeIn[sc.Index].GetTime();

int &HighTool_LineNumber = ShowAll.GetYesNo() == 0 ? sc.GetPersistentInt(1) : sc.GetPersistentInt(currentDate * 2);
int &MedianTool_LineNumber = ShowAll.GetYesNo() == 0 ? sc.GetPersistentInt(2) : sc.GetPersistentInt(currentDate * 3);
int &QuartileUpTool_LineNumber = ShowAll.GetYesNo() == 0 ? sc.GetPersistentInt(3) : sc.GetPersistentInt(currentDate * 4);
int &QuartileDownTool_LineNumber = ShowAll.GetYesNo() == 0 ? sc.GetPersistentInt(4) : sc.GetPersistentInt(currentDate * 5);
int &LowTool_LineNumber = ShowAll.GetYesNo() == 0 ? sc.GetPersistentInt(5) : sc.GetPersistentInt(currentDate * 6);

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

Login

Login Page - Create Account