Skip to content

Repository files navigation

id readme
title Pine Script v6 knowledge base
type index
group root
tags
index
pine-v6
pine_version v6

Pine Script v6 knowledge base

This knowledge base consolidates the official "Pine Script® User Manual" and "Pine Script® Language Reference Manual" for version 6, structured for both human developers and Large Language Models (LLMs).

validate license: MIT scoped release pine script broken links entities

Deterministic, offline, and optimized for both human developers and Large Language Models (LLMs): 941 entities, 128 documents, 57 namespace digests, zero broken internal links, one validator you can run yourself.

Table of contents

Objective

Turn a raw documentation dump into a knowledge base where a human finds the syntax to fix an error in fewer than three steps, and a language model answers without guessing. Every path, identifier and anchor is derived from a canonical name, so two builds of the same input produce the same tree.

Common use cases

I need to... Go here Steps
Fix an error code errors/_index.md 2
Check one signature INDEX.md 2
Write code in a namespace reference/<ns>/_index.md 2
Migrate a v5 script migration/to-pine-version-6.md 1
Copy working code examples/_index.md 2
Wire this into an agent AGENTS.md 1

Repository map

Path Contents
guide/ Practical guide: primer, language, visuals, concepts, writing.
reference/ 941 entities in 57 namespace folders; each folder opens with a digest.
migration/ v5 to v6 breaking changes and release notes.
examples/ Runnable pair for most guide pages.
errors/ Error and warning codes with fixes.
faq/ Recurring questions.
dist/bundles/ Generated single-file bundle per namespace.
.llm/ Machine layer: JSONL records, schemas, resolver, chunks.
scripts/validate.py Invariant checker, standard library only.

Three ways to read a namespace

Route What you get Tokens for array
Digest reference/array/_index.md every signature, parameter and return type about 2273
Member page reference/array/get.md one entity in full, with remarks and example about 420
Bundle dist/bundles/array.md all member pages concatenated about 20825

Start with the digest. Open a member page for detail. Use the bundle only when you need most of the namespace at once.

Navigation contract

  • Maximum depth is three levels.
  • Every folder exposes _index.md as its entry point.
  • Names are deterministic: ta.sma() is always reference/ta/sma.md.
  • Entities sharing a prefix live together, so reference/ta/ is the whole ta namespace.
  • Generated folders are dist/, .llm/ and the three root indexes. Never edit them by hand.

Largest namespaces

Namespace Entities Digest Bundle
strategy 96 4105 tokens 41308 tokens
ta 69 2870 tokens 21699 tokens
currency 56 1163 tokens 6395 tokens
array 55 2273 tokens 20825 tokens
matrix 49 2015 tokens 20999 tokens
label 43 1773 tokens 12451 tokens
syminfo 42 1424 tokens 18862 tokens
box 30 1498 tokens 8381 tokens

For language models and agents

Artifact Answers
llms.txt Where do I start?
AGENTS.md What rules must I obey when generating code?
.llm/entrypoints.json Which file answers my task at the lowest cost?
.llm/context-packs.json What fits in my context window?
.llm/names.txt Does this name exist? (cheapest check)
.llm/resolver.json Where does this name, alias or URL point?
.llm/entities.jsonl Signature, parameters, return type.
.llm/namespaces.json How large is each namespace?
.llm/keywords.json Which pages mention this term?
.llm/chunks.jsonl How do I chunk this for retrieval?
.llm/migration.json What was this called in v5?
.llm/schema.json What is the exact shape of these records?
.llm/invariants.json What guarantees does the tree hold?
.graph.json How are entities connected?

Verify it yourself

// no dependencies beyond the Python standard library
// python3 scripts/validate.py
// python3 scripts/validate.py --json

The validator checks tree depth, kebab-case names, fence languages, fence balance, front-matter keys, _index.md coverage, internal links and SHA-256 integrity.

Provenance and limits

  • Built from an offline dump of the official documentation and language reference manual.
  • Source language is English and is preserved verbatim. Signatures and reference examples are copied, never paraphrased.
  • Guide code blocks were rebuilt from a scraped dump; .llm/docs.jsonl marks them code_fidelity: reconstructed. Reference examples are verbatim.
  • Upstream links with no local target stay absolute and are listed in .llm/unresolved.json.
  • See NOTICE.md for attribution.

Navigation: Master index · Reference · Guide · Migration · Link map · Validation

Tooling

Command What it does
python3 scripts/find.py ta.sma Print the signature, parameters, return type and page path
python3 scripts/find.py "moving average" Concept search over the keyword index
python3 scripts/pack.py --list List tasks, namespaces and window presets
python3 scripts/pack.py --namespace array Build one context file for a namespace
python3 scripts/pack.py --task write_a_strategy --out pack.txt Build a task pack for a model
python3 scripts/validate.py Prove every structural claim in this repository

New here? Read QUICKSTART.md. Continuous integration runs the validator and smoke-tests both lookup tools on every push.

Contributing

Defect reports are the most useful contribution here, and the issue template asks for exactly what is needed to reproduce a problem. Most of this tree is generated, so read CONTRIBUTING.md before editing files by hand.

python3 scripts/validate.py     # must pass before any pull request

Maintainer and contact

Use the issue tracker for anything about this repository: defects, missing content, or questions about the machine layer. Issues are public and searchable, so they help the next reader as well. For anything that does not fit an issue, use the contact channels on my GitHub profile.

If you represent TradingView and want a change here, open an issue and I will act on it.

License and attribution

The software in scripts/ and .github/, and the repository structure, identifier scheme, JSON schema, knowledge graph and machine layer under .llm/, are released under the MIT License. See LICENSE.

The documentation prose and Pine Script samples under guide/, reference/, migration/, examples/, errors/ and faq/, and their concatenations under dist/, are derived from the official TradingView Pine Script documentation and remain the property of their respective owners. This repository is an unofficial, derived snapshot. It is not affiliated with or endorsed by TradingView. Pine Script and TradingView are trademarks of their respective owners. See NOTICE.md for full attribution, provenance and limits.

Audit trail

  • VALIDATION.md publishes the current validator results.
  • .llm/link-audit.json records the link and anchor repair history, including the root cause of every defect found before release.

About

This repository provides a deterministic, machine-queryable knowledge base from TradingView Pine Script v6 documentation. It includes 941 entities, 57 digests, a typed graph, and a dependency-free validator for integrity verification, enabling instant signature resolution and reliable retrieval for developers and agents.

Topics

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages