问题描述
我找不到 atr 过滤器不工作的原因。我在 ATR 上赋予的任何值都不会影响结果(如果不过滤任何内容)
有没有人有什么建议?或者我如何添加某种“线的角度”类型的过滤器?
//this is the Zig Zag inditator
length = input(5,title = "High/Low length")
h = highest(high,length * 2 + 1 )
l = lowest(low,length * 2 + 1)
f_isMin(len) =>
l == low[len]
f_isMax(len) =>
h == high[len]
var dirUp = false
var lastLow = high * 100
var lastHigh = 0.0
var timeLow = bar_index
var timeHigh = bar_index
var line li = na
f_drawLine() =>
_li_color = dirUp ? color.teal : color.orange
line.new(
timeHigh - length,lastHigh,timeLow - length,lastLow,xloc.bar_index,color=_li_color,width=2
)
if dirUp
if (f_isMin(length) and low[length] < lastLow)
lastLow := low[length]
timeLow := bar_index
line.delete(li)
li := f_drawLine()
if (f_isMax(length) and high[length] > lastLow)
lastHigh := high[length]
timeHigh := bar_index
dirUp := false
li := f_drawLine()
if not dirUp
if (f_isMax(length) and high[length] > lastHigh)
lastHigh := high[length]
timeHigh := bar_index
line.delete(li)
li := f_drawLine()
if f_isMin(length) and low[length] < lastHigh
lastLow := low[length]
timeLow := bar_index
dirUp := true
li := f_drawLine()
if (f_isMax(length) and high[length] > lastLow)
lastHigh := high[length]
timeHigh := bar_index
dirUp := false
li := f_drawLine()
//this is the part not working,the part with (lastHigh-lastLow > atr(24) * 5) doesn't do anything and I don't kNow why. The main reason for it was to filter out the smaller moves which I don't want to see //
alarmC61 = crossover(close,lastHigh - (lastHigh-lastLow) * 0.63) and timeHigh > timeLow and lastHigh-lastLow > atr(24) * 5
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)