警报消息交易视图

发布于 2025-02-09 17:22:15 字数 153 浏览 2 评论 0原文

如果条件是买卖的,如何发送警报消息。目前,我将消息保留在下面

{“ auth-token”:“ xxxx”,“ key”:“ tikcer”,“ value”:“ - 1”,“ TIME”:“ 09:15”}

的地方在时间9:15传递值是否正确的代码格式正确?

How to send alert message if the condition is buy or sell. Currently I have kept the message as below

{"auth-token":"xxxx","key":"TIKCER","value":"-1", "time":"09:15"}

Where I want to pass the value at the time 9:15 is the above code format correct for time?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

同尘 2025-02-16 17:22:15

您需要编写一个函数,该函数可以按照您的意愿返回时间,然后使用alert()函数在警报消息中使用此变量。

//@version=5
indicator("My script")

f_get_time() =>
    s = ""
    
    s := if (hour < 10)
        "0" + str.tostring(hour)
    else
        str.tostring(hour)
    
    s := if (minute < 10)
        s + ":0" + str.tostring(minute)
    else
        s + ":" + str.tostring(minute)

s = f_get_time()

label.new(bar_index, low, s)
alert(s, alert.freq_once_per_bar)

You need to write a function that returns the time as you wish and then use the alert() function to use this variable in the alert message.

//@version=5
indicator("My script")

f_get_time() =>
    s = ""
    
    s := if (hour < 10)
        "0" + str.tostring(hour)
    else
        str.tostring(hour)
    
    s := if (minute < 10)
        s + ":0" + str.tostring(minute)
    else
        s + ":" + str.tostring(minute)

s = f_get_time()

label.new(bar_index, low, s)
alert(s, alert.freq_once_per_bar)

enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文