新的Pine编辑器V5函数“请求。Security_lower_tf()"不用活跃的蜡烛工作
这是我要实现的目标: 在此处输入图像描述
这是我所指的函数:
//@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))
问题IS:
此功能显示已经封闭的蜡烛(过去蜡烛)
我想要的是... 显示过去的蜡烛(已经关闭)... 和当前的活动蜡烛
如果我去更改此部分:
if bar_index == last_bar_index - 1
...与此部分:
if bar_index == last_bar_index
...它显示(屏幕上)正确的数据(过去的蜡烛 +活跃的蜡烛)...然后它从屏幕上消失...好像它闪烁了几秒钟,然后数据消失了。
为什么这样做?超出范围?有什么想法吗?
This is what I'm aiming to achieve:
enter image description here
This is the function I'm referring to:
//@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))
Where the issue is:
this function displays lower timeframe candles for an already closed candle (past candle)
What I want is...to display past candles (already closed)...AND current active candles
If I go and change this part:
if bar_index == last_bar_index - 1
...with this part:
if bar_index == last_bar_index
...it displays (on-screen) the correct data (past candles + active candles)...and then it disappears from screen...as if it flashes for a few seconds and then data is gone.
Why does it do that? Out of range? Any thoughts?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它似乎是固定的。
请再次检查,看起来一切都按预期工作。
It's seems to be fixed.
Please check again, it looks like everything is working as expected now.