Skip to content
TradequixDocsOpen the terminal
OverviewStart here, search, progress
  • Introduction
  • Quickstart
  • How a script runs
  • Types and qualifiers
  • Operators, conditionals and loops
  • Functions and methods
  • Objects and enums
  • Arrays, matrices and maps
  • Strings and colours
  • Time and sessions
  • Bar states
  • Plotting
  • Inputs
  • Technical analysis
  • Drawings and tables
  • Multiple timeframes
  • Strategies
  • Alerts in scripts
  • Repainting
  • The Pine editor
  • Indicator settings
  • Coming from TradingView
  • The data
  • Publish and sell
  • Catalogue and community
  • Your dashboard and earnings
  • Errors and debugging
  • Limits
  • Coverage
  • Built-in catalogue
  • Cookbook
  • Write Pine with AI
  • FAQ
  • Glossary
  • Cheat sheet
  • Function reference
  • Will it run here?
  • Error index

Reference

Write Pine with AI

Give an AI assistant these docs and Tradequix's rules, so the scripts it writes actually run here. Includes a ready prompt and a review checklist.

View as MarkdownOpen in ClaudeOpen in ChatGPT

AI assistants write Pine well, but they write it for TradingView. They assume fundamentals exist, that volume is traded size, and that any timeframe works. Give them these docs first and those mistakes mostly disappear.

Three ways to give an assistant the docs#

  1. One page. Every page has Copy page, View as Markdown, Open in Claude and Open in ChatGPT. The last two start a chat that is told to read that page.
  2. Everything. llms-full.txt is the whole documentation as one plain-text file. The Copy all docs for AI button on the docs home puts it on your clipboard; paste it at the start of a chat.
  3. An index. llms.txt lists every page with a one-line summary and a link to its markdown. Tools that understand the llms.txt convention (editors, coding agents) can read it and fetch only what they need.

Any page's markdown is also at its address plus .md, for example /docs/plotting.md. The whole function reference is one markdown file too.

Install it in your coding assistant#

If you write Pine in an editor with an AI assistant, install the rules once and it follows them every time:

  • Claude Code. Save SKILL.md as .claude/skills/tradequix-pine/SKILL.md in your project (or in ~/.claude/skills/ for every project). Claude uses it whenever you ask for a Tradequix indicator or paste a console error.
  • Cursor. Save tradequix-pine.mdc as .cursor/rules/tradequix-pine.mdc. It applies to .pine files.

Both carry the same rules as the prompt below, plus links to the reference and the error index so the assistant can check before it writes.

A prompt that works#

Paste this, then describe your indicator:

text
You are writing Pine Script v6 for Tradequix, which runs Pine on PineTS over a live OTC candle feed.
Follow these rules:
- Start with //@version=6 and indicator(...) or strategy(...).
- Use only price data: open, high, low, close, volume, time. Volume is a tick count, not traded size.
- Do not use request.financial, request.earnings, request.dividends, request.economic or request.footprint; they return na here.
- request.security works on these timeframes: 5S 10S 15S 30S 1 2 3 5 10 15 30 60 240 D. Others are aggregated; nothing below 5 seconds.
- plotshape and plotchar only draw where the series is true or a non-zero number.
- Do not use import; libraries are not available.
- Prefer barstate.isconfirmed for signals that must not repaint.
Write the complete script, then list any assumption you made.

Review what comes back#

Before you trust an AI-written script, check:

  • It runs. Paste it into the editor and press Add to chart; read the console.
  • It draws where you expect. Markers that never appear usually mean a plotshape series that is never true.
  • It does not look ahead. No close[-1], no lookahead_on on the current bar's value.
  • Strategy settings are realistic: commission, slippage, position size.
  • Inputs have sensible minval and defaults.

Tip

When the script fails, paste the console message back to the assistant along with the page it relates to (for example Errors and debugging). It fixes most errors in one round.

PreviousCookbookNext FAQ

On this page

  • Three ways to give an assistant the docs
  • Install it in your coding assistant
  • A prompt that works
  • Review what comes back

Use with AI

View as MarkdownOpen in ClaudeOpen in ChatGPT