Login Page - Create Account

Support Board


Date/Time: Mon, 21 Apr 2025 13:05:42 +0000



Intraday - Average True Range (ATR) Bands/Envleope/Channel, How To Do This?

View Count: 192

[2025-04-14 16:29:38]
User708541 - Posts: 135
I want to plot the ATR of say the 15min chart (with 20 bars of data) as bands/channels, high and low. Something like Keltner Channels but based on the ATR of a set number of past bars. I experimented with the Bands/Envelope Study and based the study on the ATR but this doesn't seem to work. If this is possible with SC can you guide me on how to do this?

Thank you.
[2025-04-14 17:05:27]
User708541 - Posts: 135
I think I need to provide a bit more context of what I'm looking to do. When I put the ATR study on my chart, in Chart Region #2 it gives me a value. Let's say the value is 20.
I then want to create a channel on my chart that is 20 above the price and 20 below the price, and continually fluctuates as the ATR study, in Chart Region #2 fluctuates.
I know Keltner Channels are based on the ATR so, this is similar, but I only want the actual ATR, from the ATR study plotted as channels.
[2025-04-15 05:58:36]
Sierra_Chart Engineering - Posts: 19285
Have a look at using the arithmetic studies to do the additional calculations:
Using the Basic Arithmetic Studies
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-15 13:35:07]
User708541 - Posts: 135
Support,
Your suggestion should work but I'm having difficulty. The lines are always plotting at 0. Here's what I have done:
Insert Study: Average True Range in Subgraph 2 (That works perfectly)
I want to add the value of the ATR, in subgraph 1 above and below the current 'last' price as a band or channel

Insert Study: Study Subgraph Multiply:
Based On: Average True Range
Multiplier set to 1
Chart Region 1
I tried Hide Study and Visible

Insert Study: Study Subgraph Multiply:
Based On: Average True Range
Multiplier set to -1
Chart Region 1
I tried Hide Study and Visible

This didn't work. It only plotted a straight line at 0
So I added:


Insert Study: Study Subgraph Add:
Based On: Study Subgraph Multiply (the study where it multiplies x1)
Amount to Add set to 0
Chart Region 1

Insert Study: Study Subgraph Subtract:
Based On: Study Subgraph Multiply (the study where it multiplies x-1)
Amount to Add set to 0
Chart Region 1

Doing this also resulted in lines plotted at 0
So, I'm most likely doing something wrong.
I'm trying to get the value of the ATR to plot above and below the current 'last' price in the form of a channel.
What am I doing wrong?

Thank you for your assistance.
[2025-04-15 14:41:28]
Sawtooth - Posts: 4209
Try this:
Use the Spreadsheet Formula study, set the Chart Region to 1, and use a formula like this in its Formula field:
=C+ID1.SG1
where ID1 is the ATR study.

Add another Spreadsheet Formula study, with a formula like this:
=C-ID1.SG1
[2025-04-15 21:39:30]
John - SC Support - Posts: 39362
What Sawtooth states will work. But we want to point out that you are making things way to hard with what you are thinking.

To use the arithmetic study, you would use the "Study Subgraphs Add" and add together the Main Price Graph Close/Last and the ATR study. Refer to the following:
Study Subgraphs Add
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2025-04-16 02:34:59]
User708541 - Posts: 135
Support,
Thanks for the clarification however, something is not correct.
I've tried both Sawtooth's approach and your approach and I'm getting different results.

Your method, using both Study Subgraphs Add & Study Subgraphs Difference the channels created are one bar off. The Sawtooth/Spreadsheet method provides the correct channel.
I've enclosed a screen shot showing the results.
The black lines are from the Spreadsheet Formula study and the red lines are from the Study Subgraphs Add and Difference.
This is the 15 min ES from today (April 15, 2025).
Date Time Of Last Edit: 2025-04-16 02:36:27
imageATR Channels_2 methods.jpg / V - Attached On 2025-04-16 02:34:46 UTC - Size: 276.15 KB - 18 views
[2025-04-16 17:20:24]
John - SC Support - Posts: 39362
Make sure you do not have a "Displacement" offset in the subgraphs for the "Study Subgraphs Add/Subtract". Refer to the following:
Chart Studies: Subgraphs Tab >> Displacement

Otherwise, there is no reason why these would be different. There has to be something in the setup causing this.
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2025-04-17 14:36:15]
User708541 - Posts: 135
My Subgraph settings for displacement were 0.
But when I change the displacement to -1, for both Study Subgraph Add/Difference, then they align with the Spreadsheet formula.
So, I think either there is something wrong with the setup or, the displacement needs to be set to -1.

Enclosed is a screenshot showing how both methods align. The red lines are the Subgraph Add/Difference now set to displacement of -1
imageATR Channels_2 methods_-1 Dispacement.jpg / V - Attached On 2025-04-17 14:36:05 UTC - Size: 267.47 KB - 6 views
[2025-04-17 14:40:02]
John - SC Support - Posts: 39362
Please get us that chart so we can take a look. These should be lining up from the outset. Follow these instructions to get us the chart:
Support Board Posting Information: Providing Chartbook with Only a Single Chart
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2025-04-17 15:33:00]
cmet - Posts: 690
Have a look at this. Might be what you're looking for. Put in ACS_Source and compile. ATR in subgraph 2 is there for reference. ATR calc is done within study.
Date Time Of Last Edit: 2025-04-17 15:33:44
attachmentCustom_ATR_Bands.cpp - Attached On 2025-04-17 15:32:32 UTC - Size: 1.69 KB - 10 views
imageCustom ATR Bands.jpg / V - Attached On 2025-04-17 15:32:35 UTC - Size: 198.74 KB - 15 views
[2025-04-17 17:00:41]
User708541 - Posts: 135
Support,
I'm enclosing the requested Chartbook. For the Study Subgraphs Add/Difference I put the Displacement back to 0 so you can see that their is a 1 bar alignment issue with the Spreadsheet studies suggested by Sawtooth.
attachmentChartbook_For Sierra Support-01.Cht - Attached On 2025-04-17 16:58:14 UTC - Size: 4.81 KB - 5 views
[2025-04-17 17:06:07]
User708541 - Posts: 135
cmet, that is exactly what I'm looking to do. I was able to do it successfully using the Spreadsheet Formula study as suggested by Sawtooth (see above). SC Support also suggested a method, using Study Subgraphs Add and Difference studies, but their method is not giving the proper results.
[2025-04-17 18:29:56]
John - SC Support - Posts: 39362
For the "Study Subgraphs Add/Subtract" you are not using the Close/Last of the Main Price graph. You have it entered as ID0.SG1, which is the "Open" of the bar. If you change this to the Last, then everything lines up as it should.
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing

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

Login

Login Page - Create Account