gpt4 book ai didi

pine-script - 如何在 Pine Script 中用字符串写入变量?

转载 作者:行者123 更新时间:2023-12-02 16:39:50 25 4
gpt4 key购买 nike

我试着用变量写文本,但是我不能

aaaa = 121.150
bbbb = 120.100
target = "TP = " + ( aaaa * 0.9 ) + "\n SL = " + bbbb*1.01
plotshape(data , style=shape.triangledown,location=location.abovebar, color=red, text=target)

我希望输出看起来像这样:

最佳答案

要在图表上放置系列(动态)文本,您需要使用 Pine v4 和 label.new()。您只会看到最近创建的 ~50 个标签:

//@version=4
study("", "", true)
aaaa = 121.150
bbbb = 120.100
target = "TP = " + tostring(aaaa * 0.9) + "\n SL = " + tostring(bbbb*1.01)
cond = rising(close, 1)[1] and falling(close, 1)
if cond
label.new(bar_index, high, target, yloc = yloc.abovebar, color = color.red, style = label.style_triangledown)

enter image description here

关于pine-script - 如何在 Pine Script 中用字符串写入变量?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61920909/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com