SHARE
TWEET

High-Low Index [LazyBear]

lazybeartv May 8th, 2015 667 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //
  2. // @author LazyBear
  3. //
  4. // List of my public indicators: http://bit.ly/1LQaPK8
  5. // List of my app-store indicators: http://blog.tradingview.com/?p=970
  6. //
  7. // v1.1 - Fixed the wrong symbols for "Combined".
  8. //
  9. study(title="High-Low Index [LazyBear]", shorttitle="HLIDX_LB")
  10. res=input("D", title="Timeframe")
  11. t=input(defval=1, maxval=2, minval=1, title="MA Type (1=>SMA, 2=>EMA)")
  12. lma=input(defval=10, minval=1, title="MA Length")
  13. mkt = input (defval=1, minval=0, maxval=4, title="Market (0=>AMEX/NASD/NYSE Combined, 1=NYSE, 2=NASDAQ, 3=AMEX, 4=CUSTOM)")
  14. aic=input(defval="MAHE", title="CUSTOM: New Highs Symbol", type=symbol)
  15. dic=input(defval="MALE", title="CUSTOM: New Lows Symbol", type=symbol)
  16. sh=input(false, title="Show only Record High %")
  17. ma(s,l) => sh?s:(t==1?sma(s,l):ema(s,l))
  18. hi="MAHN", lon="MALN" // NYSE
  19. hiq="MAHQ", lonq="MALQ" // NASDAQ
  20. hia="MAHA", lona="MALA" // AMEX
  21. advc="(MAHN+MAHQ+MAHA)/3.0", loc="(MALN+MALQ+MALA)/3.0" // <-- v1.0 had wrong symbols here
  22. adv=security(mkt==0? advc:mkt == 1? hi:mkt == 2? hiq:mkt == 3? hia:aic, res, close)
  23. lo=security(mkt==0? loc:mkt == 1? lon:mkt == 2? lonq:mkt == 3? lona:dic, res, close)
  24. hli=ma(adv/(adv+lo), lma) * 100
  25. osd=plot(hli<50?hli:50, style=circles, linewidth=0, title="DummyOS")
  26. obd=plot(hli>50?hli:50, style=circles, linewidth=0, title="DummyOB")
  27. ml=plot(50, color=gray, title="MidLine")
  28. fill(osd, ml, red, transp=60, title="OSFill"), fill(obd, ml, green, transp=60, title="OBFill")
  29. plot(hli, color=maroon, linewidth=2, title="HiLoIndex")
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top