Advertisement
Guest User

bla

a guest
Jul 21st, 2019
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.49 KB | None | 0 0
  1. study(title="Williams%Rema", shorttitle="Williams%Rema")
  2.  
  3. //Inputs
  4.  
  5. useCustomTick = input(false, title="Custom ticker? [Y/N]", confirm=true)
  6. tickCustom = input(title="Symbol [e.g. BTCCNY:HUOBI]", type=string, defval="")
  7. useCustomRes = input(false, title="Custom time interval? [Y/N]", confirm=true)
  8. resCustom = input(title="Time interval (W, D, [min])", type=string, defval="")
  9. tickery = useCustomTick ? tickCustom : tickerid
  10. res = useCustomRes ? resCustom : period
  11. source = security(tickery, res, close)
  12.  
  13. length = input(21, minval=1, title="Will")
  14.  
  15.  
  16. //Williams%R + EMA
  17.  
  18. upper = highest(length)
  19. lower = lowest(length)
  20. out = 100 * (source - upper) / (upper - lower) +100
  21. src = out, len = input(13, minval=1, title="EMA")
  22. out2 = ema(out, len)
  23.  
  24.  
  25. //Inputs (2)
  26.  
  27. Sup = input(80, minval=-100, title="Level of stupidity UP")
  28. Sdown = input(20, minval=-100, title="Level of stupidity DOWN")
  29. HCross = input(defval=true, type = bool, title="Highlight crossovers? [Y/N]")
  30. Flex = input(3, minval=1, maxval=10, title="Cross flexibility [1-10]")
  31. BGcoloring = input(defval=true, type = bool, title="Background coloring? [Y/N]")
  32. Transpa = input(65, title="Background color transparency [%]")
  33.  
  34.  
  35. //Plot
  36.  
  37. band1 = hline(Sup, title="Band upperline", linestyle=dashed, linewidth=1, color= black)
  38. band0 = hline(Sdown, title="Band bottomline", linestyle=dashed, linewidth=1, color= black)
  39. top = hline(100, title="Top", linestyle=solid, linewidth=1, color= black)
  40. bottom = hline(-0, title="Bottom", linestyle=solid, linewidth=1, color= black)
  41. fill(band1, band0, color=white, transp=100, title="Inner band")
  42.  
  43. plot(out >= Sup ? 100 : na, title="overbought", color=#FF5050, style=circles, linewidth=2, transp=50)
  44. plot(out <= Sdown ? 0 : na, title="oversold", color=#99FF33, style=circles, linewidth=2, transp=50)
  45. plot((HCross and cross(out, out2) and out2 >= (Sup-Flex)) ? out2 : na,title="Overbought cross", color=red, style=circles, linewidth=4, transp=50)
  46. plot((HCross and cross(out, out2) and out2 <= (Sdown+Flex)) ? out2 : na,title="Oversold cross", color=#00FF00, style=circles, linewidth=4, transp=50)
  47.  
  48. Will = plot(out, title="Will", color=#19193E, linewidth=1)
  49. EMA = plot(out2, title="EMA", color=(out2[0]>out2[1]? green:red), linewidth=2)
  50.  
  51. plot((HCross and cross(out, out2) and out2 >= (Sup-Flex)) or (HCross and cross(out, out2) and out2 <= (Sdown+Flex))? out2 : na,title="Cross center", color=black, style=circles, linewidth=2, transp=80)
  52.  
  53. //bgcolor(BGcoloring? (out2[0]>out2[1]? green:red) : na, transp=Transpa)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement