Login Page - Create Account

Support Board


Date/Time: Sun, 22 Dec 2024 20:56:56 +0000



Post From: sc.GetStudyArrayFromChartUsingID() question

[2015-01-28 14:25:00]
joshtrader - Posts: 492
I have a study which takes a subgraph value from another study and draws a line, basically. It works great, and I was using a current chart study input. In order to make it a little more general and avoid having to use "Study/Price Overlay" to pull the subgraph from another chart to the current one, I replaced this:

sc.Input[j].SetStudySubgraphValues(0,0);
...
sc.GetStudyArrayUsingID(sc.Input[j].GetStudyID(), sc.Input[j].GetSubgraphIndex(), studyArray[j]);

with this:

sc.Input[j].SetChartStudySubgraphValues(1,0,0);
...
sc.GetStudyArrayFromChartUsingID(sc.Input[j].GetChartStudySubgraphValues(), studyArray[j]);

Now, if I use a study on the current chart as input, it works fine. But if I try to use another chart's study as input, it does not work. I only changed these two lines in the code, and again, it works fine when the chart number in the input it set to a study on the current chart. What's going on here?
Date Time Of Last Edit: 2015-01-28 14:25:50