Skip to main content
4h EMA 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.
A 20-period EMA of the 4-hour closes, drawn on a 15-minute chart. It steps when each 4-hour bar closes.

How it works

bars({ interval: '4h' }) is a second stream with its own handler, which updates the EMA. The chart’s handler reads ema.confirmed: the value as of the last closed 4-hour bar. That is the no-lookahead rule: history only ever sees what was known at the time, so the line is drawn where it would have been live.

The script

higher-timeframe.ts

Next step

See the next example, Anchored VWAP bands.
Last modified on October 16, 2026