Alert(message= str.tostring(timenow)) 无法正确显示时间

问题描述 投票:0回答:1

我正在尝试为警报添加 timenow 以查看触发该警报的时间,但我在警报日志中将其可视化时遇到问题。

我尝试了这段代码:

if close>open or close<open
    // Define variables
    triggerTime = time
    
    
    // Construct the message
    message = "Alert triggered!\n" +
              "Trigger Time: " + str.tostring(triggerTime)
              

    // Send the alert with the constructed message
    alert(message)

我看到了这个:

timeout NOT working properly

但我想看到这样的:

timeout is working properly

pine-script pine-script-v5
1个回答
0
投票

这是一个 Unix 时间戳。您只需使用

str.format_time()

对其进行格式化即可
© www.soinside.com 2019 - 2024. All rights reserved.