Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.95 KB | None | 0 0
  1. // Tradingview.com
  2. // @author LazyBear, xSilas, Ni6HTH4wK,
  3. // Drop a line if you use or modify this code.
  4. // modified by sco77m4r7in and oh92 -- updated and fixed multi exchange error, and added addtional caution dots.
  5. // modified by scilentor, integrated LSMA indicator with settings 25, 0
  6. // modified by RoadTo23Million to include timeframe multiplier
  7. study(title="Custom Timeframe Godmode3.2+LSMA")
  8. n1 = input(9, "Channel Length")
  9. n2 = input(6, "Average Length")
  10. n3 = input(3, "Short length")
  11.  
  12. lsma_length = input(title="LSMA Length", type=integer, defval=32)
  13. lsma_offset = input(title="LSMA Offset", type=integer, defval=0)
  14.  
  15. tfm = input(title="Timeframe multiplier", type=integer, defval=1)
  16.  
  17. src0 = hlc3
  18.  
  19. tci(src) => ema((src - ema(src, n1 * tfm)) / (0.025 * ema(abs(src - ema(src, n1 * tfm)), n1 * tfm)), n2 * tfm)+50
  20. mf(src) => rsi(sum(volume * (change(src) <= 0 ? 0 : src), n3 * tfm), sum(volume * (change(src) >= 0 ? 0 : src), n3 * tfm))
  21. willy(src) => 60 * (src - highest(src, n2 * tfm)) / (highest(src, n2 * tfm) - lowest(src, n2 * tfm)) + 80
  22. csi(src) => avg(rsi(src, n3 * tfm),tsi(src0,n1 * tfm,n2 * tfm)*50+50)
  23.  
  24. godmode(src) => avg(tci(src),csi(src),mf(src),willy(src))
  25. tradition(src) => avg(tci(src),mf(src),rsi(src, n3 * tfm))
  26.  
  27. wt1 = godmode(src0)
  28. wt2 = sma(wt1,6)
  29.  
  30. extended = wt2<25 ? wt2+5 : wt2>75 ? wt2-5 : na
  31. extended2 = wt2<20 ? wt2+5 : wt2>80 ? wt2-5 : na
  32. extended3 = wt2<15 ? wt2+5 : wt2>85 ? wt2-5 : na
  33. plot(wt1, color=green)
  34. plot(wt2, color=red)
  35. plot(ema((wt1-wt2)*2+50,n3 * tfm), color=aqua, style=area, transp=80, histbase=50)
  36. plot(extended, title="Caution!", color=aqua, style=circles, linewidth=2)
  37. plot(extended2, title="Caution!", color=yellow, style=circles, linewidth=2)
  38. plot(extended3, title="Caution!", color=red, style=circles, linewidth=3)
  39.  
  40. hline(80)
  41. hline(50, color=red)
  42. hline(20)
  43.  
  44.  
  45. // src = input(close, title="Source")
  46.  
  47. lsma = linreg(wt1, lsma_length * tfm, lsma_offset)
  48. plot(lsma, color=blue, linewidth=2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement