简体   繁体   中英

How can you retrieve values from a line array

I am using the excellent 'Linear Regression Channels' on TradingView. I am trying to retrieve the data values from the linear regression lines which are printed on the chart. So in other words I am trying to retrieve values from an array with a set of lines. Here is the snippet which creates the array of lines:

for x = 0 to 2
    if not showbroken or outofchannel != x or nz(outofchannel[1], -1) != -1
        line.delete(array.get(reglines, x))
    else
        line.set_color(array.get(reglines, x), color = color.blue)
        line.set_width(array.get(reglines, x), width = 2)
        line.set_style(array.get(reglines, x), style = line.style_dotted)
        line.set_extend(array.get(reglines, x), extend = extend.none)
    
    array.set(reglines, x, line.new(x1 = bar_index - (len - 1), 
           y1 = y1_ + dev * devlen * (x - 1), 
           x2 = bar_index, 
           y2 = y2_ + dev * devlen * (x - 1),
           color = array.get(colors, round(max(sign(slope), 0))),
           style =  x % 2 == 1 ? line.style_solid : line.style_dashed,
           width = widt,
           extend = extendit ? extend.right : extend.none))

How can I retrieve and values from 'reglines'?

Many thanks, Steve

You cannot use the historical operator on the arrays. Tradingview; as of now, does not support it

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM