如何在 pinescript 上编写动态警报?

时间:2021-05-01 11:39:33

标签: alert pine-script indicator

我正在尝试为我的交易视图策略创建动态警报,但是当我输入下面的代码时。我收到一条错误消息,内容为:

<块引用>

输入“入场价格“{{strategy.order.price}}”的语法错误

这是代码:

alert_msg_long = 
     "{{strategy.order.id}} : {{ticker}}"
     "Entry price " {{strategy.order.price}}"

     "Stop loss = {{long_stop_level}}"

     "Move SL to breakeven when price hit : {{take_profit_long}}"

     "Timeframe : {{interval}}"

     "###################\n\n"
     "Trailing Stop:"

     "Activation Price = {{take_profit_long}}"

     "Callback rate = 5%"

     "Mark Price"


alert_msg_short = 
     "{{strategy.order.id}} : {{ticker}}"
     "Entry price " {{strategy.order.price}}"

     "Stop loss = {{long_stop_level}}"

     "Move SL to breakeven when price hit : {{take_profit_long}}"

     "Timeframe : {{interval}}"

     "###################\n\n"
     "Trailing Stop:"

     "Activation Price = {{take_profit_long}}"

     "Callback rate = 5%"

     "Mark Price"

strategy.entry(id="Long Entry ", long=true, alert_message = alert_msg_long)
strategy.entry(id="Short Entry ", long=false, alert_message = alert_msg_short)

请大家帮帮我。谢谢。

0 个答案:

没有答案