pine-script - 松脚本趋势线获取当前价格问题
问题描述
我有以下脚本:
s1_first_line2 := trend_s1_line_extend ? line.new(
sm_bag_ready ? s1T_fx : na,
sm_bag_ready ? s1T_fy : na,
sm_bag_ready ? s1T_tx : na,
sm_bag_ready ? s1T_ty : na,
extend = extend.right,
xloc = xloc.bar_time,
color = trend_s1_use_colors == false ? trend_s1_color_default :
(sTriDir == 1) ? trend_s1_line_color_up : trend_s1_line_color_dn,
style = trend_s1_xline_style,
width = trend_s1_xline_width) : na
// }}}
currentLineValue = line.get_price(s1_first_line2, bar_index)
我无法获得趋势线的当前价格。它给出了错误:
line.get_price 必须与使用 xloc=xloc.bar_index 创建的行一起使用
我怎样才能使当前价格高于趋势线?
最好的
解决方案
startPrice = line.get_y1(id=line1) endPrice = line.get_y2(id=line1)
推荐阅读
- javascript - Web 应用程序的屏幕截图
- c# - 监控线程
- reactjs - 不能把这个 div 滚动条放到底部
- c++ - 功能
对于 boost::bind() 返回的任何内容 - c - 打印控制台页面后,如何暂停我的 C 程序?
- python - 通过一系列类访问函数
- c# - C# 从 Google GeoCoding API 获取经纬度
- php - 使用队列(数据库)时没有重叠的laravel调度程序
- php - 这样的问题怎么可能发生:一个整数是非数字的?
- hyperledger-composer - 在 WSL (ubuntu 16.04) 上启动 fabric-composer 时 Docker 容器退出 (1) 错误