Plotting a horizontal ray at the daily open on tradingview

丶灬走出姿态 提交于 2021-02-08 07:28:35

问题


Trying to plot a horizontal ray at the daily open, my code doesn't plot anything for some reason

//@version=4
study("Opens +", overlay=true)
higherTF1 = input("D", type=input.resolution)

dailyopen = security(syminfo.tickerid, higherTF1, open)

var line1 = line.new(bar_index, dailyopen,bar_index, dailyopen,   xloc=xloc.bar_index, style=line.style_solid,extend=extend.right)
line.set_color(line1, color.black)
line.set_width(line1, 1)

回答1:


// mrtuanvn
//@version=4
study("Open Ray to right", overlay=true)
higherTF1 = input("D", type=input.resolution)

dailyopen = security(syminfo.tickerid, higherTF1, open)

line1 = line.new(x1=bar_index-1, y1=dailyopen, x2=bar_index, y2=dailyopen, xloc=xloc.bar_index, style=line.style_solid,extend=extend.right, color=color.green)

line.delete(line1[1])  // remove the previous line when new bar appears


来源:https://stackoverflow.com/questions/57518789/plotting-a-horizontal-ray-at-the-daily-open-on-tradingview

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!