Skip to main content
4h EMA and daily close, pasted Pine on a BTC chart

BTC on 15-minute bars in the 0xArchive Terminal, 2026-10-15.

Open on a chart

Load it on BTC 15m in the terminal, then change its settings or open it in the script editor.
request.security reads the 4-hour and daily bars. The translation turns each into a second bar stream, read closed only, which is Pine’s behaviour with lookahead off.

How it translates

  • Each request.security becomes a second bars() stream on its timeframe, "240" as 4h and "D" as 1d, with the expression computed in that stream’s handler.
  • On history, the chart reads each stream’s last closed bar; live, its forming bar, which is what Pine shows with lookahead off.
  • plot.style_stepline is drawn as a line joined across bars, since a step line is drawn as a plain line here.
See data and timeframes for the same thing written by hand.

The script

htf-pine.pine

Next step

Look up any function in the reference.
Last modified on October 16, 2026