Support Board
Date/Time: Mon, 17 Mar 2025 01:18:37 +0000
Overnight High Low Lines on Next Day session
View Count: 1328
[2022-09-05 19:51:53] |
User299107 - Posts: 60 |
Hi guys, I'm sure this has been asked before, so apologies for asking again. I'm not able to have the Overnight session High and Low only draw on the next day's day session. The problem seems to be that the ON session spans two dates (Close to midnight and then new day from midnight to Open). I only want these two lines (ONH and ONL) to be drawn between the next day's Open and the next day's close. All suggestions welcome. Thanks, Eliza |
[2022-09-05 22:25:01] |
Sawtooth - Posts: 4185 |
Try this: 1. Add the High/Low for Time Period study. -Set the Start Time to the start of the overnight period. -Set the End Time to the end of the overnight period. -Hide the study. 2. Add the Spreadsheet Formula study. -Set the Chart Region to 1. -Set 'Draw Zero Values' to No. -Use a formula like this in the Formula field: =IF(AND(ID1.SG1[-1]>0,ID1.SG1=0),ID1.SG1[-1],IF(AND(ID1.SG1[-1]=0,ID1.SG1>0),0,ID2.SG1[-1])) where ID1.SG1 is the High/Low for Time Period study's High, and ID2 is this Spreadsheet Formula study. -Set the DrawStyle to Dash. This will extend the ONH into the RTH. 3. Duplicate the above Spreadsheet Formula study. -Edit the formula in the Formula field like this: =IF(AND(ID1.SG2[-1]>0,ID1.SG2=0),ID1.SG2[-1],IF(AND(ID1.SG2[-1]=0,ID1.SG2>0),0,ID3.SG1[-1])) where ID1.SG2 is the High/Low for Time Period study's Low, and ID3 is this Spreadsheet Formula study. This will extend the ONL into the RTH. |
[2022-09-06 02:43:53] |
User299107 - Posts: 60 |
Thanks for the help. But these studies return zeros in the spreadsheet. I wonder if this has anything to do with my chart time frame is RTH only? Thanks, Eliza |
[2022-09-06 03:00:07] |
Sawtooth - Posts: 4185 |
these studies return zeros in the spreadsheet.
Yes, this example needs some bars outside of the RTH.I wonder if this has anything to do with my chart time frame is RTH only? In your case, add a 24hr chart of the same bar period, and the same Start Time, to the chartbook, and use the example in post #2. Then on the RTH chart add two instances of the Study/Price Overlay study, one for ONH and one for ONL - Set the Data Copy Mode to 'Earliest...' - Set the Bar Time Matching Method to 'Containing Match' BTW, despite its name, the Spreadsheet Formula study is not a spreadsheet study. Date Time Of Last Edit: 2022-09-06 03:04:16
|
To post a message in this thread, you need to log in with your Sierra Chart account: