Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //@version=3
- //Awsome Squid Indicator2
- //by Sgjoe123
- //All creding goes to LazyBear for TTM, Woody for CCI and LazyBear, xSilas, Ni6HTH4wK, sco77m4r7in, oh92 for GodMode
- //Indicators originally combined by BlankSpaceisBlank, Sgjoe123 recoded TTM added Divergence function vertical lines.
- //Added slower god mode settings and VIX Fix for finding bottoms by themnis.
- study("Awsome Squid Indicator")
- //Woody CCI///////////////////////////////////////////////////////////////////////////////////////////
- cci14Length = input(title="CCI 14 Length", type=integer, defval=14, minval=7, maxval=14)
- cci50Length = input(title="CCI 50 Length", type=integer, defval=50, minval=20, maxval=50)
- src = input(close, title="Source")
- cciTurbo = cci(src, cci14Length)
- cci14 = cci(src, cci50Length)
- last5IsDown = cci14 < -100
- last5IsZero = cci14 >= -100 and cci14 <= 100
- last5IsUp = cci14 > 100
- histogramColor = last5IsUp ? color(#00FA9A, 70) : last5IsDown ? color(#1E90FF, 70) : last5IsZero ? color(yellow, 80) : color(aqua, 70)
- LineColor = last5IsUp ? color(#00FA9A, 70) : last5IsDown ? color(#1E90FF, 70) : last5IsZero ? color(yellow, 80) : color(aqua, 70)
- cciTurboIsDown = cciTurbo < -100
- cciTurboIsZero = cciTurbo >= -100 and cciTurbo <= 100
- cciTurboIsUp = cciTurbo > 100
- LineColorTurbo = cciTurboIsUp ? color(lime, 10) : cciTurboIsDown ? color(#1E90FF, 1) : cciTurboIsZero ? color(yellow, 10) : cciTurbo < 0 ? color(aqua, 10) : color(aqua, 10)
- plot(cci14, title="CCI 50 Histogram", color=histogramColor, style=area)
- plot(cci14, title="CCI 50", color=LineColor, style=linebr, linewidth=2)
- plot(cciTurbo, title="CCI 14", color=LineColorTurbo, style=linebr, linewidth=2)
- hline(100, title="Hundred Line", color=color(#00CED1, 10), linestyle=dashed)
- hline(-100, title="Minus Line", color=color(#00CED1, 10), linestyle=dashed)
- //TTM///////////////////////////////////////////////////////////////////////////////////////////////////////////
- length = input(title="TTM Length", type=integer, defval=20, minval=0)
- bband(length, mult) =>
- sma(close, length) + mult * stdev(close, length)
- keltner(length, mult) =>
- ema(close, length) + mult * ema(tr, length)
- e1 = (highest(high, length) + lowest(low, length)) / 2 + sma(close, length)
- osc = linreg(close - e1 / 2, length, 0)
- diff = bband(length, 2) - keltner(length, 1)
- osc_color = osc[1] < osc[0] ? osc[0] >= 0 ? #08fd1e : #8bff95 : osc[0] >= 0 ? #ff1010 : #ff7575
- mid_color = diff >= 0 ? na : red
- plot(osc, title = "TTM Histogram", color=osc_color, style=histogram, linewidth=1)
- plot(0, title = "TTM Squeezes", color=mid_color, style=circles, linewidth=2)
- //GODMODE//////////////////////////////////////////////////////////////////////////////////////////////////////
- //study(shorttitle = "SQZMOM_LB", title="Squeeze Momentum Indicator [LazyBear]", overlay=false)
- fastn1 = input(17, "Channel Length")
- fastn2 = input(6, "Average Length")
- fastn3 = input(4, "Short Length")
- enableSecond = input(type = bool, defval = true, title = "Enable Second Godmode Indicator")
- slown1 = input(9, "Slow Channel Length")
- slown2 = input(26, "Slow Average Length")
- slown3 = input(13, "Slow Short Length")
- multi = input(type=bool, defval=false, title="Multi-exchange?")
- src0 = hlc3
- tci(src, n1, n2) => ema((src - ema(src, n1)) / (0.025 * ema(abs(src - ema(src, n1)), n1)), n2)+50
- mf(src, n3) => rsi(sum(volume * (change(src) <= 0 ? 0 : src), n3), sum(volume * (change(src) >= 0 ? 0 : src), n3))
- willy(src, n2) => 60 * (src - highest(src, n2)) / (highest(src, n2) - lowest(src, n2)) + 80
- csi(src, n1, n2, n3) => avg(rsi(src, n3),tsi(src0,n1,n2)*50+50)
- godmode(src, n1, n2, n3) => avg(tci(src, n1, n2), csi(src, n1, n2, n3), mf(src, n3), willy(src, n2))
- tradition(src, n1, n2, n3) => avg(tci(src, n1, n2), mf(src, n3),rsi(src, n3))
- extended(wt2) => wt2 < 20 ? wt2 + 5 : wt2 > 80 ? wt2 - 5 : na
- fastwt1 = godmode(src0, fastn1, fastn2, fastn3)
- fastwt2 = sma(fastwt1,6)
- slowwt1 = godmode(src0, slown1, slown2, slown3)
- slowwt2 = sma(slowwt1, 6)
- fastextended = fastwt2 < 20 ? fastwt2 + 5 : fastwt2 > 80 ? fastwt2 - 5 : na
- slowextended = extended(slowwt2)
- plot(fastextended < 50 ? -350 : fastextended > 50 ? 350 : na, title="Godemode Caution!", color = yellow, transp = 0, style=circles, linewidth=2)
- plot(slowextended < 50 ? -300 : slowextended > 50 ? 300 : na, title = "Godemode Extreme Caution!", color = red, transp = 0, style = circles, linewidth = 2)
- // <========== RSI Divergence ==========>
- osci = rsi(close, 14)
- // Bullish
- bullishPrice = low
- priceMins = bullishPrice > bullishPrice[1] and bullishPrice[1] < bullishPrice[2]
- priceRightMin = valuewhen(priceMins, bullishPrice[1], 0)
- priceLeftMin = valuewhen(priceMins, bullishPrice[1], 1)
- oscRightMin = valuewhen(priceMins, osci[1], 0)
- oscLeftMin = valuewhen(priceMins, osci[1], 1)
- bullishNDiv = priceLeftMin > priceRightMin and oscLeftMin < oscRightMin
- bullishHDiv = priceLeftMin < priceRightMin and oscLeftMin > oscRightMin
- bullishNSig = bullishNDiv and not bullishNDiv[1] and bullishPrice[1] < bullishPrice
- bullishHSig = bullishHDiv and not bullishHDiv[1] and bullishPrice[1] > bullishPrice
- plot(bullishNSig ? -200 : 0, title="Normal Bullish Divergence", style=histogram, linewidth=5, color=green)
- plot(bullishHSig ? 200 : 0, title="Hidden Bullish Divergence", style=histogram, linewidth=2, color=green)
- // Bearish
- bearishPrice = high
- priceMaxs = bearishPrice < bearishPrice[1] and bearishPrice[1] > bearishPrice[2]
- priceRightMax = valuewhen(priceMaxs, bearishPrice[1], 0)
- priceLeftMax = valuewhen(priceMaxs, bearishPrice[1], 1)
- oscRightMax = valuewhen(priceMaxs, osci[1], 0)
- oscLeftMax = valuewhen(priceMaxs, osci[1], 1)
- bearishNDiv = priceLeftMax < priceRightMax and oscLeftMax > oscRightMax
- bearishHDiv = priceLeftMax > priceRightMax and oscLeftMax < oscRightMax
- bearishNSig = bearishNDiv and not bearishNDiv[1] and bearishPrice[1] < bearishPrice
- bearishHSig = bearishHDiv and not bearishHDiv[1] and bearishPrice[1] > bearishPrice
- plot(bearishNSig ? -200 : 0, title="Normal Bearish Divergence", style=histogram, linewidth=5, color=red)
- plot(bearishHSig ? 200 : 0, title="Hidden Bearish Divergence", style=histogram, linewidth=2, color=red)
- // <========== VIX Fix ==========>
- vix = input(false, title="-------VIX Fix Settings-------" )
- pd = input(30, title="LookBack Period Standard Deviation High")
- bbl = input(20, title="Bolinger Band Length")
- mult = input(2.0, minval=1, maxval=5, title="Bollinger Band Standard Devaition Up")
- lb = input(50, title="Look Back Period Percentile High")
- ph = input(.85, title="Highest Percentile - 0.90=90%, 0.95=95%, 0.99=99%")
- new3 = input(false, title="Check Below to turn All Bars Gray, Then Check the Boxes Above, And your will have Same Colors As VixFix")
- sgb = input(false, title="Check Box To Turn Bars Gray?")
- //Criteria for Down Trend Definition for Filtered Pivots and Aggressive Filtered Pivots
- ltLB = input(40, minval=25, maxval=99, title="Long-Term Look Back Current Bar Has To Close Below This Value OR Medium Term--Default=40")
- mtLB = input(14, minval=10, maxval=20, title="Medium-Term Look Back Current Bar Has To Close Below This Value OR Long Term--Default=14")
- str = input(3, minval=1, maxval=9, title="Entry Price Action Strength--Close > X Bars Back---Default=3")
- //Williams Vix Fix Formula
- wvf = ((highest(close, pd)-low)/(highest(close, pd)))*100
- sDev = mult * stdev(wvf, bbl)
- midLine = sma(wvf, bbl)
- lowerBand = midLine - sDev
- upperBand = midLine + sDev
- rangeHigh = (highest(wvf, lb)) * ph
- //Filtered Bar Criteria
- upRange = low > low[1] and close > high[1]
- upRange_Aggr = close > close[1] and close > open[1]
- //Filtered Criteria
- filtered = ((wvf[1] >= upperBand[1] or wvf[1] >= rangeHigh[1]) and (wvf < upperBand and wvf < rangeHigh))
- filtered_Aggr = (wvf[1] >= upperBand[1] or wvf[1] >= rangeHigh[1]) and not (wvf < upperBand and wvf < rangeHigh)
- //Alerts Criteria
- // alert1 = wvf >= upperBand or wvf >= rangeHigh ? 1 : 0
- // alert2 = (wvf[1] >= upperBand[1] or wvf[1] >= rangeHigh[1]) and (wvf < upperBand and wvf < rangeHigh) ? 1 : 0
- alert3 = upRange and close > close[str] and (close < close[ltLB] or close < close[mtLB]) and filtered ? 1 : 0
- alert4 = upRange_Aggr and close > close[str] and (close < close[ltLB] or close < close[mtLB]) and filtered_Aggr ? 1 : 0
- plot(alert3 ? -400 : na, title="VIX Bottom Safer Entry", style = cross, linewidth=2, color = fuchsia)
- plot(alert4 ? -400 : na, title="VIX Bottom Aggressive Entry", style = cross, linewidth = 2, color = orange)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement