在 TradingView 策略的 alert_message 中应用 {{plot("Name")}}

Apply {{plot("Name")}} in TradingView strategy's alert_message

如何在策略脚本中使用 alert_message 中的变量? 如果该条件不可用,除了 strategy.xxx 变量之外,还有其他使用变量的解决方案吗?

由于策略提醒文本可以是动态的,因此它比研究中的alertcondition()文本灵活得多。你可以使用这样的东西:

strategy.entry("Long", strategy.long, when=GoLong, alert_message='long slprice=' + tostring(stoploss_long) + ' tradeid=' + tostring(trade_id) +' tp=' + tostring(TakeProfitLevel))