Skip to main content
EMA 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.
The terminal’s own EMA, as a script: the smallest complete indicator.

How it works

ta.ema(length) is created once, at the top, and updated once per bar in onBar. Like every ta function it matches TradingView’s built-in, including its seed: the simple average of the first length values. The Source input picks which bar value to average.

The script

ema.ts

Next step

See the next example, 4h EMA.
Last modified on October 16, 2026