新的Pine编辑器V5函数“请求。Security_lower_tf()"不用活跃的蜡烛工作

发布于 2025-02-05 20:50:57 字数 1030 浏览 3 评论 0原文

这是我要实现的目标: 在此处输入图像描述

这是我所指的函数:

//@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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

我只土不豪 2025-02-12 20:50:58

它似乎是固定的。
请再次检查,看起来一切都按预期工作。

It's seems to be fixed.
Please check again, it looks like everything is working as expected now.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文