TradingView Pine 脚本 - "Create Alert" 中未出现警报选项

TradingView Pine Script - Alert options doesn't appear in "Create Alert"

我正在尝试修改具有警报功能的内置脚本 价格渠道策略,但我无法让它发挥作用。

我的问题是 "Create Alert" 中没有出现选择我的警报 xxxLONGxxx 和 xxxSHORTxxx

的选项

我唯一添加的是(如文档所示): alertcondition(hh, title='xxxLONGxxx', message='GO LONG!') alertcondition(ll, title='xxxSHORTxxx', message='GO SHORT!')

整个脚本:

strategy("Price Channel Strategy", overlay=true)
length = input(120)
hh = highest(high, length)
ll = lowest(low, length)
if (not na(close[length]))
    strategy.entry("PChLE", strategy.long, comment="PChLE", stop=hh)
    strategy.entry("PChSE", strategy.short, comment="PChSE", stop=ll)

alertcondition(hh, title='xxxLONGxxx', message='GO LONG!')
alertcondition(ll, title='xxxSHORTxxx', message='GO SHORT!')

为什么它不起作用?

Alerts 不使用策略:

While the presence of alertcondition calls in a Pine strategy script will not cause a compilation error, alerts cannot be created from them

因此,将您的策略​​转换为指标。