pine-script - Pine 脚本,如果问题
问题描述
我在下面的代码中有问题,你能帮我解决吗?
if wt1 < 5 and wt1 > -5
plot(cross(wt1, wt2) ? wt2 : na, color = black , style = circles, linewidth = 4)
plot(cross(wt1, wt2) ? wt2 : na, color = (wt2 - wt1 > 0 ? red : lime) , style = circles, linewidth = 4)
else if wt1 > 53 and wt2 > 53
plot(cross(wt1, wt2) ? wt2 : na, color = black , style = circles, linewidth = 4)
plot(cross(wt1, wt2) ? wt2 : na, color = (wt2 - wt1 > 0 ? red : lime) , style = circles, linewidth = 4)
else if wt1 < -53 and wt2 < -53
plot(cross(wt1, wt2) ? wt2 : na, color = black , style = circles, linewidth = 4)
plot(cross(wt1, wt2) ? wt2 : na, color = (wt2 - wt1 > 0 ? red : lime) , style = circles, linewidth = 4)
else
na
解决方案
我不是心灵感应者,但我会尝试猜测您对运算符中的空格有疑问if
if wt1 < 5 and wt1 > -5
plot(cross(wt1, wt2) ? wt2 : na, color = black , style = circles, linewidth = 4)
plot(cross(wt1, wt2) ? wt2 : na, color = (wt2 - wt1 > 0 ? red : lime) , style = circles, linewidth = 4)
else if wt1 > 53 and wt2 > 53
plot(cross(wt1, wt2) ? wt2 : na, color = black , style = circles, linewidth = 4)
plot(cross(wt1, wt2) ? wt2 : na, color = (wt2 - wt1 > 0 ? red : lime) , style = circles, linewidth = 4)
else if wt1 < -53 and wt2 < -53
plot(cross(wt1, wt2) ? wt2 : na, color = black , style = circles, linewidth = 4)
plot(cross(wt1, wt2) ? wt2 : na, color = (wt2 - wt1 > 0 ? red : lime) , style = circles, linewidth = 4)
else
na
推荐阅读
- python - 我无法在 Mac OS 中运行 mongo 服务
- assembly - 为什么 int 3 会导致一般保护故障?
- javascript - 刷新页面后如何保留复选框值以获取名称 =“检查[0]”之类的数组
- database - 无需指定列详细信息即可从命令行将 CSV 文件加载到 Oracle 数据库的新表中的简便方法
- jenkins - 由于何时有条件以及如何避免通知成功,詹金斯的工作被跳过
- java - 在 Java 中替换 ASCII 代码和 HTML 标记
- docker - OpenCV Docker 多阶段构建 - 无法安装预构建源
- angular - 相同的减速器但不同的状态
- powershell - 如何从以下脚本导出 AD 中不正确或不可用的用户名和计算机名列表?
- bosch-iot-suite - Vorto 仪表板不显示设备型号