built-in - 内置函数“highestbars”有错误吗?
问题描述
这是一个简单的测试来证明这个问题:
//@version=4
study("Triangle",overlay=false)
length=input(title="Length",type=input.integer,defval=244)
long=input(title="Distance from 1 high",type=input.integer,defval=80)
x1=int(0)
x1:=-1*highestbars(length)>long?-1*highestbars(length):0
plot(x1,color=color.purple)
这是意外的输出。
解决方案
利用:
h = highestbars(length)
x1:=-1*h>long?-1*h:0
推荐阅读
- python - 从仪表板python beautifulsoup中提取数据时标签中不存在的值
- javafx - 在 JavaFX 中,如何将画布上的多个对象渐变填充为一个对象?
- sql - SQL 服务器。使用聚合函数时出现动态查询错误
- javascript - 每秒 Socket.IO 触发请求
- reactjs - 使用 date-fns 进行时区转换
- java - 在后台进程运行时执行当前流程 - 单反应式编程
- ssh - 使用 jumpserver 的 SSH 配置
- node.js - “端口未打开错误/权限问题”或“没有显示数据的错误”电表读数,Node.js
- typescript - TypeScript:自定义 Express 路由器上的自定义请求类型 (TS2769)
- cassandra - 询问 cassandra 基准测试结果