admin管理员组文章数量:1414614
I have a line in pine script called Total. Now I need to create a line in the opposite direction of the Total line movement. I do not mean -Total. I mean that for example when Total line starts from 0 to 100, at the same time the new line starts from 100 to 0. How can I generally create this line from the first candle on the chart?
I have a line in pine script called Total. Now I need to create a line in the opposite direction of the Total line movement. I do not mean -Total. I mean that for example when Total line starts from 0 to 100, at the same time the new line starts from 100 to 0. How can I generally create this line from the first candle on the chart?
Share Improve this question asked Feb 21 at 2:52 A.GA.G 1372 silver badges12 bronze badges1 Answer
Reset to default 1Just swap the x1
and x2
parameters.
//@version=6
indicator("My script", overlay=true)
left = bar_index
right = bar_index + 100
if (barstate.islast)
l1 = line.new(x1=left, y1=high, x2=right, y2=low, color=color.green)
l2 = line.new(x1=right, y1=high, x2=left, y2=low, color=color.red)
本文标签: pine scriptHow to create a line in the opposite direction of another line؟Stack Overflow
版权声明:本文标题:pine script - How to create a line in the opposite direction of another line؟ - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745169744a2645900.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论