如何使用Webhook Trading View(Pine脚本)获取价格?

发布于 2025-02-06 13:22:18 字数 226 浏览 0 评论 0原文

我的代码:

alert('{"content": "BTC SHORT {{close}}"}', alert.freq_once_per_bar)

我明白了:

BTC SHORT {{close}}

但是我需要这样的东西:

BTC SHORT 27455.3

My code:

alert('{"content": "BTC SHORT {{close}}"}', alert.freq_once_per_bar)

I got this:

BTC SHORT {{close}}

But i need something like this:

BTC SHORT 27455.3

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

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

发布评论

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

评论(1

疏忽 2025-02-13 13:22:18

由于您使用的是alert()函数,因此可以使用str.tostring()函数将数字转换为字符串。

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

c = str.tostring(math.round(close, 1))

alert('{"content": "BTC SHORT ' + c + '"}', alert.freq_once_per_bar)

Since you are using the alert() function, you can use the str.tostring() function to convert a number into a string.

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

c = str.tostring(math.round(close, 1))

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