首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >电视/拼音-编译错误。第9行:输入“TrueRange”时的语法错误

电视/拼音-编译错误。第9行:输入“TrueRange”时的语法错误
EN

Stack Overflow用户
提问于 2022-10-29 22:25:33
回答 1查看 20关注 0票数 0
代码语言:javascript
运行
复制
indicator("sigbars")
study("Significant Bar gku", shorttitle="Significant Bar", overlay=false) 
length=input(14, "length")
ThreshStrong = input(2, "Strong Significant Bar")
ThreshWeak = input(1.4, "Weak Significant Bar")
TrueRange = at.tr
ATR = atr(length)
strongSB = tr > ATR*ThreshStrong
weakSB = tr > ATR*ThreshWeak
cold1=white
cold2=#b2ebf2
color = strongSB ? cold1 : weakSB ? cold2 : na
band1 = hline(ThreshStrong, "Upper Band", color=#C0C0C0)
band0 = hline(ThreshWeak, "Lower Band", color=#C0C0C0)
fill(band1, band0, color=#9915FF, transp=90, title="Background")
plot(tr, "true range", blue)
plot(ATR, "ATR", black)
plot(tr/ATR,"TR/ATR", red, style = histogram)
//plot(ma,"ma(TR/ATR)", green)
barcolor(color)

plot(close)

我从一位程序员那里抄袭了这段代码,但它似乎对我不起作用;我的经验非常有限,所以我运气不好,希望有人能给我指明正确的方向-

我一直得到以下错误9:18:39 AM -编译错误。第9行:输入“TrueRange”时的语法错误

EN

Stack Overflow用户

发布于 2022-10-31 07:30:13

这是你的密码

代码语言:javascript
运行
复制
//@version=5
indicator("Significant Bar gku", shorttitle="Significant Bar", overlay=false) 
length=input(14, "length")
ThreshStrong = input(2, "Strong Significant Bar")
ThreshWeak = input(1.4, "Weak Significant Bar")
TrueRange = ta.tr
ATR = ta.atr(length)
strongSB = ta.tr > ATR*ThreshStrong
weakSB = ta.tr > ATR*ThreshWeak
cold1=color.white
cold2=#b2ebf2
color = strongSB ? cold1 : weakSB ? cold2 : na
band1 = hline(ThreshStrong, "Upper Band", color=#C0C0C0)
band0 = hline(ThreshWeak, "Lower Band", color=#C0C0C0)
fill(band1, band0, color=#9915FF, transp=90, title="Background")
plot(ta.tr, "true range", color.blue)
plot(ATR, "ATR", color.black)
plot(ta.tr/ATR,"TR/ATR", color.red, style = plot.style_histogram)
//plot(ma,"ma(TR/ATR)", green)
barcolor(color)

plot(close)
票数 0
EN
查看全部 1 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/74249281

复制
相关文章

相似问题

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