PINE - Fibber Indicator


SUBMITTED BY: greatinfo

DATE: March 1, 2016, 2:24 a.m.

UPDATED: March 1, 2016, 2:28 a.m.

FORMAT: Text only

SIZE: 2.8 kB

HITS: 6240

  1. //* Full credits and appreciation to The Rational Flibbr Indicators Creator
  2. //* flibbr : flibbr.com : @flibbr
  3. //* Consider tipping flibbr
  4. study(title="The Rational Flibbr Indicator v2", shorttitle="The Rational Flibbr Indicator v2")
  5. //Inputs
  6. useCustomTick = input(false, title="Custom ticker? [Y/N]", confirm=true)
  7. tickCustom = input(title="Symbol [e.g. BTCCNY:HUOBI]", type=string, defval="")
  8. useCustomRes = input(false, title="Custom time interval? [Y/N]", confirm=true)
  9. resCustom = input(title="Time interval (W, D, [min])", type=string, defval="")
  10. tickery = useCustomTick ? tickCustom : tickerid
  11. res = useCustomRes ? resCustom : period
  12. source = security(tickery, res, close)
  13. length = input(21, minval=1, title="Will")
  14. //Williams%R + EMA
  15. upper = highest(length)
  16. lower = lowest(length)
  17. out = 100 * (source - upper) / (upper - lower)
  18. src = out, len = input(13, minval=1, title="EMA")
  19. out2 = ema(out, len)
  20. //Inputs (2)
  21. Sup = input(-20, minval=-100, title="Level of stupidity UP")
  22. Sdown = input(-80, minval=-100, title="Level of stupidity DOWN")
  23. HCross = input(defval=true, type = bool, title="Highlight crossovers? [Y/N]")
  24. Flex = input(3, minval=1, maxval=10, title="Cross flexibility [1-10]")
  25. BGcoloring = input(defval=true, type = bool, title="Background coloring? [Y/N]")
  26. Transpa = input(65, title="Background color transparency [%]")
  27. //Plot
  28. band1 = hline(Sup, title="Band upperline", linestyle=dashed, linewidth=1, color= black)
  29. band0 = hline(Sdown, title="Band bottomline", linestyle=dashed, linewidth=1, color= black)
  30. top = hline(0, title="Top", linestyle=solid, linewidth=1, color= black)
  31. bottom = hline(-100, title="Bottom", linestyle=solid, linewidth=1, color= black)
  32. fill(band1, band0, color=white, transp=100, title="Inner band")
  33. plot(out >= Sup ? 0 : na, title="overbought", color=#FF5050, style=circles, linewidth=2, transp=50)
  34. plot(out <= Sdown ? -100 : na, title="oversold", color=#99FF33, style=circles, linewidth=2, transp=50)
  35. plot((HCross and cross(out, out2) and out2 >= (Sup-Flex)) ? out2 : na,title="Overbought cross", color=red, style=circles, linewidth=4, transp=50)
  36. plot((HCross and cross(out, out2) and out2 <= (Sdown+Flex)) ? out2 : na,title="Oversold cross", color=#00FF00, style=circles, linewidth=4, transp=50)
  37. Will = plot(out, title="Will", color=#19193E, linewidth=1)
  38. EMA = plot(out2, title="EMA", color=(out2[0]>out2[1]? green:red), linewidth=2)
  39. 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)
  40. //bgcolor(BGcoloring? (out2[0]>out2[1]? green:red) : na, transp=Transpa)
  41. //* Slightly improved by RooKiED

comments powered by Disqus