Login Page - Create Account

Support Board


Date/Time: Mon, 25 Nov 2024 20:38:03 +0000



Post From: sc.GetStudyArrayFromChartUsingID() won't work from another chart?

[2024-02-11 01:06:46]
j4ytr4der_ - Posts: 938
I'm trying to allow for selection of a study from another chart, but I can't get it to work. I can select a study from the chart my study is instantiated on, and it's fine... but if I choose any other chart, I get zero back. Here is a simplified version of my code:

Inputs:

SCInputRef Input_StudyA = sc.Input[0];
SCInputRef Input_StudyB = sc.Input[1];

SCFloatArray StudyAArray;
SCFloatArray StudyBArray;

Input_StudyA.Name = "Study A";
Input_StudyA.SetChartStudySubgraphValues(0, 0, 0);


Input_StudyB.Name = "Study B";
Input_StudyB.SetChartStudySubgraphValues(0, 0, 0);

Processing code:

sc.GetStudyArrayFromChartUsingID(Input_StudyA.GetChartNumber(), Input_StudyA.GetStudyID(), Input_StudyA.GetSubgraphIndex(), StudyAArray);

StudyA = StudyAArray[sc.ArraySize - 1];

sc.GetStudyArrayFromChartUsingID(Input_StudyB.GetChartNumber(), Input_StudyB.GetStudyID(), Input_StudyB.GetSubgraphIndex(), StudyBArray);

StudyB = StudyBArray[sc.ArraySize - 1];

Anyone have any suggestions as to what I'm missing that would keep this from working on charts other than the study's own chart? Oh and I'm using manual looping as I don't need anything but the current bar for this study, in case it matters.
Date Time Of Last Edit: 2024-02-11 01:09:08