pivot - 摆动低点被打破后寻找最高开盘价
问题描述
上面的代码失败并显示错误消息。任何帮助都会有所帮助
//@version=4
study("count", overlay = true)
swh = pivothigh(high,2,1)
swl = pivotlow(low,2,1)
Bcount = barssince(swh)
// plot(Bcount)
highestOpen = valuewhen(crossunder(low,swl), highest(open,Bcount+1),0)
plot(highestOpen)
解决方案
问题是最初的条形图Bcount = barssince(swh)
是 0。
//@version=4
study("count", overlay = true, max_bars_back = 100)
swh = pivothigh(high,2,1)
swl = pivotlow(low,2,1)
Bcount = nz(barssince(swh))
// plot(Bcount)
highestOpen = valuewhen(crossunder(low,swl), highest(open,Bcount+1),0)
plot(highestOpen)
推荐阅读
- gnuplot - 如何在mac上为gnuplot设置默认路径目录
- rxjs - 使用 rxjs 实现可拖动组件
- javascript - 在按钮中编辑 onclick url
- ios - 将 Swift 文件添加到应用程序的资源包时遇到问题
- excel - 使用 Excel VBA 更新 SharePoint 列值
- c++ - 在 Visual Code Studio 中找不到 opencv(适用于 ubuntu 中的 c++)
- visual-studio-2015 - 从特定团队项目中获取代码分支
- scala - Spark withColumn 用于修改列但不添加新列
- mysql - Mysql跨数据库外键
- ios - Firebase 模棱两可的参考“FIRMessagingAPNSTokenType ... 模棱两可”