【发布时间】:2022-06-22 02:07:07
【问题描述】:
这是我的目标: enter image description here
这是我指的功能:
//@version=5
indicator("`request.security_lower_tf()` Example", overlay = true)
// If the current chart timeframe is set to 120 minutes, then the `arrayClose` array will contain two 'close' values from the 60 minute timeframe for each bar.
arrClose = request.security_lower_tf(syminfo.tickerid, "60", close)
if bar_index == last_bar_index - 1
label.new(bar_index, high, str.tostring(arrClose))
问题出在哪里:
-
此函数显示已经关闭的蜡烛(过去的蜡烛)的较低时间框架蜡烛
-
我想要的是...显示过去的蜡烛图(已经关闭)...以及当前活跃的蜡烛图
如果我去改变这部分:
if bar_index == last_bar_index - 1
...这部分:
if bar_index == last_bar_index
...它显示(在屏幕上)正确的数据(过去的蜡烛+活动蜡烛)...然后它从屏幕上消失...好像它闪烁了几秒钟然后数据就消失了。
为什么要这样做?超出范围?有什么想法吗?
【问题讨论】:
标签: pine-script pinescript-v5 pine-script-v4 pine-editor