【问题标题】:'tostring' function in pine-script松树脚本中的“tostring”函数
【发布时间】:2021-10-22 17:50:32
【问题描述】:

我正在尝试根据输入值创建绘图名称。但是出现错误(在第 6 行)。 下面是我的代码。 非常感谢您的宝贵时间和回复。

//@version=4
study(title="EMA", shorttitle="ema", overlay=true)
ema_len = input(50, title='Period')
EMA = ema(close, ema_len)
plot_name = 'EMA' + tostring(ema_len)
plot(EMA, title=plot_name)

错误信息:

Add to Chart operation failed, reason: line 6: Cannot call 'plot' with 'title'=string. The argument should be of type: const string

【问题讨论】:

    标签: pine-script


    【解决方案1】:

    const strong 意味着我们不能动态更改标题。如果您的眼睛,设置菜单不会随着用户输入而改变。所以我们只需要为我们的情节选择一个名字。

    干杯。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-07-28
      • 1970-01-01
      相关资源
      最近更新 更多