Warrir thunderbolt Indicator BB EMA VWAP PIVOT
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Stock_Warrior
//@version=4
study(title="Warrior Thunderbolt Indicator", shorttitle="WTI", overlay=true)
showpivot = input(defval = true, title="Show Pivot Points")
showEMA9 = input(title="Show EMA9", type=input.bool, defval=true)
showEMA20 = input(title="Show EMA20", type=input.bool, defval=true)
showEMA50 = input(title="Show EMA50", type=input.bool, defval=true)
showEMA100 = input(title="Show EMA100", type=input.bool, defval=true)
showEMA200 = input(title="Show EMA200", type=input.bool, defval=true)
showVWAP = input(title="Show VWAP", type=input.bool, defval=true)
showBB = input(title="Show BB", type=input.bool, defval=true)
prevDH = input(true, title="Show previous Day high?")
prevDL = input(true, title="show previous Day low?")
EMA9_Len = input(9, minval=1, title="EMA9_Length")
EMA9_src = input(close, title="EMA9_Source")
//EMA9_offset = input(title="EMA9_Offset", type=input.integer, defval=0, minval=-500, maxval=500)
EMA9_out = ema(EMA9_src, EMA9_Len)
plot(showEMA9 ? EMA9_out:na, title="EMA9", color=color.yellow, offset=0)
EMA20_Len = input(20, minval=1, title="EMA20_Length")
EMA20_src = input(close, title="EMA20_Source")
//EMA20_offset = input(title="EMA20_Offset", type=input.integer, defval=0, minval=-500, maxval=500)
EMA20_out = ema(EMA20_src, EMA20_Len)
plot(showEMA20 ? EMA20_out:na, title="EMA20", color=color.blue, offset=0)
EMA50_Len = input(50, minval=1, title="EMA50_Length")
EMA50_src = input(close, title="EMA50_Source")
//EMA50_offset = input(title="EMA50_Offset", type=input.integer, defval=0, minval=-500, maxval=500)
EMA50_out = ema(EMA50_src, EMA50_Len)
plot(showEMA50 ? EMA50_out:na, title="EMA50", color=color.green, offset=0)
EMA100_Len = input(100, minval=1, title="EMA100_Length")
EMA100_src = input(close, title="EMA100_Source")
//EMA100_offset = input(title="EMA100_Offset", type=input.integer, defval=0, minval=-500, maxval=500)
EMA100_out = ema(EMA100_src, EMA100_Len)
plot(showEMA100 ? EMA100_out:na, title="EMA100", color=color.red, offset=0)
EMA200_Len = input(200, minval=1, title="EMA200_Length")
EMA200_src = input(close, title="EMA200_Source")
//EMA200_offset = input(title="EMA200_Offset", type=input.integer, defval=0, minval=-500, maxval=500)
EMA200_out = ema(EMA20_src, EMA200_Len)
plot(showEMA200 ? EMA200_out:na, title="EMA200", color=color.lime, offset=0)
// Get user input
vwaplength= input(title="VWAP Length", type=input.integer, defval=1)
cvwap = ema(vwap,vwaplength)
plotvwap = plot(showVWAP ? cvwap : na,title="VWAP",color=color.orange, transp=0, linewidth=2)
length = input(20, minval=1)
src = input(close, title="BB_Source")
mult = input(2.0, minval=0.001, maxval=50, title="BB_StdDev")
basis = sma(src, length)
dev = mult * stdev(src, length)
upper = basis + dev
lower = basis - dev
offset = input(0, "Offset", type = input.integer, minval = -500, maxval = 500)
plot(showBB ? basis : na, "Basis", color=#872323, offset = offset)
p1 = plot(showBB ? upper : na, "Upper", color=color.teal, offset = offset)
p2 = plot(showBB ? lower: na, "Lower", color=color.teal, offset = offset)
fill(p1, p2, title = "Background", color=#198787, transp=95)
//previous day
prevDayHigh = security(syminfo.tickerid, 'D', high[1], lookahead=true)
prevDayLow = security(syminfo.tickerid, 'D', low[1], lookahead=true)
//previous day Plots
plot( prevDH and prevDayHigh ? prevDayHigh : na, title="Prev Day High", style=plot.style_stepline, linewidth=2, color=color.red, transp=0)
plot( prevDL and prevDayLow ? prevDayLow : na, title="Prev Day Low", style=plot.style_stepline, linewidth=2, color=color.green, transp=0)
// colours for the chart
col0 = #6666ff
col1 = #ebdc87
col2 = #ffa36c
col3 = #d54062
colD = #799351
res = input(title="Resolution", type=input.resolution, defval="D")
h = security(syminfo.tickerid, res, high[1], barmerge.gaps_off, barmerge.lookahead_on)
l = security(syminfo.tickerid, res, low[1], barmerge.gaps_off, barmerge.lookahead_on)
c = security(syminfo.tickerid, res, close[1], barmerge.gaps_off, barmerge.lookahead_on)
// Pivot Range Calculations: Fibonac0
pivot = (h + l + c) / 3.0
plotF = input(defval=false, title="Plot 0.236", type=input.bool)
supp0 = (pivot - (0.236 * (h - l)))
supp1 = (pivot - (0.382 * (h - l)))
supp2 = (pivot - (0.618 * (h - l)))
supp3 = (pivot - (1 * (h - l)))
res0 = (pivot + (0.236 * (h - l)))
res1 = (pivot + (0.382 * (h - l)))
res2 = (pivot + (0.618 * (h - l)))
res3 = (pivot + (1 * (h - l)))
plot(showpivot ? pivot : na, title="D Pivot", style=plot.style_stepline, color=color.black, linewidth=2)
plot(plotF ? supp0 : na, title="0.236", style=plot.style_stepline, color=color.orange , linewidth=1)
plot(showpivot ? supp1 : na, title="S1", style=plot.style_stepline, color=color.orange, linewidth=1)
plot(showpivot ? supp2 : na , title="S2", style=plot.style_stepline, color=color.orange, linewidth=1)
plot(showpivot ? supp3 : na, title="S3", style=plot.style_stepline, color=color.orange, linewidth=1)
plot(plotF ? res0 : na, title="0.236", style=plot.style_stepline, color=color.orange, linewidth=1)
plot(showpivot ? res1 : na, title="R1", style=plot.style_stepline, color=color.orange, linewidth=1)
plot(showpivot ? res2 : na, title="R2", style=plot.style_stepline, color=color.orange, linewidth=1)
plot(showpivot ? res3 : na, title="R3", style=plot.style_stepline, color=color.orange, linewidth=1)
If you like the post,please share this
Read More Add your Comment 0 comments