Write it with AI
Any AI assistant can write wrun. It is TypeScript syntax, which assistants have read a great deal of, and the editor's compiler checks every draft before anything runs.
The loop
- Open a tab. In the editor, press New indicator, or open the indicator you want to change.
- Copy for LLM. Right-click the editor tab and pick Copy for LLM. One paste carries the language rules, the kit's API, your numbered code, every error and your last run.
- Ask. Paste it into any assistant and say what you want, naming everything it should draw (an example is below).
- Run. Put the complete file it returns into the tab and press Run. The compiler names every mistake with a line and column.
- Repeat until it compiles. Copy for LLM again and paste it back. When it compiles, it draws on your chart.
Better results
A request that names everything it wants drawn:
text
An RSI(14) in its own pane with bands at 30 and 70, a dot on every cross
back inside the bands, and an alert on each cross.- Name everything you want drawn. Assistants keep the lines and tend to drop labels, per-bar colors, fills, boxes, tables and alerts. List them in your request, then check the legend and the chart against it.
- Build long scripts in parts. A few hundred lines can outgrow one answer. Ask for the settings and the plotted lines first and press Run; then ask for the drawings, then the alerts, each time with a fresh Copy for LLM.
- Check the numbers before you publish. Compare the result with a version you trust, on the same market and timeframe.
Porting from Pine
Paste your Pine script with a Copy for LLM and ask for a port; the loop above takes it from there. wrun vs Pine shows one indicator in both languages, line for line.