我已经在间谍上设置了一个警报条件,一旦被触发,它如何才能向我寄给我像pinescript中TSLA这样的其他股票的价格?

发布于 2025-01-28 19:16:57 字数 293 浏览 2 评论 0原文

我正在使用TradingView遵循间谍指数的趋势。一旦RSI脱离范围,我就设置了一个警报条件来触发系统向我发送消息。

但是,我只能找到它给我的间谍的近距离价格,这是我设置警报的股票。

我要做的是询问QUALTCONDITION函数,向我发送TSLA之类的另一股股票的近距离价格。

我尝试使用request.security,但是由于它返回一个系列字符串而不是常数字符串,因此无法在消息部分中使用。

有人知道如何使用警报条件函数发送另一个股票的关闭价格吗?

I'm using TradingView to follow the trend of the SPY index. Once its RSI fall out of range, I have set up a alertcondition to trigger the system to send me a message.

However, I can only find it send me the close price of the SPY, which is the ticker that I set up the alert on.

What I want to do is to ask the alertcondition function to send me the close price of another stock like TSLA.

I've tried to use request.security, but because it returns a series string, not a constant string, it can't be used in the message part.

Does anyone know how to use the alertcondition function to send another ticker's close price?

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

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

发布评论

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

评论(1

情丝乱 2025-02-04 19:16:57

您可以将securetiy()alert()函数一起使用。

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © vitruvius

//@version=5
indicator("My script", overlay=true)

c_sec = request.security("BINANCE:ETHUSDT", timeframe.period, close)

_s = "BTC: " + str.format("{0,number,#.##}", close) + "\nETH: " + str.format("{0,number,#.##}", c_sec)

alert(_s, alert.freq_once_per_bar_close)

You can use the securtiy() together with the alert() function.

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © vitruvius

//@version=5
indicator("My script", overlay=true)

c_sec = request.security("BINANCE:ETHUSDT", timeframe.period, close)

_s = "BTC: " + str.format("{0,number,#.##}", close) + "\nETH: " + str.format("{0,number,#.##}", c_sec)

alert(_s, alert.freq_once_per_bar_close)

enter image description here

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