---
title: "Run Pine Script indicators on Hyperliquid"
description: "Paste a Pine v5 or v6 indicator into the free 0xArchive Terminal and run it on Hyperliquid and Lighter charts, with footprints built from real fills."
canonical_url: "https://0xarchive.io/resources/market-data-guides/pine-script-hyperliquid"
markdown_url: "https://0xarchive.io/resources/market-data-guides/pine-script-hyperliquid.md"
route: "/resources/market-data-guides/pine-script-hyperliquid"
robots: "index, follow"
generated_from: "prerendered_html"
---

# How to run Pine Script indicators on Hyperliquid, a 0xArchive Terminal guide

October 20, 2026

13 min read

- [Lighter](https://0xarchive.io/resources?topic=lighter)
- [Hyperliquid](https://0xarchive.io/resources?topic=hyperliquid)

*0xArchive guide · Hyperliquid and Lighter*

The [0xArchive Terminal](https://terminal.0xarchive.io/) runs Pine Script® indicators on [Hyperliquid](https://hyperliquid.xyz/) and [Lighter](https://lighter.xyz/) charts. Paste a Pine v5 or v6 `indicator()` script into its script editor, press **Add to chart**, and it draws on the market you have open.

The Terminal is free and needs no account. Your scripts stay in your browser.

![The 0xArchive Terminal script editor with a 12-line Pine Script v5 Bollinger %B indicator pasted in. The Pine toggle is on, the problems bar reads No problems, and the footer offers Show as TypeScript and Add to chart.](https://api.0xarchive.io/cms-assets/2026/10/63ff16ad-db8c-419c-809a-4a16c91be3f1.webp)

A Bollinger %B indicator in Pine Script v5, pasted into the 0xArchive Terminal's script editor. The editor saw Pine and switched to it, and the check found no problems. Captured 19 Oct 2026, 18:20 UTC.

## Paste a Pine v5 or v6 indicator and it runs on any Hyperliquid or Lighter chart

Open the chart you want, then **Indicators**, then **New script**. Paste the script. The editor sees Pine and switches its language toggle to it on its own.

Here is the script in the screenshot, a standard Bollinger %B:

```pine
//@version=5
indicator("Bollinger %B", shorttitle="%B")
len = input.int(20, "Length", minval=1)
mult = input.float(2.0, "Deviations", minval=0.1)
basis = ta.sma(close, len)
dev = mult * ta.stdev(close, len)
pctb = (close - (basis - dev)) / (2 * dev)
plot(pctb, "%B", color=color.blue)
hline(1, "Upper", linestyle=hline.style_dashed)
hline(0, "Lower", linestyle=hline.style_dashed)
plotshape(ta.crossover(pctb, 0), "Back inside", shape.triangleup, location.bottom, color=color.teal)
```

The editor checks it as you type. A problem shows against your own Pine line number, so you fix it where you wrote it.

![The Hyperliquid BTC 1-hour chart in the 0xArchive Terminal with the pasted %B indicator in a pane underneath: a blue line between dashed bands at 1 and 0, and teal triangles where it climbs back above 0.](https://api.0xarchive.io/cms-assets/2026/10/604f1779-c930-4a45-935a-5987ba335243.webp)

The pasted Pine %B on the Hyperliquid BTC 1-hour chart, 12 to 19 Oct 2026. Teal triangles mark the bars where %B crossed back above 0, the lower band. Its inputs, 20 and 2, show in the pane's legend. Captured 19 Oct 2026, 18:20 UTC.

The same script runs on every market the Terminal charts. Switch the chart to ETH, a HIP-3 stock perp or a Lighter market, and the indicator follows.

## `request.footprint` reads order flow from Hyperliquid's own fills

Pine's `request.footprint` asks for each bar's volume split into buying and selling. In the Terminal it is built from the market's trades, the fills 0xArchive records from Hyperliquid itself, with the side of every taker.

```pine
//@version=6
indicator("Bar delta from the footprint", shorttitle="FP delta")
fp = request.footprint(100)
d = na(fp) ? na : fp.delta()
plot(d, "Delta", style=plot.style_columns, color=d >= 0 ? color.teal : color.red)
```

That script plots each bar's delta: taker buying minus taker selling, in BTC.

![The Hyperliquid BTC 1-hour chart in the 0xArchive Terminal with an FP delta pane underneath: teal columns above zero and red columns below, one per bar, with the biggest red bars during the drop on 15 Oct.](https://api.0xarchive.io/cms-assets/2026/10/58501cbe-f4d4-4745-90c8-07dac82cdcc0.webp)

Bar delta from request.footprint on the Hyperliquid BTC 1-hour chart. Teal bars had more taker buying than selling and red bars more selling, in BTC. The pane starts on 13 Oct: trades reach back to the chart's first bar, at most 7 UTC days. Captured 19 Oct 2026, 18:20 UTC.

Trades reach back at most 7 UTC days from the chart's first bar. Bars older than that read `na`, which is why the script checks `na(fp)` first.

## Show as TypeScript turns the Pine into a script you can extend

Every pasted Pine script becomes a TypeScript script when it loads, and the TypeScript is what runs. **Show as TypeScript**, in the editor's footer, swaps your Pine for it. Undo brings the Pine back.

![The same Bollinger %B after Show as TypeScript. Comment lines at the top keep the Pine source and the TradingView trademark notice; below them, indicator, bars, input.int, input.float, ta.sma, ta.stdev and plot calls.](https://api.0xarchive.io/cms-assets/2026/10/ddf15506-e589-4730-b5df-4d54eb19fee0.webp)

The %B script after Show as TypeScript. The Pine source stays at the top as comments. Each Pine call has a counterpart: input.int, ta.sma, ta.stdev, plot.line and plot.level. Captured 19 Oct 2026, 18:20 UTC.

Each Pine idea maps to one thing in the TypeScript:

| Pine | TypeScript in the Terminal | Note |
| --- | --- | --- |
| `ta.sma(close, len)` | `ta.sma(len)`, updated each bar | One instance per call |
| `var x = ...` | `state.bar(...)` | Kept between bars |
| `x[n]` | `.ago(n)` on a series | Bars back |
| `request.security` on the same ticker | A second `bars({ interval })` | Reads closed bars only |
| `plot`, `hline`, `plotshape` | `plot.line`, `plot.level`, `plot.shape` | Drawn in the script's pane |
| `alertcondition` | `alert` | Fires while the chart is open |

The `ta.*` formulas follow [PyneSys](https://pynesys.io/) 's PyneCore, which the editor credits in its footer.

## A few lines of TypeScript mark the bars where longs were stopped out

Once the script is TypeScript, it can read any stream the Terminal gives a script. One of them is `trades()`, where every Hyperliquid fill carries `takerWhy`: what the taker did to its own position.

`stop_long` means the taker cut a long at a loss, or was liquidated out of one. Added to the %B script, it marks the bars where price sat below the lower band and at least $250,000 of longs were stopped out:

```typescript
const tape = trades();
const minStops = input.float('Longs stopped out, at least ($)', 250000, { min: 0 });
const stopped = tally();
const marks = plot.markers('Longs stopped out');

tape.onTrade((t) => {
  if (t.takerWhy === 'stop_long') stopped.add(t.notional);
});

// inside chart.onBar, after %B is computed:
if (tape.available && pctb < 0 && stopped.value >= minStops) {
  marks.add({ position: 'below', shape: 'circle', text: fmt.usd(stopped.value), color: color.down });
}
```

![The Hyperliquid BTC 1-hour chart in the 0xArchive Terminal with a %B stops pane: the same blue %B line, and pink dots under the bars where %B was below 0 and at least $250,000 of longs were stopped out, in clusters from 13 to 18 Oct.](https://api.0xarchive.io/cms-assets/2026/10/b2825704-7b30-448c-8a9e-d7da9db4c035.webp)

The %B script extended in TypeScript on the Hyperliquid BTC 1-hour chart. Pink dots mark bars where %B was under 0 and at least $250,000 of longs were stopped out or liquidated, from takerWhy on each fill. Captured 19 Oct 2026, 18:20 UTC.

A close under the lower band looks the same on every chart. The dots split those bars into ones where longs were forced out and ones where they were not.

`takerWhy` is recorded on Hyperliquid and HIP-3. On Lighter it reads `null`, so this marker stays empty there while the %B line still draws.

## Strategy scripts, Pine v4 and library imports are refused for now

Each refusal comes with a message saying what to do instead.

| What you paste | What happens | What to do |
| --- | --- | --- |
| A `strategy()` script | Refused, strategies come later | Change it to `indicator()` and plot its signals with `plotshape` |
| Pine v4 or older | Refused | Convert it to v5 or v6 in TradingView's Pine Editor, then paste it |
| An `import` of a library | Refused for now | Paste the library's functions above the lines that use them |
| `request.financial`, `request.economic` and other TradingView-only data | Refused | Remove the call, or use the chart's own data |

`request.security` on another ticker works for Binance, Bybit and OKX crypto tickers. Macro tickers such as `TVC:DXY` are TradingView-only data.

## Common questions

**Can you use Pine Script on Hyperliquid?** Yes. The 0xArchive Terminal translates Pine v5 and v6 `indicator()` scripts and runs them on Hyperliquid and Lighter charts, free and without an account.

**Does the Terminal run Pine strategies?** Not yet. `strategy()` scripts are refused with a message, and indicators run.

**Where does the order-flow data come from?** From 0xArchive's record of Hyperliquid fills, with the taker side and what each side did to its position. `request.footprint` and `trades()` read up to 7 UTC days of it, then follow the live tape.

**Is it TradingView?** No. Pine Script is a registered trademark of TradingView, Inc., and the Terminal is an independent product that reads the language. Your scripts keep their own licences and notices.

## Run this analysis from an agent

An AI can write these scripts for you. The [Terminal's scripting reference for agents](https://docs.0xarchive.io/terminal/guides/agents) explains how, and [terminal/llms.txt](https://docs.0xarchive.io/terminal/llms.txt) puts every guide, diagnostic code and example in one file to hand a model. For the data behind the scripts, the [0xArchive MCP server](https://docs.0xarchive.io/mcp-server) gives an agent the same Hyperliquid and Lighter history in plain language. Start with the [agent surfaces overview](https://docs.0xarchive.io/agent-surfaces).

## Route references

The [Pine Script guide](https://docs.0xarchive.io/terminal/guides/pine) lists every Pine mapping and refusal, and [your first script](https://docs.0xarchive.io/terminal/guides/first-script) starts from TypeScript. The [order flow guide](https://docs.0xarchive.io/terminal/guides/order-flow) covers `trades()`, `takerWhy` and footprints, and the [stopped-out footprint](https://docs.0xarchive.io/terminal/examples/stopped-out-footprint) and [RSI cross, pasted Pine](https://docs.0xarchive.io/terminal/examples/rsi-pine) examples open in the editor. Every script runs within the [limits](https://docs.0xarchive.io/terminal/guides/limits). The [Terminal launch post](https://0xarchive.io/resources/product-updates/0xarchive-terminal) covers the rest of the Terminal, and the [order flow data page](https://0xarchive.io/data-types/order-flow) the data underneath.

For current API availability and plan details, use the [Hyperliquid data API](https://0xarchive.io/hyperliquid), [data catalog](https://0xarchive.io/data/catalog), [pricing](https://0xarchive.io/pricing), and [status](https://0xarchive.io/status).
