Support Board
Date/Time: Sun, 16 Mar 2025 02:46:48 +0000
Post From: Pass Array from GetStudyLineUntilFutureIntersectionByIndex to SubGraph
[2022-08-03 02:31:46] |
BombaFett - Posts: 3 |
Demigods, I have a feeling this is a painfully simple question, but for the life of me, I can't the code below to pass all the occurrences of Add Until Line Intersection from the referenced study. It just shows the most recent one on the last bar since adding the study. I can kinda see why because because I'm passing LineValue as a single value, but everytime I try to add an Index (which I'm almost certain I'm doing wrong), I get compile errors. I've read the documentation for arrays (ACSIL Interface Members - sc.Subgraph Array: sc.Subgraph[].Data[] / sc.Subgraph[][]) but I'm not understanding it much better. Am I even on the right track? Thanks for any insight you can provide SCSFExport scsf_IntersectionLines(SCStudyInterfaceRef sc)
{ SCSubgraphRef Subgraph_IntersectionLines = sc.Subgraph[0]; if (sc.SetDefaults) { sc.GraphName = "Reference Study with Add Until Line Intersection Data"; sc.StudyDescription = "Referencing Add Until Line Intersection data from other studies on the chart."; Subgraph_IntersectionLines.Name = "Line Properties"; Subgraph_IntersectionLines.DrawStyle = DRAWSTYLE_LINE; Subgraph_IntersectionLines.LineWidth = 5; Subgraph_IntersectionLines.PrimaryColor = COLOR_GREEN; Subgraph_IntersectionLines.DrawZeros = false; sc.AutoLoop = 0; // low precedence level to ensure other studies are calculated first. sc.CalculationPrecedence = LOW_PREC_LEVEL; sc.Input[1].Name = "Study Reference with Add Until Line Intersection"; sc.Input[1].SetStudyID(1); return; } int LineIDForBar = 0; int StartIndex = 0; float LineValue = 0; int EndIndex = 0; sc.GraphRegion = 0; int LineIndex = 0; LineIndex = sc.GetNumLinesUntilFutureIntersection(sc.ChartNumber, sc.Input[1].GetStudyID()) - 1; for (LineIndex; LineIndex < sc.ArraySize; ++LineIndex) { sc.GetStudyLineUntilFutureIntersectionByIndex(sc.ChartNumber, sc.Input[1].GetStudyID(), LineIndex, LineIDForBar, StartIndex, LineValue, EndIndex); Subgraph_IntersectionLines[sc.Index] = LineValue; } } |