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 and @functions/drawing.md.
- Building a strategy? Reference @functions/strategy.md.
- Getting errors? Reference @concepts/common_errors.md.
- Download this repository as a ZIP.
- Upload the relevant files to your Claude Project Knowledge (YouTube Help Here) or Custom GPT Knowledge.
- Recommendation: Upload LLM_MANIFEST.md and the specific 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 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.
- If the user asks about Backtesting, look in reference/functions/strategy.md.
- If the user asks about Arrays or Matrices, look in reference/functions/collections.md.
- Syntax Version: Enforce //@version=6 in 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: The master index. Start here.
- concepts/: Explanations of how the Pine engine works (Execution model, Timeframes).
- reference/: The strict API dictionary.
- variables.md: Built-ins (
open,close,syminfo). - constants.md: Fixed values (
color.red). - functions/:
- ta.md: Technical Analysis.
- strategy.md: Backtesting.
- request.md: External data.
- drawing.md: Visuals (
plot,line,box).
- variables.md: Built-ins (
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.md to 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 for the latest order placement syntax.
- If I ask for complex visuals, check reference/functions/drawing.md for
polylineandboxcapabilities.
Disclaimer: This repository is a community-maintained restructuring of the official documentation designed for AI efficiency. It is not affiliated with TradingView.