Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Tradingview.com
- // @author LazyBear, xSilas, Ni6HTH4wK,
- // Drop a line if you use or modify this code.
- // modified by sco77m4r7in and oh92 -- updated and fixed multi exchange error, and added addtional caution dots.
- // modified by scilentor, integrated LSMA indicator with settings 25, 0
- // modified by RoadTo23Million to include timeframe multiplier
- study(title="Custom Timeframe Godmode3.2+LSMA")
- n1 = input(9, "Channel Length")
- n2 = input(6, "Average Length")
- n3 = input(3, "Short length")
- lsma_length = input(title="LSMA Length", type=integer, defval=32)
- lsma_offset = input(title="LSMA Offset", type=integer, defval=0)
- tfm = input(title="Timeframe multiplier", type=integer, defval=1)
- src0 = hlc3
- tci(src) => ema((src - ema(src, n1 * tfm)) / (0.025 * ema(abs(src - ema(src, n1 * tfm)), n1 * tfm)), n2 * tfm)+50
- mf(src) => rsi(sum(volume * (change(src) <= 0 ? 0 : src), n3 * tfm), sum(volume * (change(src) >= 0 ? 0 : src), n3 * tfm))
- willy(src) => 60 * (src - highest(src, n2 * tfm)) / (highest(src, n2 * tfm) - lowest(src, n2 * tfm)) + 80
- csi(src) => avg(rsi(src, n3 * tfm),tsi(src0,n1 * tfm,n2 * tfm)*50+50)
- godmode(src) => avg(tci(src),csi(src),mf(src),willy(src))
- tradition(src) => avg(tci(src),mf(src),rsi(src, n3 * tfm))
- wt1 = godmode(src0)
- wt2 = sma(wt1,6)
- extended = wt2<25 ? wt2+5 : wt2>75 ? wt2-5 : na
- extended2 = wt2<20 ? wt2+5 : wt2>80 ? wt2-5 : na
- extended3 = wt2<15 ? wt2+5 : wt2>85 ? wt2-5 : na
- plot(wt1, color=green)
- plot(wt2, color=red)
- plot(ema((wt1-wt2)*2+50,n3 * tfm), color=aqua, style=area, transp=80, histbase=50)
- plot(extended, title="Caution!", color=aqua, style=circles, linewidth=2)
- plot(extended2, title="Caution!", color=yellow, style=circles, linewidth=2)
- plot(extended3, title="Caution!", color=red, style=circles, linewidth=3)
- hline(80)
- hline(50, color=red)
- hline(20)
- // src = input(close, title="Source")
- lsma = linreg(wt1, lsma_length * tfm, lsma_offset)
- plot(lsma, color=blue, linewidth=2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement