【问题标题】:'text'=series[string] to const string'text'=series[string] 到 const 字符串
【发布时间】:2021-05-28 08:55:54
【问题描述】:

我试图连续列出看涨或看跌蜡烛的数量,为此我使用 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] 转换为 const 字符串。

我找到了函数label.new(...),但我正在寻找整个序列中的一些东西,标签只出现在蜡烛的最后一部分

【问题讨论】:

    标签: text pine-script


    【解决方案1】:

    你可以用label.new()来做,试试这个方法:

    if bull
        label.new(bar_index, high, text=tostring(c), style=label.style_label_down)
    

    【讨论】:

    • 我知道 label.new () 函数存在,但我可以用它放置的标签数量似乎不够,我正在寻找这样的事情:s3.tradingview.com/snapshots/1/1g4HIrMy.png
    • 你可以在sturdy("My Script, ...., max_labels_count = 500)中传递一个参数,500是你可以拥有的标签的最大数量,我认为这应该足够了
    猜你喜欢
    • 2014-04-27
    • 2013-11-06
    • 1970-01-01
    • 2010-09-21
    • 2022-01-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-16
    相关资源
    最近更新 更多