pine-script - 将 3commas 信号放入 pine-script 中的 alert()
问题描述
我正在使用这个策略:
如果(不是 na(vrsi))
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”,“bot_id”:6517352,“email_token”:“d106a1fc-6b41-410c-9532-38253f7273c5”,“delay_seconds”:0}
当我尝试这个时:
alert("{"message_type": "bot", "bot_id": 6517352, "email_token": "d106a1fc-6b41-410c-9532-38253f7273c5","delay_seconds": 0}", alert.freq_once_per_bar)
我得到:不匹配的输入'message_type'期待')'
任何建议都会很棒:)
解决方案
使用 '' 转义 ""。
alert('{ "message_type": "bot", "bot_id": 6517352, "email_token": "d106a1fc-6b41-410c-9532-38253f7273c5", "delay_seconds": 0 }')
推荐阅读
- javascript - 节目当满足特定的 URL 参数时
- xslt - 如何编写一个 XSLT 以将一个子树替换为两个或多个子树,这些子树是由原始子树分裂产生的?
- javascript - 如何让使用 React 制作的轮播上的视频停止自动播放?
- windows-defender - 如何从 Microsoft Defender Win10 中删除排除项?
- r - 跨多个维度(类别)测量两个对象之间的相似性
- python - 使用 pip 21.0.1 在 Python 3.9.2 中安装 Tensorflow 时出错
- azure - Azure 数据工厂问题将数据从本地 sql Server 写入 Azure SQL 数据库
- android - 手机锁定时启动收入电话活动android
- pandas - 熊猫将一列添加到许多其他列
- python - xtensor 的 "operator/" 比 numpy 的 "/" 慢