pine-scriptpine-script-v5pine-script-v4pine-editor

New Pine editor v5 function "request.security_lower_tf()" not working on active candle


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:

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?


Solution

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