// 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 2.0", shorttitle="WTI 2.0", overlay=true) showpivot = input(defval = false, title="Show CPR") showVWAP = input(title="Show VWAP", type=input.bool, defval=false) showVWMA = input(title="Show VWMA", type=input.bool, defval=false) showPSAR = input(title="Show PSAR", type=input.bool, defval=false) showBB = input(title="Show BB", type=input.bool, defval=false) showEMA9 = input(title="Show EMA-9", type=input.bool, defval=false) showEMA20 = input(title="Show EMA-20", type=input.bool, defval=false) showEMA50 = input(title="Show EMA-50", type=input.bool, defval=false) showEMA100 = input(title="Show EMA-100", type=input.bool, defval=false) showSMA9 = input(title="Show SMA-9", type=input.bool, defval=false) showSMA20 = input(title="Show SMA -20", type=input.bool, defval=false) showSMA50 = input(title="Show SMA-50", type=input.bool, defval=false) showSMA100 = input(title="Show SMA-100", type=input.bool, defval=false) showwMA9 = input(title="Show WMA-9", type=input.bool, defval=false) showwMA20 = input(title="Show WMA-20", type=input.bool, defval=false) showwMA50 = input(title="Show WMA-50", type=input.bool, defval=false) showwMA100 = input(title="Show WMA-100", type=input.bool, defval=false) ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////// EMA - 9/20/50/100 /////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////// 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(close, 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(close, 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(close, EMA50_Len) plot(showEMA50 ? EMA50_out:na, title="EMA50", color=color.fuchsia, 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(close, EMA100_Len) plot(showEMA100 ? EMA100_out:na, title="EMA100", color=color.aqua, offset=0) ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////// SMA - 9/20/50/100 /////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////// SMA9_Len = input(9, minval=1, title="SMA9_Length") //SMA9_src = input(close, title="SMA9_Source") //SMA9_offset = input(title="SMA9_Offset", type=input.integer, defval=0, minval=-500, maxval=500) SMA9_out = sma(close, SMA9_Len) plot(showSMA9 ? SMA9_out:na, title="SMA9", color=color.green, offset=0) SMA20_Len = input(20, minval=1, title="SMA20_Length") //SMA20_src = input(close, title="SMA20_Source") //SMA20_offset = input(title="SMA20_Offset", type=input.integer, defval=0, minval=-500, maxval=500) SMA20_out = sma(close, SMA20_Len) plot(showSMA20 ? SMA20_out:na, title="SMA20", color=color.red, offset=0) SMA50_Len = input(50, minval=1, title="SMA50_Length") //SMA50_src = input(close, title="SMA50_Source") //SMA50_offset = input(title="SMA50_Offset", type=input.integer, defval=0, minval=-500, maxval=500) SMA50_out = sma(close, SMA50_Len) plot(showSMA50 ? SMA50_out:na, title="SMA50", color=color.olive, offset=0) SMA100_Len = input(100, minval=1, title="SMA100_Length") //SMA100_src = input(close, title="SMA100_Source") //SMA100_offset = input(title="SMA100_Offset", type=input.integer, defval=0, minval=-500, maxval=500) SMA100_out = sma(close, SMA100_Len) plot(showSMA100 ? SMA100_out:na, title="SMA100", color=color.maroon, offset=0) ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////// WMA - 9/20/50/100 /////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////// wMA9_Len = input(9, minval=1, title="wMA9_Length") //wMA9_src = input(close, title="wMA9_Source") //wMA9_offset = input(title="wMA9_Offset", type=input.integer, defval=0, minval=-500, maxval=500) wMA9_out = wma(close, wMA9_Len) plot(showwMA9 ? wMA9_out:na, title="wMA9", color=color.navy, offset=0) wMA20_Len = input(20, minval=1, title="wMA20_Length") //wMA20_src = input(close, title="wMA20_Source") //wMA20_offset = input(title="wMA20_Offset", type=input.integer, defval=0, minval=-500, maxval=500) wMA20_out = wma(close, wMA20_Len) plot(showwMA20 ? wMA20_out:na, title="wMA20", color=color.olive, offset=0) wMA50_Len = input(50, minval=1, title="wMA50_Length") //wMA50_src = input(close, title="wMA50_Source") //wMA50_offset = input(title="wMA50_Offset", type=input.integer, defval=0, minval=-500, maxval=500) wMA50_out = wma(close, wMA50_Len) plot(showwMA50 ? wMA50_out:na, title="wMA50", color=color.purple, offset=0) wMA100_Len = input(100, minval=1, title="wMA100_Length") //wMA100_src = input(close, title="wMA100_Source") //wMA100_offset = input(title="wMA100_Offset", type=input.integer, defval=0, minval=-500, maxval=500) wMA100_out = wma(close, wMA100_Len) plot(showwMA100 ? wMA100_out:na, title="wMA100", color=color.gray, offset=0) ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////// VWAP ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////// //vwaplength = input(title="VWAP Length", type=input.integer, defval=1) //cvwap = ema(vwap,vwaplength) cvwap1 = vwap(hlc3) plotvwap = plot(showVWAP ? cvwap1 : na,title="VWAP",color=color.black, transp=0, linewidth=2) ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////// VWMA ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////// vwma_length = 20 //input(title="VWMA Length", type=input.integer, defval=1) vwma_1 = vwma(close,vwma_length) plotvwma = plot(showVWMA ? vwma_1 : na, title="VWMA", color=color.blue, transp=0, linewidth=2) ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////// PARABOLIC SAR ////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////// start = 0.02 //input(0.02) increment = 0.02 //input(0.02) maximum = 0.2 //input(0.2, "Max Value") psar_out = sar(start, increment, maximum) plot(showPSAR ? psar_out : na, "ParabolicSAR", style=plot.style_cross, color=#2196f3) ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////// BOLLINGER BAND//////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////// length = 20 //input(20, minval=1) src = close //input(close, title="BB_Source") mult = 2 //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 p1 = plot(showBB ? upper : na, "Upper", color=color.teal, editable=false) p2 = plot(showBB ? lower: na, "Lower", color=color.teal, editable=false) plot(showBB ? basis : na, "Basis", color=#872323, editable=false) fill(p1, p2, title = "Background", color=#198787, transp=95)