Rain On Me

Rain On Me is a technical indicator that started with a simple idea of bringing together a maximum of indicators that can perform together in a single indicator. Perfect for beginners who wish to improve their knowledge of the tools available to them in this indicator through their curiosity in addition to the explanations already provided and started trading on a demo account for example.

Rain On Me Indicator in action on Dow Jones Index.

Screenshot taken from the Settings menu of Rain On Me Indicator.

Here is the complete list of indicators present in this indicator :

  • ATR
  • Parabolic SAR
  • RSI Divergences
  • Ichimoku Cloud
  • Bollinger
  • MA Cross
  • Trendline
  • Fibonacci

All indicators have their original default settings. You need to be able to readjust them depending on the market instrument you want to analyze. You have the possibility to put alerts which will notify you when an indicator gives a new signal. When placing an alert, be sure to choose the “once per bar” option each time you place an alert.

Rate this Indicator?

Click on a star to rate it!

Average rating 3 / 5. Vote count: 2

No votes so far! Be the first to rate this Indicator.

3
(2)

Or copy / paste the source code into your pine editor :

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © RickSimpson
//@version=4

study(title="Rain On Me Indicator", shorttitle='ROM', overlay=true, max_bars_back=300)

//Inputs

showbs     = input(defval=true,  title="Show Buy/Sell Labels?")
showpsar   = input(defval=false, title="Show PSAR Labels?")
showdivs2  = input(defval=true,  title="Show RSI Divergences?")
showichi   = input(defval=true,  title="Show Ichimoku?")
showbb     = input(defval=false, title="Show Bollinger?")
showtrline = input(defval=true,  title="Show Trendline?")
showfib    = input(defval=true,  title="Show Fibonacci?")

//Divergances

//Settings

rsilenght   = 14
smoothing   = 3
rsi         = rsi(close, rsilenght)
smoothedrsi = ema(rsi,   smoothing)
sltype      = ("SMA LinReg")
sllength    = 21
x           = bar_index
y           = rsi
x_          = sma(x, sllength)
y_          = sma(y, sllength)
px          = stdev(x, sllength)
py          = stdev(y, sllength)
c           = correlation(x, y, sllength)
slope       = c * (py / px)
inter       = y_ - slope * x_
sl          = x * slope + inter
sl1         = sl
divinput0   = close
divinput1   = smoothedrsi
divinput2   = sl

//Calculation

f_top_fractal(_close) =>
    _close[4] < _close[2] and _close[3] < _close[2] and _close[2] > _close[1] and 
       _close[2] > _close[0]
f_bot_fractal(_close) =>
    _close[4] > _close[2] and _close[3] > _close[2] and _close[2] < _close[1] and 
       _close[2] < _close[0]
f_fractalize(_close) =>
    f_bot_fractal__1 = f_bot_fractal(_close)
    f_top_fractal(_close) ? 1 : f_bot_fractal__1 ? -1 : 0

fractal_top2 = f_fractalize(divinput2) > 0 ? divinput2[2] : na
fractal_bot2 = f_fractalize(divinput2) < 0 ? divinput2[2] : na
high_prev2   = valuewhen(fractal_top2, divinput2[2], 0)[2]
high_price2  = valuewhen(fractal_top2, high[2], 0)[2]
low_prev2    = valuewhen(fractal_bot2, divinput2[2], 0)[2]
low_price2   = valuewhen(fractal_bot2, low[2], 0)[2]
bearish_div2 = fractal_top2 and high[2] > high_price2 and divinput2[2] < high_prev2
bullish_div2 = fractal_bot2 and low[2]  < low_price2  and divinput2[2] > low_prev2
col3         = showdivs2 and bearish_div2 ? #FA0000FA : na
col4         = showdivs2 and bullish_div2 ? #00FF00FA : na

//Plotting

plot(title="Bearish Divergence", series=(showdivs2 and fractal_top2) ? high[2] : na, color=col3, linewidth=2, offset=0)
plot(title="Bullish Divergence", series=(showdivs2 and fractal_bot2) ? low[2]  : na, color=col4, linewidth=2, offset=0)

//Alerts

alertcondition(bearish_div2, title="Bearish Divergence", message='Bearish Divergence')
alertcondition(bullish_div2, title="Bullish Divergence", message='Bullish Divergence')

//ATR

//Inputs

atrper  = input(defval=14, title="ATR Period")
atrmult = input(defval=2,  title="ATR Multiplier", type=input.float, minval=0.5, maxval=100, step=0.1)

//Settings

emasrc     = hlc3
emalen     = 200
useemacond = false
emaline    = ema(emasrc, emalen)
ratr       = atr(atrper)
nl         = atrmult * ratr

//Calculation

ratrts   = float(na)
ratrts  := iff(close > nz(ratrts[1], 0) and close[1] > nz(ratrts[1], 0), max(nz(ratrts[1]), close - nl), iff(close < nz(ratrts[1], 0) and close[1] < nz(ratrts[1], 0), min(nz(ratrts[1]), close + nl), iff(close > nz(ratrts[1], 0), close - nl, close + nl)))
indir    = int(na)
indir   := iff(close[1] < nz(ratrts[1], 0) and close > nz(ratrts[1], 0), 1, iff(close[1] > nz(ratrts[1], 0) and close < nz(ratrts[1], 0) and (useemacond ? close < emaline : true), -1, nz(indir[1], 0)))
posbear  = false
posbear := nz(posbear[1], false)
posbull  = false
posbull := nz(posbull[1], false)
sell     = not posbear and indir == -1
buy      = not posbull and indir ==  1

if sell
    posbull := false
    posbear := true
    posbear

if buy
    posbull := true
    posbear := false
    posbear

//Plotting

plotshape(showbs ? sell : na, title="Sell", style=shape.labeldown, location=location.abovebar, size=size.tiny, text="SELL", textcolor=color.white, color=color.red,   transp=0)
plotshape(showbs ? buy  : na, title="Buy",  style=shape.labelup,   location=location.belowbar, size=size.tiny, text="BUY",  textcolor=color.white, color=color.green, transp=0)

//Alerts

alertcondition(sell, title="Sell",  message='Sell')
alertcondition(buy,  title="Buy",   message='Buy')

//Parabolic SAR

//Inputs

start     = input(defval=0.02, title="PSAR Start",     step=0.001)
increment = input(defval=0.02, title="PSAR Increment", step=0.001)
maximum   = input(defval=0.2,  title="PSAR Maximum",   step=0.01)

//Settings

useema        = false
slowemalength = 1
fastemalength = 1
psartrend     = sar(start, increment, maximum)
ema           = ema(close, slowemalength)
fastema       = ema(close, fastemalength)
rsi2          = rsi(close, 14)
 
//Calculation

psarup = high[1] < psartrend[2] and high >= psartrend[1] and close > ema and fastema > ema and
   useema or not useema and high[1] < psartrend[2] and high >= psartrend[1] or
   useema and crossover(fastema[2], ema[2]) and fastema > ema and close > psartrend
psardown = low[1] > psartrend[2] and low <= psartrend[1] and close < ema and fastema < ema and useema or
   not useema and low[1] > psartrend[2] and low <= psartrend[1] or
   useema and crossunder(fastema[2], ema[2]) and rsi2 > 30 and fastema < ema and
   close < psartrend
 
//Plotting

plot(cross(fastema, ema) ? fastema : na, style=plot.style_cross, linewidth=4, color=ema > fastema ? color.red : color.green, transp=useema ? 10 : 100, editable=true)
plotshape(showpsar ? psardown : na, title="PSAR Down", text="PSAR", style=shape.labeldown, location=location.abovebar, color=color.red,   size=size.tiny, textcolor=color.white, transp=0)
plotshape(showpsar ? psarup   : na, title="PSAR Up",   text="PSAR", style=shape.labelup,   location=location.belowbar, color=color.green, size=size.tiny, textcolor=color.white, transp=0)
 
//Alerts

alertcondition(psardown, title="PSAR Down", message='PSAR Down')
alertcondition(psarup,   title="PSAR Up",   message='PSAR Up')

//Moving Average

//Inputs

maperiods1 = input(defval=7,     title="WMA 1")
maperiods2 = input(defval=21,    title="WMA 2")
maperiods3 = input(defval=50,    title="SMA")
hidema1    = input(defval=false, title="Hide WMA 1")
hidema2    = input(defval=false, title="Hide WMA 2")
hidema3    = input(defval=true,  title="Hide SMA")

//Settings

color_1  = color.new(color.black, 100)
ma1color = hidema1 ? color_1 : color.new(color.blue, 0)
color_2  = color.new(color.black, 100)
ma2color = hidema2 ? color_2 : color.new(color.orange, 0)
color_3  = color.new(color.black, 100)
ma3color = hidema3 ? color_3 : color.new(color.purple, 0)

//Calculation

ma1 = wma(close, maperiods1)
ma2 = wma(close, maperiods2)
ma3 = sma(close, maperiods3)

//Plotting

plot(ma1, title="WMA 1", color=ma1color, linewidth=2)
plot(ma2, title="WMA 2", color=ma2color, linewidth=2)
plot(ma3, title="SMA",   color=ma3color, linewidth=2)

//Alerts

alertcondition(crossover(ma1, ma2) or crossunder(ma1, ma2), title="WMA1 and WMA2 Cross", message='WMA1 and WMA2 Cross')

//Fibonacci (Original Code Author @ QuantNomad - Ultimate Pivot Points Alerts at https://www.tradingview.com/script/l53FXt9D-QuantNomad-Ultimate-Pivot-Points-Alerts/)

//Settings

is_newbar(res) =>
    ch = 0
    if(res == 'Y')
        t  = year(time('D'))
        ch := change(t) != 0 ? 1 : 0
    else
        t = time(res)
        ch := change(t) != 0 ? 1 : 0
    ch

nround(x) => 
    n = round(x / syminfo.mintick) * syminfo.mintick
    
RoundToTick(_price) => round(_price / syminfo.mintick) * syminfo.mintick

//Inputs

pp_period = input(defval="Day", title="Fibonacci Period", type=input.string, options=['Day','Week','Month','Year'])

//Constants

pp_type                = "Fibonacci"
show_historical_levels = false
show_level_value       = true

//Calculation

pp_res = pp_period == 'Day' ? 'D' : pp_period == 'Week' ? 'W' : pp_period == 'Month' ? 'M' : 'Y' 

open_cur  = 0.0
open_cur := is_newbar(pp_res) ? open : open_cur[1]
popen     = 0.0
popen    := is_newbar(pp_res) ? open_cur[1] : popen[1]
high_cur  = 0.0
high_cur := is_newbar(pp_res) ? high : max(high_cur[1], high)
phigh     = 0.0
phigh    := is_newbar(pp_res) ? high_cur[1] : phigh[1]
low_cur   = 0.0
low_cur  := is_newbar(pp_res) ? low : min(low_cur[1], low)
plow      = 0.0
plow     := is_newbar(pp_res) ? low_cur[1] : plow[1]
pclose    = 0.0
pclose   := is_newbar(pp_res) ? close[1] : pclose[1]

//Pivots

PP = 0.0
R1 = 0.0, R2 = 0.0, R3 = 0.0, R4 = 0.0, R5 = 0.0, R6 = 0.0, R7 = 0.0, R8 = 0.0, R9 = 0.0, R10 = 0.0
S1 = 0.0, S2 = 0.0, S3 = 0.0, S4 = 0.0, S5 = 0.0, S6 = 0.0, S7 = 0.0, S8 = 0.0, S9 = 0.0, S10 = 0.0
  
if (pp_type == "Fibonacci")
    PP  := (phigh + plow + pclose) / 3
    R1  := PP + (phigh - plow) * 0.235
    S1  := PP - (phigh - plow) * 0.235
    R2  := PP + (phigh - plow) * 0.382
    S2  := PP - (phigh - plow) * 0.382
    R3  := PP + (phigh - plow) * 0.5
    S3  := PP - (phigh - plow) * 0.5
    R4  := PP + (phigh - plow) * 0.618
    S4  := PP - (phigh - plow) * 0.618
    R5  := PP + (phigh - plow) * 0.728
    S5  := PP - (phigh - plow) * 0.728
    R6  := PP + (phigh - plow) * 1.000
    S6  := PP - (phigh - plow) * 1.000
    R7  := PP + (phigh - plow) * 1.235
    S7  := PP - (phigh - plow) * 1.235
    R8  := PP + (phigh - plow) * 1.328
    S8  := PP - (phigh - plow) * 1.328
    R9  := PP + (phigh - plow) * 1.5
    S9  := PP - (phigh - plow) * 1.5
    R10 := PP + (phigh - plow) * 1.618
    S10 := PP - (phigh - plow) * 1.618

bars_sinse  = 0
bars_sinse := is_newbar(pp_res) ? 0 : bars_sinse[1] + 1

//Plotting Pivots Levels

vpp_p  = showfib ? line.new(bar_index[min(bars_sinse, 300)], PP,  bar_index, PP, color=color.gray,   style = line.style_dashed, extend = extend.right) : na
vs1_p  = showfib ? line.new(bar_index[min(bars_sinse, 300)], S1,  bar_index, S1, color=color.red,    style =  line.style_solid, extend = extend.right) : na
vs2_p  = showfib ? line.new(bar_index[min(bars_sinse, 300)], S2,  bar_index, S2, color=color.red,    style =  line.style_solid, extend = extend.right) : na
vs3_p  = showfib ? line.new(bar_index[min(bars_sinse, 300)], S3,  bar_index, S3, color=color.red,    style =  line.style_solid, extend = extend.right) : na
vs4_p  = showfib ? line.new(bar_index[min(bars_sinse, 300)], S4,  bar_index, S4, color=color.red,    style =  line.style_solid, extend = extend.right) : na
vs5_p  = showfib ? line.new(bar_index[min(bars_sinse, 300)], S5,  bar_index, S5, color=color.red,    style =  line.style_solid, extend = extend.right) : na
vs6_p  = showfib ? line.new(bar_index[min(bars_sinse, 300)], S6,  bar_index, S6, color=color.red,    style =  line.style_solid, extend = extend.right) : na
vs7_p  = showfib ? line.new(bar_index[min(bars_sinse, 300)], S7,  bar_index, S7, color=color.red,    style =  line.style_solid, extend = extend.right) : na
vs8_p  = showfib ? line.new(bar_index[min(bars_sinse, 300)], S8,  bar_index, S8, color=color.red,    style =  line.style_solid, extend = extend.right) : na
vs9_p  = showfib ? line.new(bar_index[min(bars_sinse, 300)], S9,  bar_index, S9, color=color.red,    style =  line.style_solid, extend = extend.right) : na
vs10_p = showfib ? line.new(bar_index[min(bars_sinse, 300)], S10, bar_index, S10, color=color.red,   style =  line.style_solid, extend = extend.right) : na
vr1_p  = showfib ? line.new(bar_index[min(bars_sinse, 300)], R1,  bar_index, R1, color=color.green,  style =  line.style_solid, extend = extend.right) : na
vr2_p  = showfib ? line.new(bar_index[min(bars_sinse, 300)], R2,  bar_index, R2, color=color.green,  style =  line.style_solid, extend = extend.right) : na
vr3_p  = showfib ? line.new(bar_index[min(bars_sinse, 300)], R3,  bar_index, R3, color=color.green,  style =  line.style_solid, extend = extend.right) : na
vr4_p  = showfib ? line.new(bar_index[min(bars_sinse, 300)], R4,  bar_index, R4, color=color.green,  style =  line.style_solid, extend = extend.right) : na
vr5_p  = showfib ? line.new(bar_index[min(bars_sinse, 300)], R5,  bar_index, R5, color=color.green,  style =  line.style_solid, extend = extend.right) : na
vr6_p  = showfib ? line.new(bar_index[min(bars_sinse, 300)], R6,  bar_index, R6, color=color.green,  style =  line.style_solid, extend = extend.right) : na
vr7_p  = showfib ? line.new(bar_index[min(bars_sinse, 300)], R7,  bar_index, R7, color=color.green,  style =  line.style_solid, extend = extend.right) : na
vr8_p  = showfib ? line.new(bar_index[min(bars_sinse, 300)], R8,  bar_index, R8, color=color.green,  style =  line.style_solid, extend = extend.right) : na
vr9_p  = showfib ? line.new(bar_index[min(bars_sinse, 300)], R9,  bar_index, R9, color=color.green,  style =  line.style_solid, extend = extend.right) : na
vr10_p = showfib ? line.new(bar_index[min(bars_sinse, 300)], R10, bar_index, R10, color=color.green, style =  line.style_solid, extend = extend.right) : na

//Delete Previous Lines

if (not is_newbar(pp_res) or not show_historical_levels)
    line.delete(vpp_p[1])
    line.delete(vs1_p[1])
    line.delete(vs2_p[1])
    line.delete(vs3_p[1])
    line.delete(vs4_p[1])
    line.delete(vs5_p[1])
    line.delete(vs6_p[1])
    line.delete(vs7_p[1])
    line.delete(vs8_p[1])
    line.delete(vs9_p[1])
    line.delete(vs10_p[1])
    line.delete(vr1_p[1])
    line.delete(vr2_p[1])
    line.delete(vr3_p[1])
    line.delete(vr4_p[1])
    line.delete(vr5_p[1])
    line.delete(vr6_p[1])
    line.delete(vr7_p[1])
    line.delete(vr8_p[1])
    line.delete(vr9_p[1])
    line.delete(vr10_p[1])

//Plotting Labels

label_vpp  = showfib ? label.new(bar_index, PP,  text=show_level_value ? ("                                  0      "  + " " +    tostring(nround(PP)))  : "P",   style= label.style_none, textcolor = color.gray)  : na
label_vs1  = showfib ? label.new(bar_index, S1,  text=show_level_value ? ("                                  0.235      " + " " + tostring(nround(S1)))  : "S1",  style= label.style_none, textcolor = color.red)   : na
label_vs2  = showfib ? label.new(bar_index, S2,  text=show_level_value ? ("                                  0.382      " + " " + tostring(nround(S2)))  : "S2",  style= label.style_none, textcolor = color.red)   : na
label_vs3  = showfib ? label.new(bar_index, S3,  text=show_level_value ? ("                                  0.5      " + " " +   tostring(nround(S3)))  : "S3",  style= label.style_none, textcolor = color.red)   : na
label_vs4  = showfib ? label.new(bar_index, S4,  text=show_level_value ? ("                                  0.618      " + " " + tostring(nround(S4)))  : "S4",  style= label.style_none, textcolor = color.red)   : na
label_vs5  = showfib ? label.new(bar_index, S5,  text=show_level_value ? ("                                  0.728      " + " " + tostring(nround(S5)))  : "S5",  style= label.style_none, textcolor = color.red)   : na
label_vs6  = showfib ? label.new(bar_index, S6,  text=show_level_value ? ("                                  1.000      " + " " + tostring(nround(S6)))  : "S6",  style= label.style_none, textcolor = color.red)   : na
label_vs7  = showfib ? label.new(bar_index, S7,  text=show_level_value ? ("                                  1.235      " + " " + tostring(nround(S7)))  : "S7",  style= label.style_none, textcolor = color.red)   : na
label_vs8  = showfib ? label.new(bar_index, S8,  text=show_level_value ? ("                                  1.328      " + " " + tostring(nround(S8)))  : "S8",  style= label.style_none, textcolor = color.red)   : na
label_vs9  = showfib ? label.new(bar_index, S9,  text=show_level_value ? ("                                  1.5      " + " " +   tostring(nround(S9)))  : "S9",  style= label.style_none, textcolor = color.red)   : na
label_vs10 = showfib ? label.new(bar_index, S10, text=show_level_value ? ("                                  1.618      " + " " + tostring(nround(S10))) : "S10", style= label.style_none, textcolor = color.red)   : na
label_vr1  = showfib ? label.new(bar_index, R1,  text=show_level_value ? ("                                  0.235      " + " " + tostring(nround(R1)))  : "R1",  style= label.style_none, textcolor = color.green) : na
label_vr2  = showfib ? label.new(bar_index, R2,  text=show_level_value ? ("                                  0.382      " + " " + tostring(nround(R2)))  : "R2",  style= label.style_none, textcolor = color.green) : na
label_vr3  = showfib ? label.new(bar_index, R3,  text=show_level_value ? ("                                  0.5      " + " " +   tostring(nround(R3)))  : "R3",  style= label.style_none, textcolor = color.green) : na
label_vr4  = showfib ? label.new(bar_index, R4,  text=show_level_value ? ("                                  0.618      " + " " + tostring(nround(R4)))  : "R4",  style= label.style_none, textcolor = color.green) : na
label_vr5  = showfib ? label.new(bar_index, R5,  text=show_level_value ? ("                                  0.728      " + " " + tostring(nround(R5)))  : "R5",  style= label.style_none, textcolor = color.green) : na
label_vr6  = showfib ? label.new(bar_index, R6,  text=show_level_value ? ("                                  1.000      " + " " + tostring(nround(R6)))  : "R6",  style= label.style_none, textcolor = color.green) : na
label_vr7  = showfib ? label.new(bar_index, R7,  text=show_level_value ? ("                                  1.235      " + " " + tostring(nround(R7)))  : "R7",  style= label.style_none, textcolor = color.green) : na
label_vr8  = showfib ? label.new(bar_index, R8,  text=show_level_value ? ("                                  1.328      " + " " + tostring(nround(R8)))  : "R8",  style= label.style_none, textcolor = color.green) : na
label_vr9  = showfib ? label.new(bar_index, R9,  text=show_level_value ? ("                                  1.5      " + " " +   tostring(nround(R9)))  : "R9",  style= label.style_none, textcolor = color.green) : na
label_vr10 = showfib ? label.new(bar_index, R10, text=show_level_value ? ("                                  1.618      " + " " + tostring(nround(R10))) : "R10", style= label.style_none, textcolor = color.green) : na

//Delete Previous Labels  
    
label.delete(label_vpp[1])
label.delete(label_vs1[1])
label.delete(label_vs2[1])
label.delete(label_vs3[1])
label.delete(label_vs4[1])
label.delete(label_vs5[1])
label.delete(label_vs6[1])
label.delete(label_vs7[1])
label.delete(label_vs8[1])
label.delete(label_vs9[1])
label.delete(label_vs10[1])
label.delete(label_vr1[1])
label.delete(label_vr2[1])
label.delete(label_vr3[1])
label.delete(label_vr4[1])
label.delete(label_vr5[1])
label.delete(label_vr6[1])
label.delete(label_vr7[1])
label.delete(label_vr8[1])
label.delete(label_vr9[1])
label.delete(label_vr10[1])

//Alerts

alertcondition(not is_newbar(pp_res) and crossover(close,  S2), "Fib Bear Trend Crossover 0.382",  'Fib Bear Trend Crossover 0.382')
alertcondition(not is_newbar(pp_res) and crossover(close,  S3), "Fib Bear Trend Crossover 0.5",    'Fib Bear Trend Crossover 0.5')
alertcondition(not is_newbar(pp_res) and crossover(close,  S4), "Fib Bear Trend Crossover 0.618",  'Fib Bear Trend Crossover 0.618')
alertcondition(not is_newbar(pp_res) and crossover(close,  R2), "Fib Bull Trend Crossover 0.382",  'Fib Bull Trend Crossover 0.382')
alertcondition(not is_newbar(pp_res) and crossover(close,  R3), "Fib Bull Trend Crossover 0.5",    'Fib Bull Trend Crossover 0.5')
alertcondition(not is_newbar(pp_res) and crossover(close,  R4), "Fib Bull Trend Crossover 0.618",  'Fib Bull Trend Crossover 0.618')

alertcondition(not is_newbar(pp_res) and crossunder(close, S2), "Fib Bear Trend Crossunder 0.382", 'Fib Bear Trend Crossunder 0.382')
alertcondition(not is_newbar(pp_res) and crossunder(close, S3), "Fib Bear Trend Crossunder 0.5",   'Fib Bear Trend Crossunder 0.5')
alertcondition(not is_newbar(pp_res) and crossunder(close, S4), "Fib Bear Trend Crossunder 0.618", 'Fib Bear Trend Crossunder 0.618')
alertcondition(not is_newbar(pp_res) and crossunder(close, R2), "Fib Bull Trend Crossunder 0.382", 'Fib Bull Trend Crossunder 0.382')
alertcondition(not is_newbar(pp_res) and crossunder(close, R3), "Fib Bull Trend Crossunder 0.5",   'Fib Bull Trend Crossunder 0.5')
alertcondition(not is_newbar(pp_res) and crossunder(close, R4), "Fib Bull Trend Crossunder 0.618", 'Fib Bull Trend Crossunder 0.618')

//Ichimoku

//Inputs

conversionPeriods   = input(defval=9,   title="Ichimoku Conversion Line Periods", minval=1)
basePeriods         = input(defval=103, title="Ichimoku Base Line Periods",       minval=1)
laggingSpan2Periods = input(defval=52,  title="Ichimoku Lagging Span 2 Periods",  minval=1)
displacement        = input(defval=26,  title="Ichimoku Displacement",            minval=1)

//Settings

donchian(len) => avg(lowest(len), highest(len))
conversionLine = donchian(conversionPeriods)
baseline       = donchian(basePeriods)
leadline1      = avg(conversionLine, baseline)
leadline2      = donchian(laggingSpan2Periods)

//Plotting

plot(baseline, title="BaseLine", color=color.new(#991515, 0))
plot(showichi ? close : na, title="Lagging Span/Barney", color=color.new(#9C27B0, 100), linewidth=0, offset=-displacement)
p1ichi=plot(showichi ? leadline1 : na, title="Lead 1",   color=color.new(color.green, 100), offset=displacement)
p2ichi=plot(showichi ? leadline2 : na, title="Lead 2",   color=color.new(color.red, 100),   offset=displacement)
fill(p1ichi, p2ichi, title="Ichimoku Cloud", color=leadline1 > leadline2 ? color.new(color.aqua, 65) : color.new(color.purple, 65))

//Bollinger

//Inputs

srcbb = input(defval=close, title="Bollinger Source")
lenbb = input(defval=20,    title="Bollinger SMA",      minval=1)
mult  = input(defval=2,     title="Bollinger SD",       minval=0.001, maxval=50)
tol2  = input(defval=0,     title="BB Color Tolerance", minval=0,     type=input.float)

//Settings

basis = sma(srcbb, lenbb)
dev   = mult * stdev(srcbb, lenbb)

//Calculation

upper = basis + dev
lower = basis - dev

//Plotting

pl1 = plot(showbb and upper ? upper : na, title="Bands UP",  color=color.new(color.black, 0), linewidth=3)
pl2 = plot(showbb and lower ? lower : na, title="Bands LOW", color=color.new(color.black, 0), linewidth=3)
fill(pl1, pl2)

//Trendline

//Inputs

highertf = input(defval="", title="Trendline Resolution", type=input.resolution)

//Settings

tlsrc = close
tf    = 1440
len   = timeframe.isintraday and timeframe.multiplier >= 1 ? 
   tf / timeframe.multiplier * 7 : 
   timeframe.isintraday and timeframe.multiplier < 60 ? 
   60 / timeframe.multiplier * 24 * 7 : 7
   
//calculation   

ma        = ema(tlsrc * volume, len) / ema(volume, len)
p         = security(syminfo.tickerid, highertf, ma[1], lookahead=true)
lineColor = close > p[1] ? color.new(color.lime, 0) : color.new(color.red, 0)

//Plotting

plot(showtrline ? p : na, color=lineColor, linewidth=2)

//Upgrade

upgrade = input(defval=true, title="UPGRADE TO V2 ? : https://tradingview.com/script/Ix450pxu")

The content covered on this website is NOT investment advice and I am not a financial advisor.