Login Page - Create Account

Support Board


Date/Time: Thu, 16 Jan 2025 14:00:47 +0000



Post From: ASCIL- Passing value to/from custom study

[2017-10-31 03:46:29]
CustomIndicators - Posts: 126
For local persistent ints, you use:
sc.GetPersistentInt(key);
sc.SetPersistentInt(key, newValue);

For ints on other charts, you use:
sc.GetStudyPersistentIntFromChart(chartNumber, studyID, key);
sc.SetStudyPersistentIntFromChart(chartNumber, studyID, key, newValue);


To get a subgraph from another chart, use:
SCFloatArray StudyReference;
sc.GetStudyArrayFromChartUsingID(chartNumber, targetChartStudyID, subgraphNumber, StudyReference);
float oscValue0 = StudyReference[StudyReference.GetArraySize() - 1];

That stores the current value of the subgraph into oscValue0. If you wanted the last locked value, you just increase that number 1 to number 2.