Support Board
Date/Time: Mon, 21 Apr 2025 13:08:33 +0000
ACSIL sc.DailyHigh & sc.DailyLow
View Count: 66
[2025-04-18 02:33:14] |
Gradient - Posts: 121 |
Hi, I'm using sc.DailyHigh and sc.DailyLow to compute the current day's range. However, I noticed that these values refer to the prior session's high or low at the open of a new day. How can these values be reset at the start of the next trading session? I've attached a couple of screenshots of the test I ran. I have a study where Actual is the current day's range. Daily High and Daily Low are the sc.DailyHigh and sc.DailyLow variables stored in subgraphs. The Actual value is computed as the difference between the sc.DailyHigh and sc.DailyLow stored in a variable then stored in the subgraph. Looking at Screenshot 1 you can see the Actual has a value of 73.50. However, the Daily High of 5724.75 is the high of the last bar prior to the start of the current session. Viewing Screenshot 2, the Actual value is 174.25 because the Daily Low is still set to the prior session's Daily Low of 5651.25. The actual Daily Low for the current session is 5776.75. This creates an inaccurate Actual daily range value. Is there a method that resets these values at the start of the session? Thanks |
![]() ![]() |
[2025-04-18 03:54:22] |
Gradient - Posts: 121 |
For future reference, I did the following as a work around to dynamically compute the day's range. double &HOD=sc.GetPersistentDouble(0); double &LOD=sc.GetPersistentDouble(1); SCDateTime currentBar=sc.BaseDateTimeIn[sc.Index]; int currentDate=currentBar.GetDate(); int firstIndex=sc.GetFirstNearestIndexForTradingDayDate(sc.ChartNumber,currentDate); //Set the HOD and LOD at the start of the session if(sc.Index==firstIndex){ HOD=sc.High[sc.Index]; LOD=sc.Low[sc.Index]; } //Iterative Updates to HOD and LOD if(sc.High[sc.Index]>HOD){ HOD=sc.High[sc.Index]; } if(sc.Low[sc.Index]<LOD){ LOD=sc.Low[sc.Index]; } //Store Updated Range dayRange=HOD-LOD; |
[2025-04-18 07:53:46] |
Sierra_Chart Engineering - Posts: 19285 |
Regarding post #1, those values come from the real-time data feed. So if you are looking at a CME symbol and we do not know what symbol you are looking at, then they are what are transmitted by the CME data feed. There is definitively no problem with them. There could not be. And the screenshots you attached did not follow our rules: Support Board Posting Information: Attaching or Posting a Screenshot/Image (Optional) And this is an exceptionally good example of where you are hiding important information. 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, use the Teton service: Sierra Chart Teton Futures Order Routing |
[2025-04-18 19:07:51] |
Gradient - Posts: 121 |
I’m confused. What information could be hid and for what reason? There’s no benefit to hiding information when seeking a resolution to an issue. Check my posts. I’ve used the same method of uploading screenshots with no issues. The study is simple. Take the difference between sc.DailyHigh and sc.DailyLow and store it in a variable (ie range). Store that variable in a subgraph. Store the raw values of sc.DailyHigh and sc.DailyLow in subgraphs. The instrument is the ES. What other information could alter this process? There’s no trading signals being generated. Simply attempting to compute the developing daily range. Could the data feed used affect the values? For example if Rithmic is used vs Teton. That seems more plausible given the study isn’t very complex. Another consideration is that this was during a replay. At any rate the implementation in the second post resolves the issue. |
To post a message in this thread, you need to log in with your Sierra Chart account: