Pine script 如何绘制以前的轴点线?

Pine script 如何绘制以前的轴点线?,pine-script,Pine Script,我试图将所有以前的轴心线高点和低点绘制为线,但我只能得到一组轴心线显示在图表上。有人能帮我画出前面所有的轴线吗 //@version=4 study("Pivot Points Auto v2", shorttitle="Pivot Points Auto v2", overlay=true) pvtLenL = input(50, minval=1, title="Pivot Length Left Hand Side") pvtL

我试图将所有以前的轴心线高点和低点绘制为线,但我只能得到一组轴心线显示在图表上。有人能帮我画出前面所有的轴线吗

//@version=4
study("Pivot Points Auto v2", shorttitle="Pivot Points Auto v2", overlay=true)

pvtLenL = input(50, minval=1, title="Pivot Length Left Hand Side")
pvtLenR = input(50, minval=1, title="Pivot Length Right Hand Side")
LineColor = input(title="Line Color", type=input.color, defval=color.white)
LineWidth = input(title="Line Width", type=input.integer, defval=1)

pvthi = pivothigh(high, pvtLenL, pvtLenR)
pvtlo = pivotlow(low, pvtLenL, pvtLenR)
 
pvthis = fixnan(pvthi)
pvtlos = fixnan(pvtlo)

line.new(x1=bar_index[10], y1=pvthis, x2=bar_index, y2=pvthis, extend=extend.both, color=LineColor, width=LineWidth)
line.new(x1=bar_index[10], y1=pvtlos, x2=bar_index, y2=pvtlos, extend=extend.both, color=LineColor, width=LineWidth)

编辑1

//@version=4
study("Pivot Points Auto v2", shorttitle="Pivot Points Auto v2", overlay=true)

pvtLenL = input(50, minval=1, title="Pivot Length Left Hand Side")
pvtLenR = input(50, minval=1, title="Pivot Length Right Hand Side")
LineColor = input(title="Line Color", type=input.color, defval=color.white)
LineWidth = input(title="Line Width", type=input.integer, defval=1)

pvthi = pivothigh(high, pvtLenL, pvtLenR)
pvtlo = pivotlow(low, pvtLenL, pvtLenR)
 
pvthis = fixnan(pvthi)
pvtlos = fixnan(pvtlo)

if change(pvthis)
    line.new(x1=bar_index[10], y1=pvthis, x2=bar_index, y2=pvthis, extend=extend.right, color=LineColor, width=LineWidth)

if change(pvtlos)
    line.new(x1=bar_index[10], y1=pvtlos, x2=bar_index, y2=pvtlos, extend=extend.right, color=LineColor, width=LineWidth)

谢谢,但不幸的是这不起作用。我正在尝试绘制线,如图所示,但只有前两个轴的线显示在我的答案中添加了“编辑1”部分。
//@version=4
study("Pivot Points Auto v2", shorttitle="Pivot Points Auto v2", overlay=true)

pvtLenL = input(50, minval=1, title="Pivot Length Left Hand Side")
pvtLenR = input(50, minval=1, title="Pivot Length Right Hand Side")
LineColor = input(title="Line Color", type=input.color, defval=color.white)
LineWidth = input(title="Line Width", type=input.integer, defval=1)

pvthi = pivothigh(high, pvtLenL, pvtLenR)
pvtlo = pivotlow(low, pvtLenL, pvtLenR)
 
pvthis = fixnan(pvthi)
pvtlos = fixnan(pvtlo)

if change(pvthis)
    line.new(x1=bar_index[10], y1=pvthis, x2=bar_index, y2=pvthis, extend=extend.right, color=LineColor, width=LineWidth)

if change(pvtlos)
    line.new(x1=bar_index[10], y1=pvtlos, x2=bar_index, y2=pvtlos, extend=extend.right, color=LineColor, width=LineWidth)