# Plot horizontal line at keltner channel

#### nrod21

##### New member
Hello, im looking for a script that plots a horizontal line at 3atr on a keltner channel. Of course i can manually do it but i was looking for something that would auto update with each time frame selected

Pic included of example

Solution
Hello, im looking for a script that plots a horizontal line at 3atr on a keltner channel. Of course i can manually do it but i was looking for something that would auto update with each time frame selected

Pic included of example

View attachment 21012

This will plot a horizontal line in the expansion and within the bars by input line_length.
The image also shows the Keltner Channels indicator.

Code:
``````#Keltner Channel Upper/Lower 3ATR Horizontal Lines

input line_length = 5;#Distance plot made within bars; Otherwise plot just in expansion

def kc3u = if IsNaN(close[-1]) and !IsNaN(close) then (KeltnerChannels(factor = 3.0).Upper_Band) else kc3u[1];
plot kc3upper = kc3u[-line_length]...``````
Hello, im looking for a script that plots a horizontal line at 3atr on a keltner channel. Of course i can manually do it but i was looking for something that would auto update with each time frame selected

Pic included of example

View attachment 21012

This will plot a horizontal line in the expansion and within the bars by input line_length.
The image also shows the Keltner Channels indicator.

Code:
``````#Keltner Channel Upper/Lower 3ATR Horizontal Lines

input line_length = 5;#Distance plot made within bars; Otherwise plot just in expansion

def kc3u = if IsNaN(close[-1]) and !IsNaN(close) then (KeltnerChannels(factor = 3.0).Upper_Band) else kc3u[1];
plot kc3upper = kc3u[-line_length];
kc3upper.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);

def kc3l = if IsNaN(close[-1]) and !IsNaN(close) then (KeltnerChannels(factor = 3.0).Lower_Band) else kc3l[1];
plot kc3lower = kc3l[-line_length];
kc3lower.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);

input bubble = yes;
input bubblemover = 2;
def   mover = bubble and IsNaN(close[bubblemover]) and !IsNaN(close[bubblemover + 1]);

#``````

Hello, im looking for a script that plots a horizontal line at 3atr on a keltner channel. Of course i can manually do it but i was looking for something that would auto update with each time frame selected

Pic included of example

please elaborate, i don't know what this means.
a horizontal line at 3atr on a keltner channel..

what is the condition to start drawing the line?
how many bars does it plot?

87k+ Posts
303 Online

## The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
• Exclusive indicators
• Proven strategies & setups
• Private Discord community
• Exclusive members-only content
• 1 full year of unlimited support

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?