在交易视图的每日开盘时绘制水平射线 [英] Plotting a horizontal ray at the daily open on tradingview
本文介绍了在交易视图的每日开盘时绘制水平射线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
尝试在每日开盘时绘制水平射线,我的代码由于某种原因没有绘制任何内容
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)
推荐答案
// 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
这篇关于在交易视图的每日开盘时绘制水平射线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文