Skip to main content
Trend bars on a BTC chart

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

Open on a chart

Load it on BTC 1h in the terminal, then change its settings or open it in the script editor.
Candles in the up colour while the close holds above a rising EMA, the down colour below a falling one, and grey in between. A label marks a flip of the close across the EMA that holds for two bars, and a dot marks a bar twice as wide as the recent average.

How it works

plot.barColor recolours the chart’s own candles. The flip labels are set on the second bar of a flip and drawn one bar back with offset: -1, so they sit on the bar where the flip began without looking ahead.

The script

trend-bars.ts

Next step

See the next example, Session table.
Last modified on October 16, 2026