filter - 用于过滤的 ATR 不适用于斐波那契
问题描述
我找不到 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
解决方案
推荐阅读
- c++ - 奇怪的溢出分配 2 * 1024 * 1024 * 1024
- javascript - 与后端连接时如何修复 Apisauce 上的网络错误
- plasticscm - PlasticSCM 问题:无法建立连接,因为目标机器主动拒绝它 127.0.0.1:8084
- php - 您如何在 Stripe 的预建结帐流程中的 webhook 中捕获付款?
- php - 正则表达式拆分混合表达式的组合
- git - 批准 git pull 请求会丢失更改吗?
- macos - 在 Mac OS Big Sur 版本 11.0.1 上安装 circos 时缺少 GD
- c# - 使用库提供的事件处理程序
- javascript - Vue向数组添加新值
- batch-file - 如何从批处理文件动画中删除闪烁?