Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- // @author LazyBear
- //
- // Balance Of Power - BOP
- //
- // v2 - Updated to match ThinkOrSwim platform. Added more params to plot only BOP.
- // v1 - initial release
- //
- // If you use this code in its original or modified form, do drop me a note. Thx.
- //
- study(title = "Balance of Power [LazyBear]",shorttitle="BOP_LB")
- PlotOnlyEMA=input(true, "Plot only EMA of BOP?", type=bool)
- length=input(21, title="EMA length")
- BOP=nz((close - open) / (high - low))
- b_color=(BOP>=0 ? (BOP>=BOP[1] ? green : orange) : (BOP>=BOP[1] ? orange : red))
- e=ema(BOP, length)
- e_color=(e>=0 ? green : red)
- hline(0)
- plot(PlotOnlyEMA?e:BOP, color=PlotOnlyEMA?e_color:b_color, style=columns, linewidth=3)
- plot(not PlotOnlyEMA?e:na, color=navy, linewidth=2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement