Guest User

Market Facilitation Index V2 with MTF support [LazyBear]

a guest
Oct 11th, 2014
1,846
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. //
  2. // @author LazyBear
  3. // List of all my indicators:
  4. // https://docs.google.com/document/d/15AGCufJZ8CIUvwFJ9W-IKns88gkWOKBCvByMEvm5MLo/edit?usp=sharing
  5. // v2 - MTF support
  6. // v1 - initial release
  7. //
  8. study("Market Facilitation Index v2 [LazyBear]", shorttitle="MFIndex_MTF_LB", overlay=true)
  9. plot_offs=input(0.005, title="Indicator offset % (below low)")
  10.  
  11. useCustomTimeframe=input(false)
  12. customTimeframe=input("D", type=resolution)
  13.  
  14. h=useCustomTimeframe ? security(tickerid, customTimeframe, high) : high
  15. l=useCustomTimeframe ? security(tickerid, customTimeframe, low) : low
  16. v = useCustomTimeframe ? security(tickerid, customTimeframe, volume) : volume
  17.  
  18. r_hl=roc((h-l)/v,1)
  19. r_v=roc(v,1)
  20. green_f= (r_hl > 0) and (r_v > 0)
  21. fade_f=(r_hl < 0) and (r_v < 0)
  22. fake_f=(r_hl > 0) and (r_v < 0)
  23. squat_f=(r_hl < 0) and (r_v > 0)
  24. b_color = green_f ? green : fade_f ? blue : fake_f ? gray : squat_f ? red : na
  25. plot(l - (l*plot_offs), color=b_color, style=circles, linewidth=4)
Advertisement
Add Comment
Please, Sign In to add comment