Pine script 如何更正行.new()中的负索引?松树

Pine script 如何更正行.new()中的负索引?松树,pine-script,line-drawing,Pine Script,Line Drawing,//我的行有问题。新的函数。我想在0830-1630之间画一条直线,所以可能是对角线 _zoneSession = input(title = "Session", type = input.session, defval = "0830-1630:1234567") _zoneInitialBalanceStop = input(title = "Initial Balance Session", type = input.session, defval = "0930-0931:123

//我的
行有问题。新的
函数。我想在0830-1630之间画一条直线,所以可能是对角线

_zoneSession = input(title = "Session", type = input.session, defval = "0830-1630:1234567")

_zoneInitialBalanceStop   = input(title = "Initial Balance Session", type = input.session, defval = "0930-0931:1234567")

_timeZone  = time(timeframe.period, _zoneSession)

_hLZone = time(timeframe.period,_zoneInitialBalanceStop)

_session_Start= plot(na(_timeZone)[1] == 1 and na(_timeZone) == 0 ? close : na, style = plot.style_histogram, linewidth = 3, color = color.green)

_session_Stop= plot(na(_timeZone)[1] == 0 and na(_timeZone) == 1 ? close : na, style = plot.style_histogram, linewidth = 3, color = color.green)

_session_bal_Stop= plot(na(_hLZone)[1] == 0 and na(_hLZone) == 1 ? close : na, style = plot.style_histogram, linewidth = 3, color = color.red)



_sessionSy1_condx1 = na(_timeZone)[1] == 1 and na(_timeZone) == 0 ? close : na
_sessionSy1_condx2 = na(_timeZone)[1] == 0 and na(_timeZone) == 1 ? close : na


//I HAVE PROBLEMS WITH THE LINE.NEW FUNCTION I WNAT A LINE FROM CLOSE TO CLOSE BTWN 0830-1630 so probably a diagonal...

line.new(timestamp(year,month,dayofmonth,08,30),_sessionSy1_condx1, timestamp(year,month,dayofmonth,16,30),_sessionSy1_condx2, xloc= xloc.bar_index, extend = extend.right)

行中需要使用
xloc=xloc.bar\u time
。在使用
x1=
x2=
的时间值时,需要调用new