Pine script 标签中的价格和日期

Pine script 标签中的价格和日期,pine-script,Pine Script,如何显示包含ATH价格和此ATH日期的标签 有了这个代码,我就可以找到ATH了 ATH_month = highest(high, 800) 我知道是在四月 我正试图创建一个标签,上面写着这封信的价格和日期 if ATH_month == month==4 var x1 = label.new(time + 60*(time - time[1]), close, xloc=xloc.bar_time, text = tostring(ATH_month) + " | " +

如何显示包含ATH价格和此ATH日期的标签 有了这个代码,我就可以找到ATH了

ATH_month = highest(high, 800)
我知道是在四月

我正试图创建一个标签,上面写着这封信的价格和日期

if ATH_month == month==4
var x1 = label.new(time + 60*(time - time[1]), close, xloc=xloc.bar_time, text = tostring(ATH_month) + " | " + tostring(month), color=color.red, textcolor=color.white, style=label.style_label_left)

在数据集上执行脚本时,您需要检测并记住上次检测到较高价格的时间:

//@version=4
study("", "", true)
i_src = input(high)
var float hi = i_src
var float hiTime = na
if i_src > hi
    hi := i_src
    hiTime := time

f_print(_text) => var _label = label.new(bar_index, na, _text, xloc.bar_index, yloc.price, color(na), label.style_none, color.gray, size.large, text.align_left), label.set_xy(_label, bar_index, highest(10)[1]), label.set_text(_label, _text)
f_tickFormat() =>
    _s = tostring(syminfo.mintick)
    _s := str.replace_all(_s, "25", "00")
    _s := str.replace_all(_s, "5",  "0")
    _s := str.replace_all(_s, "1",  "0")

f_print("ATH: " + tostring(hi, f_tickFormat()) + str.format(" on {0,date,full}", hiTime))

// For debugging
plotchar(change(hi), "ATH", "•", location.top, size = size.tiny)
plot(hi)

谢谢。你帮了我很多。现在我试着分析上面脚本的逻辑)你非常了解pine脚本。如果你不理解代码中的某些内容,请随意询问。你有电报吗,这样我可以直接给你写信?我愿意为你的帮助付钱。这是我的电报@ef22i不做有偿工作,但PineCoders保留了一份值得信赖的Pine程序员名单供雇佣:我只是想向你支付帮助作为感谢的象征。你对松树剧本很了解,我也很想学。)