在交易视图提醒中,当使用{{strategy.order.comment}}时,我的评论没有显示,而是策略订单ID,为什么会出现这种情况?下面是确切的脚本。
strategy.entry(id=“Short”,direction=strategy.short,stop=ShortEntry,comment=“{”alertId”:“ea581e08-d600-4fd9-b6a6-9185cfd5f737”}“)
使用 {{strategy.order.comment}},我希望警报消息显示 {"alertId": "ea581e08-d600-4fd9-b6a6-9185cfd5f737"} 但警报消息显示为“短”。已将这个类似的脚本用于其他警报并且工作正常,但这个特定的脚本表现得很奇怪......请帮忙!!
我尝试更改评论字段以进行任何更改,但没有成功(仍然只显示 id 部分..)
一般情况下,使用comments作为图表,并使用alert_message通过weebhook发送字符串
类似这样的事情:
if shortCondition
strategy.entry(
'Short',
strategy.short,
stop = ShortEntry,
alert_message = '{"alertId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}')
comment = 'Short')
您可以使用占位符{{strategy.order.alert_message}},但我认为在这种情况下没有必要
尝试使用您使用过的相同参数重新创建警报。只需删除当前的并设置一个新的即可。
警报似乎取决于脚本的版本。更改脚本后,需要再次创建警报(而不是简单地更改)。