微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

没有行延续的 Pine Script 错误行尾

如何解决没有行延续的 Pine Script 错误行尾

我正在考虑在 pine 脚本上创建一条平均三个的趋势线。到目前为止,如果我不使用 3 的平均值,它可以工作,但如果我使用,它会出现错误:不匹配的输入“看跌”期待“没有行延续的行尾”。

trendLength_1 = input(title = "Trend Length_1:",defval = 10)
trendLength_2 = input(title = "Trend Length_2:",defval = 20)
trendLength_3 = input(title = "Trend Length_3:",defval = 30)

trend_1 = lowest(security_low,trendLength_1) + ((highest(security_high,trendLength_1) - lowest(security_low,trendLength_1)) / 2)
trend_2 = lowest(security_low,trendLength_2) + ((highest(security_high,trendLength_2) - lowest(security_low,trendLength_2)) / 2)
trend_3 = lowest(security_low,trendLength_3) + ((highest(security_high,trendLength_3) - lowest(security_low,trendLength_3)) / 2)
trend = (0.5 * trend_1) + (0.3 * trend_2) + (0.2 * trend_3)

bearish = true

for i = 0 to trendConfirmationLength - 1
        bearish := bearish and (security_close[i] < trend[i])

如果有人能发现语法错误,我们将不胜感激。谢谢!

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。