Fxxtrader
Pine Script Rookie
Pine Script Rookie
Posts: 22
Joined: September 6th, 2020
Location: Toronto
Contact: Twitter TradingView Profile

Vortex and ATR Multiplier

Hello - I am trying to save space on the chart while automatically calculating ATR by a multiple.

How may I only display the value of the multiple and not the actual plotting of the multiple?

Code: Select all

//@version=4
study(title = "Vortex Indicator", shorttitle="VI", format=format.price, precision=5, resolution="")
period_ = input(13, title="Period", minval=2)
VMP = sum( abs( high - low[1]), period_ )
VMM = sum( abs( low - high[1]), period_ )
STR = sum( atr(1), period_ )
VIP = VMP / STR
VIM = VMM / STR
plot(VIP, title="VI +", color=#3BB3E4)
plot(VIM, title="VI -", color=#FF006E)

upperBand = input(title="Upper Band", type=input.float, defval=1.35, step=.1)
lowerBand = input(title="Lower Band", type=input.float, defval=0.65, step=.1)

plot(upperBand, title="Upper Band", color=color.white)
plot(1, histbase=1, title="Neutral Band", color=color.white, linewidth=1)
plot(lowerBand, title="Lower Band", color=color.white, linewidth=1)

//ATR Multiplier
atr = atr(14)
floatType = atr[1]
multiplier = input(title="ATR Multiplier", type=input.float, defval=1.0, step=0.25)
plot(floatType * multiplier, color=color.red, transp=50)

I don't want the ATR multiple line on the chart, only it's value. Or am I going about this wrong?

Thank you.

Gaz1892a
Pine Script Scholar
Pine Script Scholar
Posts: 9
Joined: October 18th, 2020
Contact: TradingView Profile

Re: Vortex and ATR Multiplier

can you not just set transp to 100?

works for me and I just have the ATR value displayed as a digit in the data of the indi (top left)

length = input(title="Length", defval=14, minval=1)
multiply = input(title="Multiply", defval=1.5)


plot(rma(tr(true), length) *multiply, title = "ATR", color=#991515, transp=100)

User avatar
Matthew
Site Admin
Site Admin
Posts: 92
Joined: July 1st, 2020
Location: Australia
Contact: Website Facebook Twitter TradingView Profile

Re: Vortex and ATR Multiplier

Gaz is correct, the only way to draw a plot value on your chart without it actually drawing onto the chart is to set transp=100 :)

Return to “Pine Script Q&A”