Support Board
Date/Time: Sun, 19 Jan 2025 03:29:13 +0000
Referencing subgraph values...
View Count: 912
[2018-03-18 06:33:35] |
User895355 - Posts: 55 |
I'm referencing a study(ID:1) which has two values. *That* study says the values are SG2, and SG3. The code excerpt below is returning nothing. What am I missing? SCInputRef Val1 = sc.Input[0]; SCInputRef Val2 = sc.Input[1]; -- Val1.SetStudySubgraphValues(1, 2); <- Is this correct? Is the function looking for a zero-based value, or SG2, SG3 ONE-based value? Val2.SetStudySubgraphValues(1, 3); <- ...and here? -- SCFloatArray v1; sc.GetStudyArrayUsingID(Val1.GetStudyID(), Val1.GetSubgraphIndex(), v1); SCFloatArray v2; sc.GetStudyArrayUsingID(Val2.GetStudyID(), Val2.GetSubgraphIndex(), v2); -- and for debugging... SCString msg; msg.Format("Debug: %f : %f", v1[0], v2[0]); <-- this is returning nothing sc.AddMessageToLog(msg, 1); |
[2018-03-18 07:13:26] |
Sierra Chart Engineering - Posts: 104368 |
We just updated the documentation for: sc.Input[].SetStudySubgraphValues msg.Format("Debug: %f : %f", v1[0], v2[0]); <-- this is returning nothing Sierra Chart Support - Engineering Level Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy: https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service: Sierra Chart Teton Futures Order Routing Date Time Of Last Edit: 2018-03-18 07:35:55
|
[2018-03-18 12:53:18] |
User895355 - Posts: 55 |
Ah, ok, thanks. For anyone interested, these were the changes I needed to make: Val1.SetStudySubgraphValues(1, 1); <- even though the referenced study showed SG2, and SG3, I needed the zero-based values of 1 and 2 Val2.SetStudySubgraphValues(1, 2); <- " " " -- -- SCString msg; msg.Format("Debug: %f : %f", v1[sc.Index], v2[sc.Index]); <-- needed the autoloop index values here sc.AddMessageToLog(msg, 1); |
To post a message in this thread, you need to log in with your Sierra Chart account: