Support Board
Date/Time: Thu, 13 Mar 2025 02:12:43 +0000
Post From: How to access sc.BaseData data from an additional symbol in ASCIL?
[2022-05-30 16:31:28] |
User431178 - Posts: 613 |
The study ID should reference the Add Additional Symbol study ID. The result will be a SCGraphData object containing all the arrays from the referenced study. You can the reference the individual arrays as required. // Define a graph data object to get all of the study data SCGraphData StudyData; // Get the study data from the specified chart sc.GetStudyArraysFromChartUsingID(ChartStudyInput.GetChartNumber(), ChartStudyInput.GetStudyID(), StudyData); //Check if the study has been found. If it has, GetArraySize() will return the number of Subgraphs in the study. if(StudyData.GetArraySize() == 0) return; // Define a reference to the first subgraph array SCFloatArrayRef NumTrades = StudyData[SC_NUM_TRADES]; // Check if array is not empty. if(NumTrades.GetArraySize() != 0) { // Get last value in array float LastValue = NumTrades[NumTrades .GetArraySize() - 1]; } Copied the above example from ACSIL Interface Members - Functions: sc.GetStudyArraysFromChartUsingID() and modified slightly. You may run into problems with SC_BIDNT (and others), that needs additional arrays loaded, and it looks like Add Additonal Symbol has the first 11 arrays only. |