AlgoPoint Channels
AlgoPoint Channels
//@version=5
indicator("Reversal Channels [AlgoPoint]", "AlgoPoint - Reversal Channels", overlay
= true)
//------------------------------------------------------------------------------
//Settings
//-----------------------------------------------------------------------------{
length = input.int(200, 'Length', minval = 2)
mult = input.float(6., 'Factor', minval = 0, step = .5)
tf = input.timeframe('', 'Timeframe')
src = input(close, 'Source')
//-----------------------------------------------------------------------------}
//Function
//-----------------------------------------------------------------------------{
pred_ranges(length, mult)=>
var avg = src
var hold_atr = 0.
//-----------------------------------------------------------------------------}
//Calculation
//-----------------------------------------------------------------------------{
[prR2
, prR1
, avg
, prS1
, prS2] = request.security(syminfo.tickerid, tf, pred_ranges(length, mult))
//-----------------------------------------------------------------------------}
//-----------------------------------------------------------------------------}
lengthhh = input.int(10,"Channel Calculation Length", minval=1)
offset = 0
maTypeInput = input.string("SMA", title="MA Type", options=["SMA", "EMA", "SMMA
(RMA)", "WMA", "VWMA"], group="MA Settings")
maLengthInput = input.int(14, title="Smooth", group="MA Settings")
bbMultInput = 2.0
len = 14
stddev = ta.stdev(src, lengthhh)
upper = ta.ema(ta.change(src) <= 0 ? 0 : stddev, len)
lower = ta.ema(ta.change(src) > 0 ? 0 : stddev, len)
rvi = upper / (upper + lower) * 100
ma(source, lengthhh, type) =>
switch type
"SMA" => [ta.sma(source, lengthhh), na, na]
"Bollinger Bands" =>
[middleValue, highValue, lowValue] = ta.bb(source, lengthhh,
bbMultInput)
[middleValue, highValue, lowValue]
"EMA" => [ta.ema(source, lengthhh), na, na]
"SMMA (RMA)" => [ta.rma(source, lengthhh), na, na]
"WMA" => [ta.wma(source, lengthhh), na, na]
"VWMA" => [ta.vwma(source, lengthhh), na, na]
//Plots
//-----------------------------------------------------------------------------{
plot_pru2 = plot(prR2, 'PR Upper 2', avg != avg[1] ? na : #f2364615)
plot_pru1 = plot(prR1, 'PR Upper 1', avg != avg[1] ? na : #f2364600)
plot_pravg = plot(avg , 'PR Average', avg != avg[1] ? na : #ffffff15)
plot_prl1 = plot(prS1, 'PR Lower 1', avg != avg[1] ? na : #08998100)
plot_prl2 = plot(prS2, 'PR Lower 2', avg != avg[1] ? na : #08998115)
plotupperlevel = plot(uplevellerr, title="Upper Reversal", color=Redcolor)
plotdownlevel = plot(percentagecalinvert, title="Lower Reversal", color=Greencolor)
//Fills
fill(plot_pru2, plot_pru1, avg != avg[1] ? na : color.new(#f23645, 90))
fill(plot_prl1, plot_prl2, avg != avg[1] ? na : color.new(#089981, 90))
//text inputs
var user_consensus = input.string(defval="", title="By going to
algopoint.mysellix.io or by clicking on the link in the algopoint instagram bio you
can get the leaked codes for all premium indicators like Elite Algo, EzAlgo and
LuxAlgo. Free products are also available! algopoint.mysellix.io", confirm = true,
group="AlgoPoint")
title = 'AlgoPoint'
subtitle = 'All Leaked Algos \n Instagram: algopoint \n Website:
algopoint.mysellix.io \n FREE'
textVPosition = 'middle'
textHPosition = 'center'
symVPosition = 'top'
symHPosition = 'left'
width = 0
height = 0
c_title = #b2b5be80
s_title = 'large'
a_title = 'center'
c_subtitle = #b2b5be80
s_subtitle = 'normal'
a_subtitle = 'center'
c_bg = color.new(color.blue, 100)
//text watermark creation
textstylist = table.new(textVPosition + '_' + textHPosition, 1, 3)
table.cell(textstylist, 0, 0, title, width, height, c_title, a_title,
text_size=s_title, bgcolor=c_bg)
table.cell(textstylist, 0, 1, subtitle, width, height, c_subtitle, a_subtitle,
text_size=s_subtitle, bgcolor=c_bg)