Current Version: v6
Source: TradingView Pine Script™ v6 Reference Manual & Welcome to Pine Script® v6
This repository contains the official Pine Script v6 documentation, restructured and "chunked" specifically for Large Language Models (LLMs).
The official documentation is massive. Feeding the entire raw documentation into an LLM often confuses it or exceeds context limits, leading to hallucinations or generic v5 code. This repository breaks the documentation into logical, namespaced markdown files to improve Retrieval Augmented Generation (RAG) and Context Window efficiency.
If you use AI-native editors like Cursor or Windsurf:
- Clone this repository locally.
- In your chat interface, reference specific documentation based on what you are building.
- Building an indicator? Reference
[@functions/ta.md](https://github.com/codenamedevan/pinescriptv6/blob/main/reference/functions/ta.md)and[@functions/drawing.md](https://github.com/codenamedevan/pinescriptv6/blob/main/reference/functions/drawing.md). - Building a strategy? Reference
[@functions/strategy.md](https://github.com/codenamedevan/pinescriptv6/blob/main/reference/functions/strategy.md). - Getting errors? Reference
@concepts/common_errors.md. - Visual styling? Reference
@visuals/overview.mdplus the relevant sub-page (e.g.,visuals/plots.md,visuals/colors.md). - Writing guidance? Reference
@writing_scripts/style_guide.md.
- Building an indicator? Reference
- Download this repository as a ZIP.
- Upload the relevant files to your Claude Project Knowledge or Custom GPT Knowledge.
- Recommendation: Upload
[LLM_MANIFEST.md](https://github.com/codenamedevan/pinescriptv6/blob/main/LLM_MANIFEST.md)and the specific[reference/](https://github.com/codenamedevan/pinescriptv6/tree/main/reference)folders you use most often.
If you are an LLM or AI Assistant reading this file, follow these instructions:
- Entry Point: Always check
[LLM_MANIFEST.md](https://github.com/codenamedevan/pinescriptv6/blob/main/LLM_MANIFEST.md)first. It acts as the map for this repository. - Modular Retrieval: Do not attempt to ingest the entire codebase at once.
- If the user asks about Functions (e.g., RSI, EMA), look in
[reference/functions/ta.md](https://github.com/codenamedevan/pinescriptv6/blob/main/reference/functions/ta.md). - If the user asks about Backtesting, look in
[reference/functions/strategy.md](https://github.com/codenamedevan/pinescriptv6/blob/main/reference/functions/strategy.md). - If the user asks about Arrays or Matrices, look in
[reference/functions/collections.md](https://github.com/codenamedevan/pinescriptv6/blob/main/reference/functions/collections.md).
- If the user asks about Functions (e.g., RSI, EMA), look in
- Syntax Version: Enforce
//@version=6in all code generation. - No Hallucinations: If a function is not found in these files, it likely does not exist in v6 or has been renamed. Do not invent syntax.
[LLM_MANIFEST.md](https://github.com/codenamedevan/pinescriptv6/blob/main/LLM_MANIFEST.md): The master index. Start here.pinescriptv6_complete_reference.md: Canonical raw reference source file (parsed by the rebuild script). If absent, the rebuild script falls back topinescriptv6reference.md.rebuild_reference_docs.py: Splits the source reference into the chunked files below.[reference/](https://github.com/codenamedevan/pinescriptv6/tree/main/reference): The strict API dictionary generated from the source file.[variables.md](https://github.com/codenamedevan/pinescriptv6/blob/main/reference/variables.md): Built-ins (open,close,syminfo).[constants.md](https://github.com/codenamedevan/pinescriptv6/blob/main/reference/constants.md): Fixed values (color.red).[functions/](https://github.com/codenamedevan/pinescriptv6/tree/main/reference/functions):[ta.md](https://github.com/codenamedevan/pinescriptv6/blob/main/reference/functions/ta.md): Technical Analysis.[strategy.md](https://github.com/codenamedevan/pinescriptv6/blob/main/reference/functions/strategy.md): Backtesting.[request.md](https://github.com/codenamedevan/pinescriptv6/blob/main/reference/functions/request.md): External data.[drawing.md](https://github.com/codenamedevan/pinescriptv6/blob/main/reference/functions/drawing.md): Visuals (plot,line,box).
[concepts/](https://github.com/codenamedevan/pinescriptv6/tree/main/concepts): Core mechanics (execution model, timeframes, colors, objects/methods, common errors).[visuals/](https://github.com/codenamedevan/pinescriptv6/tree/main/visuals): Display primitives (plots, colors, fills, lines/boxes, tables, text/shapes).[writing_scripts/](https://github.com/codenamedevan/pinescriptv6/tree/main/writing_scripts): Style guide, debugging, profiling/optimization, publishing, limitations.release_notes.md: Release notes snapshots.
If you are building a Custom GPT or setting up a Project, use this prompt:
You are an expert Pine Script v6 Developer. You have access to a reference library structured into specific folders.
- When I ask for code, ALWAYS consult the
LLM_MANIFEST.mdto locate the correct reference file.- Prefer
ta.*namespace functions over manual calculations.- Ensure all scripts start with
//@version=6.- If I ask for a Strategy, strictly check
[reference/functions/strategy.md](https://github.com/codenamedevan/pinescriptv6/blob/main/reference/functions/strategy.md)for the latest order placement syntax.- If I ask for complex visuals, check
[reference/functions/drawing.md](https://github.com/codenamedevan/pinescriptv6/blob/main/reference/functions/drawing.md)forpolylineandboxcapabilities.
Disclaimer: This repository is a community-maintained restructuring of the official documentation designed for AI efficiency. It is not affiliated with TradingView.