Skip to main content
Have an AI write scripts for you. The whole reference comes as one text file, and every problem the editor reports has a stable code a model can act on.

The reference for an AI

scripting/llms.txt indexes the whole scripting reference: these guides, each section of the API’s TypeScript declarations, every diagnostic code, every example and every built-in indicator, each a file of its own with its size, so a model reads only what the script needs. llms-full.txt is all of it in one file, about 140,000 tokens, for a model with room to read it whole. Both are built from the same sources as these pages and the engine, so they match what the terminal runs. Give a model the index with your request, then paste the script into the editor.

What to ask for

A model writes a better script when the request says what it should read and draw. Name:
  • the data: the chart’s bars, another interval or market, the tape, liquidations, liquidation levels, the order book, open interest, funding or breadth;
  • what to plot and where: on the price pane, in a pane of its own, as a line, bars, markers or a table;
  • the settings the reader should be able to change;
  • what should happen on the bar still forming: follow the price live, or wait for the bar to close.
For example: “Using the 0xArchive scripting reference, write a script that plots, in its own pane, the USD of long liquidations less short liquidations on each bar, with a setting for the smallest liquidation to count, and marks bars where more than $5M of longs were liquidated.” The rules a model most often breaks are in how a script runs: constructors only at the top, persistent values as declared state, and indicators updated on every bar.

Fixing what it wrote

The editor checks a script as you type and lists each problem with its line and a code, such as OX1003 for a top-level let. Give the model the list: each code’s entry in diagnostics says what is wrong and what to do. Codes never change meaning, so a fix-up loop can key on them. OX9xxx codes are the engine’s own failures, never the script’s.

Next step

Look up a code in diagnostics.
Last modified on October 29, 2026