当RSI值超买或超卖时,我希望我的松树脚本提醒我,在警告消息中,我希望它告诉我RSI值。这是我的剧本的一部分:
//RSI Value
rsiValue = rsi(src, len)
rsiOverbought = barssince(rsiValue > overbought) == 1
rsiOversold = barssince(rsiValue < oversold) == 1
//Alerts
alertcondition(condition=(rsiOverbought or rsiOversold), title="RSI Overbought or Oversold", message = "RSI Overbought or Oversold (RSI is " + tostring(rsiValue, "#.00)"))保存脚本时,总是会收到以下错误消息:
Cannot call 'alertcondition' with 'message'=series[string]. The argument should be of type: const string
我该怎么解决呢?
发布于 2022-01-05 07:04:43
警报条件仅限于绘制变量字符串的值。您只能使用警告()这样构建字符串。有关占位符的更多信息,以及使用绘图作为警报条件()字符串中的变量的信息,访问此URL
https://stackoverflow.com/questions/70548308
复制相似问题