首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在pine-script中将3个逗号放入alert()中

在pine-script中将3个逗号放入alert()中
EN

Stack Overflow用户
提问于 2021-11-16 03:54:34
回答 1查看 90关注 0票数 0

我正在使用这个策略:

if (非na(vrsi))

代码语言:javascript
复制
if (ta.crossover(vrsi, overSold) and ta.crossover(source, lower))
    strategy.entry("RSI_BB_L", strategy.long, comment="RSI_BB_L")
    alert("BUY alert", alert.freq_once_per_bar)       
    
else
    if (ta.crossunder(vrsi, overBought) and ta.crossunder(source, upper))
        strategy.close(id = "RSI_BB_L", comment="close")
        alert("SELL alert", alert.freq_once_per_bar)

我需要将此字符串添加到购买提醒消息中:

{ "message_type":“机器人”,"bot_id":6517352,"email_token":"d106a1fc-6b41-410c-9532-38253f7273c5","delay_seconds":0}

当我尝试这样做时:

alert("{"message_type":“机器人”,"bot_id":6517352,"email_token":"d106a1fc-6b41-410c-9532-38253f7273c5","delay_seconds":0}",alert.freq_once_per_bar)

我得到:不匹配的输入'message_type‘应为')’

任何建议都是很棒的:)

EN

回答 1

Stack Overflow用户

发布于 2021-11-16 06:36:52

使用'‘来转义"“。

代码语言:javascript
复制
alert('{ "message_type": "bot", "bot_id": 6517352, "email_token": "d106a1fc-6b41-410c-9532-38253f7273c5", "delay_seconds": 0 }')
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/69983571

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档