Login Page - Create Account

Support Board


Date/Time: Sat, 04 May 2024 03:49:02 +0000



[User Discussion] - Missing Open to Close(Last) Range in "High/Low for Time Period" study

View Count: 771

[2022-12-12 07:27:44]
User665858 - Posts: 3
Dear Support,

I need to identify the range between the highest Open and lowest Close within a time period or lowest Open and highest Close.
High/Low is no problem with the "High/Low for Time Period" studies, but does not help me here.
Please see attached image for more details.

Is there any other function / study I missed that could accomplish that?
Or would that be a enhancement for the "High/Low for Time Period" studies.

Thanks for your help.

BR Jens M.
imageSnapshot OPEN CLOSE study question.png / V - Attached On 2022-12-12 07:21:13 UTC - Size: 55.33 KB - 105 views
Attachment Deleted.
[2022-12-12 17:56:59]
John - SC Support - Posts: 31362
The High/Low for Time Period is the study to use. Just change the Input for Input Data High to Open and Input Data Low to Close to get the highest open and the lowest close.

Then use another copy of the study with those Inputs reversed to get the Highest Close and Lowest Open.
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2022-12-14 13:43:43]
User710679 - Posts: 43
Sometimes the open is the highest, but other times the close is the highest...is there any way to display only the highest of both: open or close?
thanks
[2022-12-14 15:18:57]
Sawtooth - Posts: 3993
is there any way to display only the highest of both: open or close?
There is a workaround that uses an additional chart, and several studies.
If you're interested in this solution, post again.
[2022-12-14 15:22:07]
User710679 - Posts: 43
Yes please. I would be interested in that solution
[2022-12-14 15:38:16]
User665858 - Posts: 3
Dear Support,

the idea with two High/Low indicators is nice, but anyway if have two configure two indicators to then manually disable two out of possible four lines this is not very efficient.
A. I can draw them manually faster
B. I can not use the alerts against these lines since I do not know upfront which are valid. So more manual interaction needed for potential automation.

Is there an other way?
Would you update your High/Low Indicators as a change request?
Should I provide an alternative indicator based on the provided source for High/Low?

The solution is needed for Defined Rage (DR) and Implied Defined Range (iDR) calculations what is currently a very hot topic in futures trading.
[2022-12-14 18:28:33]
Sawtooth - Posts: 3993
Attached is an example chartbook that creates a DR/IDR equivalent, using several studies.

The DR is the same as the Initial Balance or Opening H/L Range of n minutes.
The IDR is the Opening Max(O,C) / Min(O,C) Range of n minutes.
Date Time Of Last Edit: 2022-12-16 22:43:44
attachmentDR-IDR.cht - Attached On 2022-12-16 22:43:33 UTC - Size: 5.94 KB - 96 views
[2023-07-18 13:36:16]
User117222 - Posts: 9
@tomgib

Thank you for your Post #8. I've been able to recreate the DR IDR study based on the studies in your .CHT file. It looks great!

One thing I was struggling with was to create the DR IDR Extension Target Lines. Their calculation is based on the Standard Deviations of the Range b/w the IDR High & IDR Low (For the Regular NY session). 10 lines are plotted above that in 0.5 increments - starting at 0.5 till 5 Std deviations. Similarly, 10 lines are plotted on the negative side, starting at -0.5 till -5 std Dev.

While I'm able to use a Price Projection Tool temporarily - this is manual, and quite laborious. Backtesting with this is very cumbersome too.

I explored various Studies in SC like Std Deviation Bands, Pivot Points, etc., but was quite lost on how to achieve this.

Any pointers?

I've attached 2 screenshots from a Trading View Indicator which illustrates this. The output is similar to what Pivot Points lines look like, but they are based on the calculation described above.

Many thanks
imageDR IDR Std Deviation Target Lines - Positive.png / V - Attached On 2023-07-18 13:35:03 UTC - Size: 91.91 KB - 77 views
imageDR IDR Std Deviation Target Lines - Negative.png / V - Attached On 2023-07-18 13:35:12 UTC - Size: 84.25 KB - 78 views
[2023-07-19 05:16:17]
Sawtooth - Posts: 3993
Since you want to draw 20 lines, use the Spreadsheet Study study.
- Set the Number of Formula Columns to 20 (each column is a subgraph, starting in column K)
- You could use this spreadsheet function in the formulas:
https://www.sierrachart.com/index.php?page=doc/SpreadsheetFunctions.html#STDEV_Function

Working out all of the details is beyond what I can share in a forum post.
Date Time Of Last Edit: 2023-07-19 05:17:52
[2023-07-20 10:49:25]
User117222 - Posts: 9
Thank you @tomgib. All your guidance is much appreciated.

Quick question: If I wanted to create only 2 or 3 Std Dev levels (instead of 20), would you recommend any other study that's better for this?

P.s. Been trying the Spreadsheet Study in the meantime. Struggling to insert the STD DEV formula & the levels it needs to calculate from, but will keep trying. Will create a separate post to seek help on that as needed.

Many thanks indeed.
[2023-07-20 14:36:10]
Sawtooth - Posts: 3993
If I wanted to create only 2 or 3 Std Dev levels (instead of 20), would you recommend any other study that's better for this?
You could use multiple instances of the Spreadsheet Formula study.
(Note: Despite its name, this is not a spreadsheet study. It uses Alert syntax.)

However, it's not 'better' than the Spreadsheet Study, in that the formula will the same, but using a different syntax.

You could use the Spreadsheet Formula study for a portion of the formula, then use the Standard Deviation study Based On the Spreadsheet Formula study. But now you have two more studies per line, when the Spreadsheet Study does it all, because it has up to 60 subgraphs.

You may also need to dynamically limit the Length, in which case you might be limited to using the Spreadsheet Study study.
And you'll only want to display the line when the IDR is <> 0.
Since I don't know the all of the conditions, I can't offer much more.
[2023-07-20 15:45:59]
User117222 - Posts: 9
Thank you @tomgilb

I was able to make this work with the Spreadsheet Formula Study. Working beautifully so far! Much appreciated
[2023-07-24 08:53:42]
User117222 - Posts: 9
Hi @tomgilb @SCSupport

The overall DR/IDR levels created using the mix of various studies (based on the earlier .CHT file shared by @tomgilb) is working well.

I'm trying to refine this further, but I'm a little stuck.

There is a Shaded Box that's created between 930am and 1030am, which highlights the area between the IDR High & Low. This standard Grey shading is working fine.

However, I'm trying to get this area to be shaded Green if the Closing Price at 1030am is > Opening Price at 930am (and Red vice versa)

I'm using the following Alerts formula in the Shaded study:

=AND((C>O), BARTIME >= TIME(9, 30, 0), BARTIME <= TIME(10, 29, 59))

... and created 2 such studies - one Green (for C>O) & one Red (for O>C)

But, for some reason, Both Green AND Red shading is appearing on ALL boxes, rendering the Alert ineffective.

Any suggestions on what I'm doing wrong?

Many thanks
[2023-07-24 14:24:30]
Sawtooth - Posts: 3993
Any suggestions on what I'm doing wrong?
You would need to create persistent variables of the Open price at 9:30:00 and of the Close price at 10:29:59.

You could do that with the Spreadsheet Formula study, using formulas like these in their Formula fields:
=IF(AND(BARTIME>=TIME(9,30,0),BARTIME<TIME(9,30,1)),O,ID21.SG1[-1])
=IF(AND(BARTIME>=TIME(10,25,0),BARTIME<TIME(10,25,1)),C,ID22.SG1[-1])
where the Open persistent Spreadsheet Formula study is ID21, and the Close study is ID22.
(the Close study formula assumes a 5 minute chart.)

Then reference these persistent variables' studies instead of C,O
[2023-07-24 15:57:08]
User117222 - Posts: 9
Thank you @tomgilb

Performed all these steps. I think I'm very close, but something's off. I'm seeing the shading in the Area around and below, but not the intended space (between the IDR, from 930am till 1030am).

I've attached a Screenshot fyi.

I've implemented the following steps:

Step 1. Created 2 new Spreadsheet Formula Studies

ID.86 with this formula in the Formula Field: =IF(AND(BARTIME>=TIME(9,30,0),BARTIME<TIME(9,30,1)),O,ID86.SG1[-1])
ID.87 with this formula in the Formula field: =IF(AND(BARTIME>=TIME(10,25,0),BARTIME<TIME(10,25,1)),C,ID87.SG1[-1])

Step 2. I've then created a new Study Subgraphs Reference Study with:

Input Study 1: ID86.SG1
Input Study 2: ID87.SG1

In the Alerts Tab: I've inserted the following Alert Condition:
=AND((ID87.SG1>ID86.SG1), BARTIME >= TIME(9, 30, 0), BARTIME <= TIME(10, 29, 59))

Subgraphs Tab:
SG1 is set to Transparent Fill Top
SG2 is set to Transparent Fill Bottom


Still not working bizarrely. I guess I'm very close, just something small is off. Any suggestions?

Really appreciate all your help.
Thank you.
imageIDR shading Screenshot.png / V - Attached On 2023-07-24 15:55:30 UTC - Size: 92.29 KB - 68 views
[2023-07-24 17:06:15]
Sawtooth - Posts: 3993
Try these formulas instead:
=IF(AND(BARTIME>=TIME(9,30,0),BARTIME<TIME(9,30,1)),O,IF(ID7.SG1=0,0,ID86.SG1[-1]))
=IF(AND(BARTIME>=TIME(10,25,0),BARTIME<TIME(10,25,1)),C,IF(ID7.SG1=0,0,ID87.SG1[-1]))
where ID7 is the 'IDR time range top' High/Low For Time Period study.

The second IF releases the persistent variable beyond the IDR times.
[2023-07-25 13:15:21]
User117222 - Posts: 9
Thank you @tomgilb

Sadly, this didn't work. I'm now simply getting one green background line behind the 1025am bar, that's it.

Also, that single bar background still shades green, even if the 930 Open is > 1030 close (which should shade red - using a separate study & formula of course).

I'm conscious of using up too much of your time for this.

Perhaps whenever you get a free minute this week, you could incorporate this into your existing .CHT file (which you posted in this forum earlier) and re-post that here. That'll ensure it works perfectly, and I'll be able to follow your calculation logic & import the relevant studies. This will benefit many others too.

Many thanks indeed
[2023-07-27 01:28:26]
Sawtooth - Posts: 3993
Perhaps whenever you get a free minute this week...
Go here for an updated DR/IDR chartbook, with a spreadsheet file:
https://www.sawtoothtrade.com/free-stuff-21.html

This is built using the Spreadsheet Study study, and includes IDR direction shading and IDR extension lines.

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account