SHARE
TWEET

Balance of Market Power [TradingView Custom Indicator]

a guest May 7th, 2014 867 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //
  2. // @author LazyBear
  3. //
  4. // Balance Of Power - BOP
  5. //
  6. // v2 - Updated to match ThinkOrSwim platform. Added more params to plot only BOP.
  7. // v1 - initial release
  8. //
  9. // If you use this code in its original or modified form, do drop me a note. Thx.
  10. //
  11. study(title = "Balance of Power [LazyBear]",shorttitle="BOP_LB")
  12. PlotOnlyEMA=input(true, "Plot only EMA of BOP?", type=bool)
  13. length=input(21, title="EMA length")
  14. BOP=nz((close - open) / (high - low))
  15. b_color=(BOP>=0 ? (BOP>=BOP[1] ? green : orange) : (BOP>=BOP[1] ? orange : red))
  16. e=ema(BOP, length)
  17. e_color=(e>=0 ? green : red)
  18.  
  19. hline(0)
  20. plot(PlotOnlyEMA?e:BOP, color=PlotOnlyEMA?e_color:b_color, style=columns, linewidth=3)
  21. plot(not PlotOnlyEMA?e:na, color=navy, linewidth=2)
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