我试图列出一行中看涨或看跌蜡烛的数量,为此我使用plotshape并保留一个计数器来计数它们,但在写入值时遇到了问题
c = 1
if bull and bull[1]
c := c + 1
plotshape(bull, style=shape.triangledown, location=location.abovebar, color=color.green, text = tostring(c))
如何将'text'=series[string]
转换为常量字符串。
我找到了函数label.new(...)
,但我正在寻找在整个序列中具有的东西,并且标签只出现在蜡烛的最后一部分
你可以用label.new()
来做,试试这个方法:
if bull
label.new(bar_index, high, text=tostring(c), style=label.style_label_down)