Yes sir, you can definitely create a Keltner Channel in Pine Script.
A Keltner Channel generally consists of a middle EMA and upper and lower bands calculated using ATR.
You can create it using:
//@version=6
indicator(“Custom Keltner Channel”, overlay=true)`
emaLength = input.int(20, “EMA Length”)
atrLength = input.int(10, “ATR Length”)
multiplier = input.float(2.0, “ATR Multiplier”)
middle = ta.ema(close, emaLength)
atrValue = ta.atr(atrLength)
upper = middle + atrValue * multiplier
lower = middle – atrValue * multiplier
middlePlot = plot(middle, “Middle”)
upperPlot = plot(upper, “Upper”)
lowerPlot = plot(lower, “Lower”)
fill(upperPlot, lowerPlot, color=color.new(color.blue, 90))`
-> The middle line is calculated using EMA.
-> ATR determines the distance of the upper and lower bands.
-> The multiplier controls the width of the channel.
-> The fill() function highlights the area between the two bands.
So thatβs how you can create a basic Keltner Channel in Pine Script.