Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k views
in Technique[技术] by (71.8m points)

trading - Tradingview Pine Script Line Draw

I am writing my own script which will draw key level lines on chart. For an example below code will draw couple of lines on individual ticker..

study("Multi Horizontal Lines", overlay=true)

toadd = 0.
incval = 0.
selectedprice = 0.

selectedprice := input(title="Type Your Start Price Here", type=input.float, defval=9500.0)
incval := input(title="Increment Value", type=input.float, defval=540.0)
toadd := incval


line.new(bar_index, selectedprice, bar_index[100], selectedprice, width = 1, color=color.white)
for i = 1 to 10
    line.new(bar_index, selectedprice+(toadd*i), bar_index[100], selectedprice+(toadd*i), width = 1, color=color.green, style=line.style_dashed)
    
    line.new(bar_index, selectedprice-(toadd*i), bar_index[100], selectedprice-(toadd*i), width = 1, color=color.red, style=line.style_dashed)

If I draw those lines on AAPL chart and if I selcet TSLA chart, same lines which i draw on AAPL is appearing on TSLA chart. I need to draw lines on bunch of charts and I would like to automate this. is there any other alternate ?

Thanks

question from:https://stackoverflow.com/questions/65855673/tradingview-pine-script-line-draw

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...