This overlay offers two views.
- A price line showing the difference.
- , either as an overlay or unmerged to their own window.
If you like this indicator and/or it has helped you to earn money, please donate.
In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.
study("Broker Spread Overlay", overlay=true) oneSpread = input(defval=0.0002, type="float", title="Spread") oneOpen = security(tickerid, period, open) + oneSpread oneHigh = security(tickerid, period, high) + oneSpread oneLow = security(tickerid, period, low) + oneSpread oneClose = security(tickerid, period, close) + oneSpread linecolor = open < close ? green : red barToggle = input(type=bool, defval=false, title="Show Candles") lineToggle = input(type=bool, defval=true, title="Show Price Line") plotcandle(barToggle ? oneOpen:na, barToggle ? oneHigh:na, barToggle ? oneLow:na, barToggle ? oneClose:na , title='Candles', color = linecolor, wickcolor=black) plot(lineToggle ? oneClose:na, title="Price Line", linewidth=2, color=linecolor, style=areabr, transp=100, trackprice=true, editable=false)