Hello,
I’m interested if its possible to convert this indicator from TradingView and import it into ProRealTime.
On this indicator the length parameter controls how long the lines are like with Moving Average, mult controls how the line fits to the price but can affect the length and channel spread, spread value changes the channel spread like the Envelopes indicator.
The indicator can have some issues on TradingView where larger price values will require to use lower length and higher mult instead, so the point parameter is used to fix the indicator when using it on high market price values or when the indicator exhibits a weird behaviour.
Lastly the extrapolate parameter is there to show possible future price positions respective to the channels.
All info is in the original post:
https://www.tradingview.com/script/J4ccCRMW-Linear-Channels/
Thank you.
//@version=4
study("Linear Channels",overlay=true)
length = input(14),mult=input(50),spread = input(1,"Channels Spreading"),point = input(false),extrapolate = input(true)
//----
a = 0.
s = point ? syminfo.pointvalue*10*(1/length) : syminfo.mintick*100*(1/length)
x = open + change(nz(a[1],open))*mult
a := x > nz(a[1],x) + s ? nz(a[1],x) + s : x < nz(a[1],x) - s ? nz(a[1],x) - s : nz(a[1],x)
//----
upper = 0.
lower = 0.
Up = a + abs(change(a))*(mult*spread)
Dn = a - abs(change(a))*(mult*spread)
upper := Up == a ? nz(upper[1]) : Up
lower := Dn == a ? nz(lower[1]) : Dn
//----
n = bar_index
if barstate.islast and extrapolate == true
line A = line.new(n[1],upper[1],n,upper,extend=extend.right,color=#0080FF,style=line.style_dashed,width=2)
line B = line.new(n[1],a[1],n,a,extend=extend.right,color=#e65100,style=line.style_dashed,width=2)
line C = line.new(n[1],lower[1],n,lower,extend=extend.right,color=#ff1100,style=line.style_dashed,width=2)
line.delete(A[1])
line.delete(B[1])
line.delete(C[1])
plot(upper,color=#0080FF,linewidth=2,transp=0)
plot(a,color=#e65100,linewidth=2,transp=0)
plot(lower,color=#ff1100,linewidth=2,transp=0)