I'm using charts on TradingView and I'd like to draw horizontal lines. The horizontal lines are the Pivot Points.
I've calculated them and each values is stocked in a variable.
width = input(2, minval=1)
xHigh = security(tickerid,"D", high[1])
xLow = security(tickerid,"D", low[1])
xClose = security(tickerid,"D", close[1])
vPP = (xHigh+xLow+xClose) / 3
vR1 = vPP+(vPP-xLow)
vS1 = vPP-(xHigh - vPP)
vR2 = vPP + (xHigh - xLow)
vS2 = vPP - (xHigh - xLow)
vR3 = xHigh + 2 * (vPP - xLow)
vS3 = xLow - 2 * (xHigh - vPP)
I've tried to use this line to do the job
plot(vPP, color=black, title="vPP", style = line, linewidth = width)
But from one day to another, the line doesn't cut. So it's not looking good. See the picture.
This is the result I am looking for :
I'd like :
- to display today and yesterday pivot points.
- that the lines starts from today until the end of the session
- to write "PP, S1/S2/S3, R1/R2/R3" in front of the lines
Thanks for your advises