Skip to main content
Ichimoku, pasted Pine on a BTC chart

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

Open on a chart

Load it on BTC 4h in the terminal, then change its settings or open it in the script editor.
The Ichimoku example as Pine Script v6 pasted from TradingView, user function and offsets included.

How it translates

  • The user function midpoint(n) calls ta.lowest and ta.highest, which keep history, so the translation makes it a factory called once per call site: each of the three calls keeps its own window.
  • offset = shift - 1 and offset = -shift + 1 become the plots’ offset option, so the leading spans are drawn past the newest bar.
  • The fill coloured by spanA > spanB becomes a plot.fill set each bar with that bar’s colour.
Compare it with Ichimoku, written by hand.

The script

ichimoku-pine.pine

Next step

See the next example, 4h EMA and daily close, pasted Pine.
Last modified on October 16, 2026