Support Board
Date/Time: Sun, 24 Nov 2024 08:52:20 +0000
Suggested improvement for the transparent highlight
View Count: 194
[2024-06-20 15:14:34] |
User166108 - Posts: 73 |
Use session start/end time from the chart as that is probably 80% of the use cases. I just copied from ACS_Source and tweaked it to use session start time. Obviously you'd still want to allow a specified start/end time. SCSFExport scsf_SessionTimeRangeHighlightTransparent(SCStudyInterfaceRef sc) { SCSubgraphRef Subgraph_TimeRange = sc.Subgraph[0]; SCInputRef ForwardProject = sc.Input[1]; if (sc.SetDefaults) { sc.GraphName = "Time Range Highlight - Transparent"; sc.GraphRegion = 0; sc.AutoLoop = 0; // Manual looping sc.ValueFormat = 0; sc.ScaleRangeType = SCALE_SAMEASREGION; sc.DrawStudyUnderneathMainPriceGraph = true; Subgraph_TimeRange.Name = "TR"; Subgraph_TimeRange.DrawStyle = DRAWSTYLE_BACKGROUND_TRANSPARENT; Subgraph_TimeRange.PrimaryColor = RGB(64, 64, 64); Subgraph_TimeRange.DrawZeros = false; ForwardProject.Name = "Display in Forward Projection Area"; ForwardProject.SetYesNo(false); return; } n_ACSIL::s_ChartSessionTimes sessionTimes; sc.GetSessionTimesFromChart(sc.ChartNumber, sessionTimes); int NumberForwardBars = 0; if (ForwardProject.GetYesNo()) { NumberForwardBars = 200; Subgraph_TimeRange.ExtendedArrayElementsToGraph = NumberForwardBars; } for (int Index = sc.UpdateStartIndex; Index < (sc.ArraySize + NumberForwardBars); Index++) { SCDateTime &IndexDateTime = sc.BaseDateTimeIn[Index]; bool ShouldHighLight = false; ShouldHighLight = (IndexDateTime.GetTimeInSeconds() >= sessionTimes.StartTime.GetTime() && IndexDateTime.GetTimeInSeconds() <= sessionTimes.EndTime.GetTime()); if (ShouldHighLight) { Subgraph_TimeRange[Index] = 1; } else { Subgraph_TimeRange[Index] = 0; } } } |
To post a message in this thread, you need to log in with your Sierra Chart account: