lonestar108

Squeeze Momentum + Godmode 9/26/52 + Laguerre RSI + VIX + Willy

Squeeze Momentum + Godmode 9/26/52 + Laguerre RSI + VIX             + Willy
Remove from Favorite Scripts Add to Favorite Scripts
study(shorttitle = "Squeeze Momentum + Godmode 9/26/52 + Laguerre RSI + VIX + Willy", title="Squeeze Momentum + Godmode 9/26/52 + Laguerre RSI + VIX + Willy", overlay=false)

n1 = input(9, "Channel Length")
n2 = input(26, "Average Length")
n3 = input(52, "Short length")
multi = input(type=bool, defval=false, title="Multi-exchange?")
src0 = hlc3
 
src1 = security("BITFINEX:BTCUSD", period, src0), src2 = security("BTCE:BTCUSD", period, src0)
src3 = security("OKCOIN:BTCUSD", period, src0), src4 = security("HUOBI:BTCCNY", period, src0)
 
tci(src) => ema((src - ema(src, n1)) / (0.025 * ema(abs(src - ema(src, n1)), n1)), n2)+50
mf(src) => rsi(sum(volume * (change(src) <= 0 ? 0 : src), n3), sum(volume * (change(src) >= 0 ? 0 : src), n3))
willy(src) => 60 * (src - highest(src, n2)) / (highest(src, n2) - lowest(src, n2)) + 80
csi(src) => avg(rsi(src, n3),tsi(src0,n1,n2)*50+50)
 
godmode(src) => avg(tci(src),csi(src),mf(src),willy(src))
tradition(src) => avg(tci(src),mf(src),rsi(src, n3))
 
wt1 = multi?avg(godmode(src0),godmode(src1),godmode(src2),godmode(src3),godmode(src4)):tradition(src0)
wt2 = sma(wt1,6)
 
extended = wt2<20 ? (wt2+5)/10 : wt2>80 ? (wt2-5)/10 : na
 
plot((wt1/3)-13, color=purple, style=histogram, linewidth=3)
plot((wt2/3)-13, color=purple, style=histogram, linewidth=3)
//plot(ema(((wt1-wt2)/5) -5,n3), color=aqua, style=area, transp=80)
plot(extended, title="Caution!", color=yellow, style=circles, linewidth=2)
 
hline(80)
hline(60)
hline(40)
hline(20)

// -----------------

pd = input(22, 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%")
pl = input(1.01, title="Lowest Percentile - 1.10=90%, 1.05=95%, 1.01=99%")
hp = input(false, title="Show High Range - Based on Percentile and LookBack Period?")
sd = input(false, title="Show Standard Deviation Line?")

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
rangeLow = (lowest(wvf, lb)) * pl


col = wvf >= upperBand or wvf >= rangeHigh ? yellow : gray


plot(hp and rangeHigh ? rangeHigh/2 : na, title="Range High Percentile", style=line, linewidth=4, color=orange)
plot(hp and rangeLow ? rangeLow/2 : na, title="Range High Percentile", style=line, linewidth=4, color=orange)
plot(wvf >= upperBand or wvf >= rangeHigh ? wvf /2 : na, title="Williams Vix Fix", style=histogram, linewidth = 4, color=col)
plot(sd and upperBand ? upperBand/2 : na, title="Upper Band", style=line, linewidth = 3, color=aqua)

// ------------------

length = input(20, title="BB Length")
lengthKC=input(20, title="KC Length")
multKC = input(1.5, title="KC MultFactor")

useTrueRange = input(true, title="Use TrueRange (KC)", type=bool)

// Calculate BB
source = close
basis = sma(source, length)
dev = multKC * stdev(source, length)
upperBB = basis + dev
lowerBB = basis - dev

// Calculate KC
ma = sma(source, lengthKC)
range = useTrueRange ? tr : (high - low)
rangema = sma(range, lengthKC)
upperKC = ma + rangema * multKC
lowerKC = ma - rangema * multKC

sqzOn  = (lowerBB > lowerKC) and (upperBB < upperKC)
sqzOff = (lowerBB < lowerKC) and (upperBB > upperKC)
noSqz  = (sqzOn == false) and (sqzOff == false)

val = linreg(source  -  avg(avg(highest(high, lengthKC), lowest(low, lengthKC)),sma(close,lengthKC)), 
            lengthKC,0) / 4

bcolor = iff( val > 0, green, maroon)
//bcolor = gray

scolor = noSqz ? blue : sqzOn ? black : gray 
plot(val, color=bcolor, style=histogram, linewidth=4, transp=50)
plot(0, color=scolor, style=cross, linewidth=1)


// -----------------------

//setups
h = high
l = low
c = close
//inputs
g = input(0.75, title="Gamma")
ob = input(0.80,title="Over Bought")
os = input(0.20,title="Over Sold")
smooth = input(1,minval=1,title="Smoothing (1 = off)")
coloring = input(true,type=bool,title="3 colors?")
//calc
p = c
L0 = ((1 - g)*p)+(g*nz(L0[1]))
L1 = (-g*L0)+nz(L0[1])+(g*nz(L1[1]))
L2 = (-g*L1)+nz(L1[1])+(g*nz(L2[1]))
L3 = (-g*L2)+nz(L2[1])+(g*nz(L3[1]))
cu = (L0>L1?L0-L1:0)+(L1>L2?L1-L2:0)+(L2>L3?L2-L3:0)
cd = (L0<L1?L1-L0:0)+(L1<L2?L2-L1:0)+(L2<L3?L3-L2:0)
//plots
lrsi=ema((cu+cd==0?-1:cu+cd)==-1?0:(cu/(cu+cd==0?-1:cu+cd)), smooth)

minmax = lrsi > lrsi[1] and lrsi > os ? 0 : lrsi < lrsi[1] and lrsi < ob ? 0 : 1
minmax2 = lrsi > lrsi[1] and lrsi > os ? 0 : lrsi < lrsi[1] and lrsi < ob ? 0 : lrsi < os ? 0 : lrsi > ob ? 0 : 1

col1 =  lrsi > lrsi[1] and lrsi > os ? #00FF7B : lrsi < lrsi[1] and lrsi < ob ? #FF3571 : lrsi == lrsi ? #ECA700 : #ECA700
col2 =  lrsi > lrsi[1] and lrsi > os ? #00FF7B : lrsi < lrsi[1] and lrsi < ob ? #FF3571 : lrsi < os ? #FF3571 : lrsi > ob ? #00FF7B : lrsi == lrsi ? #ECA700 : #ECA700
coll = coloring ? col1 : col2
plot(lrsi*3, color=coll, linewidth=3,style=line)

// ---------------------------

length2 = input(21, minval=1)
upper = highest(length2)
lower = lowest(length2)
out = 10 * (close - upper) / (upper - lower)
src = out, len = input(13, minval=1, title="Length")
out2 = ema(out, len)
plot(out + 5, color=red, linewidth=2)
plot(out2 + 5, title="EMA", color=maroon, linewidth=2)

what does the black candle in the inceptor represent?
+2 Reply
Hey, This looks great! Excellent work! I use it for spotting short opportunities. Would you mind adding a link to an explanation how to use it? Thanks a lot!
Reply
Could you please post some rules...?? That would be helpful. Thanks.
Reply
thank you :) how did you get the volume profile?
Reply
United States
United Kingdom
India
Deutschland
France
España
Italia
Polska
Türkiye
Россия
Brasil
Indonesia
Malaysia
ประเทศไทย
Việt Nam
日本
한국
简体
繁體
Home Stock Screener Forex Signal Finder Cryptocurrency Signal Finder Economic Calendar How It Works Chart Features House Rules Moderators Website & Broker Solutions Widgets Stock Charting Library Feature Request Blog & News FAQ Help & Wiki Twitter
Profile Profile Settings Account and Billing My Support Tickets Priority Support Contact Support Ideas Published Followers Following Private Messages Chat Sign Out