SHARE
TWEET

MFIndex overlay/histo [LazyBear]

lazybeartv Apr 14th, 2015 759 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. study("Market Facilitation Index Overlay [LazyBear]", shorttitle="MFIndexOverlay_MTF_LB", overlay=true)
  8. plot_offs=input(0.005, title="Indicator offset % (below low)")
  9. useCustomTimeframe=input(false)
  10. customTimeframe=input("D", title="Custom Timeframe")
  11. sh=input(false, title="Show Histo"), chf=input(100, title="Histo cap factor")
  12. ebc=input(true, title="Enable barcolors")
  13. h=useCustomTimeframe ? security(tickerid, customTimeframe, high) : high
  14. l=useCustomTimeframe ? security(tickerid, customTimeframe, low) : low
  15. v = useCustomTimeframe ? security(tickerid, customTimeframe, volume) : volume
  16. r_hl=roc((h-l)/v,1)
  17. r_v=roc(v,1)
  18. green_f= (r_hl > 0) and (r_v > 0)
  19. fade_f=(r_hl < 0) and (r_v < 0)
  20. fake_f=(r_hl > 0) and (r_v < 0)
  21. squat_f=(r_hl < 0) and (r_v > 0)
  22. b_color = green_f ? green : fade_f ? blue : fake_f ? gray : squat_f ? red : na
  23. plot(sh?r_hl % chf:na, style=columns, color=b_color, title="Histo")
  24. barcolor(ebc?b_color:na)
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
 
Top