miyako.pro

Broker Spread Overlay v2.1a

This is for displaying a price line showing the spread difference of brokers such as 1broker.com or trading212.com where price is different than actual price. It may also be used as an ask line or to provide an additional alternate chart.

Version 2.1:
- JPY pip correction
- Price Line
- Area
- Kagi, Does not work on Forex pairs!
- Western Bar
- Candlesticks
- Heikenashi
- Renko, ATR and Traditional
- Line Break

Version 2.1a
- Fixed Heikenashi Colors.

If you like this indicator and/or it has helped you to earn profits, please donate.
- PayPal: ma.spencer@gmx.com
- Bitcoin: 1foxypuyuoNp5n1LNCCCCmjZ4RAXntQ8X

開源腳本

本著真正的TradingView精神,該腳本的作者將其開源發布,以便交易者可以理解和驗證它。為作者喝彩吧!您可以免費使用它,但在出版物中重複使用此代碼受網站規則的約束。 您可以收藏它以在圖表上使用。

免責聲明

這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。

想在圖表上使用此腳本?
// Coded by: Matthew Spencer
// If you like this indicator and/or it has helped you to earn money, please donate.
// Paypal: ma.spencer@gmx.com
// Bitcoin: 1foxypuyuoNp5n1LNCCCCmjZ4RAXntQ8X
// "If I die in the land of the dead, will I be sent to the land of the dead again?"
study("Broker Spread Overlay v2.1", overlay=true)

// Settings
separator = input(defval="Spread", title="---", type=string)
oneSpread = input(defval=0.0002, type="float", title="Pips")
jpyToggle = input(type=bool, defval=false, title="JPY Pips")
separator1 = input(defval="Chart", title="---", type=string)
lineToggle = input(type=bool, defval=true, title="Show Price Line")
areaToggle = input(type=bool, defval=false, title="Area")
barToggle = input(type=bool, defval=false, title="Bar")
candleToggle = input(type=bool, defval=false, title="Candlesticks")
heikenashiToggle = input(type=bool, defval=false, title="Heikinashi")
renkoToggle = input(type=bool, defval=false, title="Renko")
renkoSize = input(defval=10, type="integer", title="Renko Size")
renkoType = input(type=bool, defval=false, title="Traditional Renko")
lbToggle = input(type=bool, defval=false, title="Line Break")
lbSize = input(defval=3, type="integer", title="Line Break Lines")
kagiToggle = input(type=bool, defval=false, title="Kagi")
kagiAmount = input(defval=1, type="integer", title="Kagi Reversal Amount")

// OHCL
oneOpen = open + (jpyToggle ? oneSpread * 100 : oneSpread)
oneHigh = high + (jpyToggle ? oneSpread * 100 : oneSpread)
oneLow = low + (jpyToggle ? oneSpread * 100 : oneSpread)
oneClose = close + (jpyToggle ? oneSpread * 100 : oneSpread)

// Heikenashi
heikenashiOpen = security(heikenashi(tickerid), period, open) + oneSpread
heikenashiHigh = security(heikenashi(tickerid), period, high) + oneSpread
heikenashiLow = security(heikenashi(tickerid), period, low) + oneSpread
heikenashiClose = security(heikenashi(tickerid), period, close) + oneSpread

// Renko
renkoOpen = security(renko(tickerid, "close", renkoType ? "Traditional" : "ATR", renkoSize), period, open)
renkoHigh = security(renko(tickerid, "close", renkoType ? "Traditional" : "ATR", renkoSize), period, high)
renkoLow = security(renko(tickerid, "close", renkoType ? "Traditional" : "ATR", renkoSize), period, low)
renkoClose = security(renko(tickerid, "close", renkoType ? "Traditional" : "ATR", renkoSize), period, close)

// Line Break
lbOpen = security(linebreak(tickerid, "close", lbSize), period, open)
lbHigh = security(linebreak(tickerid, "close", lbSize), period, high)
lbLow = security(linebreak(tickerid, "close", lbSize), period, low)
lbClose = security(linebreak(tickerid, "close", lbSize), period, close)

// Kagi (Note: Doesn't work with Forex pairs)
kagiClose = security(kagi(tickerid, "close", kagiAmount), period, close)

// Colors
linecolor = open < close ? green : red
linecolor2 = heikenashiOpen < heikenashiClose ? blue : maroon
renkocolor = renkoOpen < renkoClose ? teal : orange
lbcolor = lbOpen < lbClose ? teal : orange
pfcolor = lbOpen < lbClose ? black : red

// Plot Charts
plot(areaToggle ? oneClose:na, title="Area", color=teal, style=areabr, linewidth=2, trackprice=false, transp=75, editable=true)
plot(kagiToggle ? kagiClose:na, title="Kagi", color=black)
plotcandle(renkoToggle ? renkoOpen:na, renkoToggle ? renkoHigh:na, renkoToggle ? renkoLow:na, renkoToggle ? renkoClose:na , title='Renko', color = renkocolor, wickcolor=black)
plotcandle(lbToggle ? lbOpen:na, lbToggle ? lbHigh:na, lbToggle ? lbLow:na, lbToggle ? lbClose:na , title='Line Break', color = lbcolor, wickcolor=black)
plotbar(barToggle ? oneOpen:na, barToggle ? oneHigh:na, barToggle ? oneLow:na, barToggle ? oneClose:na , title='Bar', color = linecolor)
plotcandle(candleToggle ? oneOpen:na, candleToggle ? oneHigh:na, candleToggle ? oneLow:na, candleToggle ? oneClose:na , title='Candles', color = linecolor, wickcolor=black)
plotcandle(heikenashiToggle ? heikenashiOpen:na, heikenashiToggle ? heikenashiHigh:na, heikenashiToggle ? heikenashiLow:na, heikenashiToggle ? heikenashiClose:na , title='Heikenashi Candles', color = linecolor2, wickcolor=black)
plot(lineToggle ? oneClose:na, title="Price Line", color=linecolor, style=areabr, linewidth=2, trackprice=true, transp=100, editable=false)