Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 68 additions & 5 deletions LLM_MANIFEST.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,49 @@
2. Locate the relevant file path below.
3. Retrieve ONLY that file to conserve context window.

## 0. Latest Release Updates

*Use these files first when the user asks about recently added Pine v6 features from the release notes.*

* **`release_notes.md`**
* **Content:** Chronological summary of recent Pine Script v6 additions and behavior changes.
* **Keywords:** `request.footprint`, `volume_row`, `syminfo.isin`, `timeframe_bars_back`, `line wrapping`.

## 0.5. Publishing Guidelines

*Use this file when the user asks about publishing, house rules, visibility types,
formatting tags, paid scripts, or vendor requirements.*

* **`writing_scripts/publishing_guidelines.md`**
* **Content:** House rules compliance checklists; privacy types (public/private);
visibility types (open/protected/invite-only); vendor requirements for paid scripts;
publication type decision tree; full BBCode formatting reference with usage examples
for every supported tag; unsupported tag list; per-section formatting patterns;
and LLM behaviour rules.
* **Keywords:** `publish`, `house rules`, `open-source`, `protected`, `invite-only`,
`private`, `paid script`, `vendor`, `Script Publishing Rules`, `Vendor Requirements`,
`Editors' picks`, `MPL 2.0`, `15 minutes`, `BBCode`, `[b]`, `[i]`, `[list]`,
`[pine]`, `[url]`, `[image]`, `[quote]`, `[s]`, `$SYMBOL`, `formatting`, `markup`,
`performance claims`, `compliance`, `description`, `release notes`.

---
### NEW ROUTING ENTRIES (add to the "## Routing Logic for LLMs" section):

* **IF** user asks about publishing, visibility types, or house rules:
+ retrieve `writing_scripts/publishing_guidelines.md`

* **IF** user asks about BBCode, description formatting, or markup tags:
+ retrieve `writing_scripts/publishing_guidelines.md` (Section 7 — Formatting Reference)

* **IF** user asks whether they can charge for or sell a script:
+ retrieve `writing_scripts/publishing_guidelines.md` (Section 4 — Vendor Requirements)

* **IF** user asks about the difference between protected vs invite-only vs open-source:
+ retrieve `writing_scripts/publishing_guidelines.md` (Section 2 — Visibility Types)

* **IF** user asks how to format release notes or update an existing script:
+ retrieve `writing_scripts/publishing_guidelines.md` (Section 6 — Publication Workflow)

## 1. Syntax and Core Concepts

*Use these files when the user asks about language mechanics, execution flow, or type errors.*
Expand All @@ -32,15 +75,15 @@

* **`reference/variables.md`**
* **Content:** Built-in read-only variables regarding the bar, symbol, or status.
* **Keywords:** `open`, `high`, `low`, `close`, `volume`, `time`, `syminfo.ticker`, `timeframe.multiplier`, `bar_index`.
* **Keywords:** `open`, `high`, `low`, `close`, `volume`, `time`, `syminfo.ticker`, `syminfo.isin`, `timeframe.multiplier`, `bar_index`.

* **`reference/constants.md`**
* **Content:** Fixed constants used as arguments for functions.
* **Keywords:** `color.red`, `shape.triangle`, `plot.style_line`, `size.small`, `alert.freq_once_per_bar`.

* **`reference/types.md`**
* **Content:** Data type definitions and type-casting functions.
* **Keywords:** `int`, `float`, `bool`, `color`, `string`, `line`, `label`, `box`, `simple`, `series`, `input`.
* **Keywords:** `int`, `float`, `bool`, `color`, `string`, `line`, `label`, `box`, `footprint`, `volume_row`, `simple`, `series`, `input`.

* **`reference/keywords.md`**
* **Content:** Language keywords and control structures.
Expand All @@ -60,7 +103,7 @@

* **`reference/functions/request.md` (External Data)**
* **Content:** Requesting data from other symbols, financial data, or seeds.
* **Keywords:** `request.security`, `request.financial`, `request.seed`, `request.currency_rate`.
* **Keywords:** `request.security`, `request.financial`, `request.footprint`, `request.seed`, `request.currency_rate`.

* **`reference/functions/drawing.md` (Visuals)**
* **Content:** Plotting data on the chart and drawing geometric shapes.
Expand All @@ -71,8 +114,12 @@
* **Keywords:** `array.new`, `array.push`, `matrix.new`, `matrix.mult`, `map.new`, `map.put`.

* **`reference/functions/general.md` (Math, Strings, Inputs)**
* **Content:** Core math, string manipulation, and user inputs.
* **Keywords:** `math.abs`, `math.round`, `str.tostring`, `str.format`, `input.int`, `input.bool`, `alert()`.
* **Content:** Core built-ins and general-purpose functions, including `time()` / `time_close()` behavior updates.
* **Keywords:** `time`, `time_close`, `bars_back`, `timeframe_bars_back`, `math.abs`, `math.round`, `str.tostring`, `str.format`, `input.int`, `input.bool`, `alert()`.

* **`writing_scripts/style_guide.md`**
* **Content:** Formatting conventions, including the updated line-wrapping rules for wrapped expressions in parentheses.
* **Keywords:** `style guide`, `line wrapping`, `parentheses`, `indentation`.

## 🧭 Routing Logic for LLMs

Expand All @@ -90,3 +137,19 @@

* **IF** user asks "Why is my variable resetting every bar?":
* retrieve `concepts/execution_model.md` (check `var` usage)

* **IF** user asks about `request.footprint()`, `footprint`, `volume_row`, or footprint imbalance logic:
* retrieve `release_notes.md`
* retrieve `reference/functions/request.md`
* retrieve `reference/types.md`

* **IF** user asks about `syminfo.isin`:
* retrieve `release_notes.md`
* retrieve `reference/variables.md`

* **IF** user asks about `timeframe_bars_back` in `time()` or `time_close()`:
* retrieve `release_notes.md`
* retrieve `reference/functions/general.md`

* **IF** user asks about multiline formatting or indentation rules:
* retrieve `writing_scripts/style_guide.md`
77 changes: 76 additions & 1 deletion Pine Script language reference manual
Original file line number Diff line number Diff line change
Expand Up @@ -1148,6 +1148,17 @@ A sector is a broad section of the economy. An industry is a narrower classifica

---

## syminfo.isin

**Type:** simple string

Holds a string representing the symbol's International Securities Identification Number (ISIN), or an empty string if no ISIN information is available. The ISIN is a 12-character code that identifies a security globally and does not vary across exchanges.

### Remarks
Programmers can use `syminfo.isin` to identify an underlying instrument regardless of exchange-specific ticker naming. For example, `NASDAQ:AAPL` and `GETTEX:APC` share the same ISIN because they refer to the same Apple common stock.

---

## syminfo.main_tickerid

**Type:** simple string
Expand Down Expand Up @@ -8857,6 +8868,34 @@ plot(f)

---

## request.footprint()

Requests the ID of a footprint object that contains volume footprint data for the current chart bar.

### Returns
The ID of a `footprint` object, or `na` if no footprint data is available.

### Remarks
Scripts can use the returned ID with `footprint.*()` functions to retrieve footprint-wide values such as buy volume, sell volume, delta, and special rows such as `poc()`, `vah()`, and `val()`. Scripts can then use the returned `volume_row` IDs with `volume_row.*()` functions to inspect row boundaries and imbalance information.

Only accounts with Premium or Ultimate plans can use scripts that call this function.

A single script cannot include more than one `request.footprint()` call.

### Code Example
```pine
//@version=6
indicator("Footprint summary", overlay = true)

footprint fp = request.footprint(100, 70)

if not na(fp)
volume_row pocRow = fp.poc()
label.new(bar_index, high, str.format("Delta: {0}\nPOC: {1}", fp.delta(), pocRow.up_price()))
```

---

## request.quandl()

Note: This function has been deprecated due to the API change from NASDAQ Data Link. Requests for "QUANDL" symbols are no longer valid and requests for them return a runtime error.
Expand Down Expand Up @@ -12539,14 +12578,19 @@ plot(standardChartValue, color = color.green)

## time()

The time function returns the UNIX time of the current bar for the specified timeframe and session or NaN if the time point is out of session.
The time function returns the UNIX time of the bar open for the specified timeframe, session, and timezone, or na if the time point is out of session.

### Returns
UNIX time.

### Remarks
UNIX time is the number of milliseconds that have elapsed since 00:00:00 UTC, 1 January 1970.

The function also supports a `timeframe_bars_back` parameter. Unlike `bars_back`, which offsets on the script's main timeframe, `timeframe_bars_back` offsets on the requested timeframe itself. If both parameters are present, Pine applies `bars_back` first and then applies `timeframe_bars_back`.

### Signatures
`time(timeframe, session, timezone, bars_back, timeframe_bars_back) → series int`

### Code Example
```pine
//@version=6
Expand All @@ -12568,6 +12612,10 @@ bgcolor(not na(t1) ? color.new(color.blue, 90) : na)
indicator("Time", overlay=true)
t1 = time(timeframe.period, "1000-1100,1400-1500:23456")
bgcolor(not na(t1) ? color.new(color.blue, 90) : na)

//@version=6
indicator("`timeframe_bars_back` demo")
plot(time("1M", bars_back = 10, timeframe_bars_back = 3))
```

---
Expand All @@ -12582,12 +12630,21 @@ UNIX time.
### Remarks
UNIX time is the number of milliseconds that have elapsed since 00:00:00 UTC, 1 January 1970.

The function also supports a `timeframe_bars_back` parameter. Unlike `bars_back`, which offsets on the script's main timeframe, `timeframe_bars_back` offsets on the requested timeframe itself. If both parameters are present, Pine applies `bars_back` first and then applies `timeframe_bars_back`.

### Signatures
`time_close(timeframe, session, timezone, bars_back, timeframe_bars_back) → series int`

### Code Example
```pine
//@version=6
indicator("Time", overlay=true)
t1 = time_close(timeframe.period, "1200-1300", "America/New_York")
bgcolor(not na(t1) ? color.new(color.blue, 90) : na)

//@version=6
indicator("`time_close()` `timeframe_bars_back` demo")
plot(time_close("1M", bars_back = 10, timeframe_bars_back = 3))
```

---
Expand Down Expand Up @@ -13327,6 +13384,24 @@ plot(f)

---

## footprint

Keyword used to explicitly declare the `footprint` type of a variable or parameter. Scripts create objects of this type by calling `request.footprint()`.

### Remarks
Scripts can use `footprint` IDs with `footprint.*()` functions to retrieve volume footprint totals, delta values, and row references such as `poc()`, `vah()`, and `val()`.

---

## volume_row

Keyword used to explicitly declare the `volume_row` type of a variable or parameter. Scripts obtain objects of this type from `footprint` instances.

### Remarks
Scripts can use `volume_row` IDs with `volume_row.*()` functions to retrieve row price boundaries and detect buy or sell imbalances for individual footprint rows.

---

## int

Keyword used to explicitly declare the "int" (integer) type of a variable or a parameter.
Expand Down
56 changes: 36 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,22 @@
**Current Version:** v6
**Source:** [TradingView Pine Script™ v6 Reference Manual](https://www.tradingview.com/pine-script-reference/v6/) & [Welcome to Pine Script® v6](https://www.tradingview.com/pine-script-docs/welcome/)

## Recent Release Coverage
The repository now explicitly surfaces the additions documented in [release_notes.md](https://github.com/jabez4jc/pinescriptv6/blob/main/release_notes.md):

- `request.footprint()` and the `footprint` / `volume_row` types
- `syminfo.isin`
- `time()` / `time_close()` support for `timeframe_bars_back`
- Updated line-wrapping rules for expressions enclosed in parentheses

These updates are reflected in:

- [reference/functions/request.md](https://github.com/jabez4jc/pinescriptv6/blob/main/reference/functions/request.md)
- [reference/functions/general.md](https://github.com/jabez4jc/pinescriptv6/blob/main/reference/functions/general.md)
- [reference/types.md](https://github.com/jabez4jc/pinescriptv6/blob/main/reference/types.md)
- [reference/variables.md](https://github.com/jabez4jc/pinescriptv6/blob/main/reference/variables.md)
- [writing_scripts/style_guide.md](https://github.com/jabez4jc/pinescriptv6/blob/main/writing_scripts/style_guide.md)

## 🤖 What is this?
This repository contains the official Pine Script v6 documentation, restructured and "chunked" specifically for Large Language Models (LLMs).

Expand All @@ -16,43 +32,43 @@ The official documentation is massive. Feeding the entire raw documentation into
If you use AI-native editors like Cursor or Windsurf:
1. Clone this repository locally.
2. 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).
* *Building an indicator?* Reference [@functions/ta.md](https://github.com/jabez4jc/pinescriptv6/blob/main/reference/functions/ta.md) and [@functions/drawing.md](https://github.com/jabez4jc/pinescriptv6/blob/main/reference/functions/drawing.md).
* *Building a strategy?* Reference [@functions/strategy.md](https://github.com/jabez4jc/pinescriptv6/blob/main/reference/functions/strategy.md).
* *Getting errors?* Reference @concepts/common_errors.md.

### Option 2: Claude Projects / Custom GPTs
1. Download this repository as a ZIP.
2. Upload the relevant files to your **[Claude Project Knowledge](https://support.claude.com/en/articles/9517075-what-are-projects)** ([YouTube Help Here](https://www.youtube.com/watch?v=GJ5jTgcbRHA)) or **[Custom GPT Knowledge](https://help.openai.com/en/articles/8843948-knowledge-in-gpts)**.
3. *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.
3. *Recommendation:* Upload [LLM_MANIFEST.md](https://github.com/jabez4jc/pinescriptv6/blob/main/LLM_MANIFEST.md) and the specific [reference/](https://github.com/jabez4jc/pinescriptv6/tree/main/reference) folders you use most often.

---

## 🧠 For LLMs: Usage Instructions

**If you are an LLM or AI Assistant reading this file, follow these instructions:**

1. **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.
1. **Entry Point:** Always check [LLM_MANIFEST.md](https://github.com/jabez4jc/pinescriptv6/blob/main/LLM_MANIFEST.md) first. It acts as the map for this repository.
2. **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 [reference/functions/ta.md](https://github.com/jabez4jc/pinescriptv6/blob/main/reference/functions/ta.md).
* If the user asks about **Backtesting**, look in [reference/functions/strategy.md](https://github.com/jabez4jc/pinescriptv6/blob/main/reference/functions/strategy.md).
* If the user asks about **Arrays or Matrices**, look in [reference/functions/collections.md](https://github.com/jabez4jc/pinescriptv6/blob/main/reference/functions/collections.md).
3. **Syntax Version:** Enforce //@version=6 in all code generation.
4. **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.

---

## 📂 Repository Structure

* **[LLM_MANIFEST.md](https://github.com/codenamedevan/pinescriptv6/blob/main/LLM_MANIFEST.md)**: The master index. Start here.
* **[concepts/](https://github.com/codenamedevan/pinescriptv6/tree/main/concepts)**: Explanations of how the Pine engine works (Execution model, Timeframes).
* **[reference/](https://github.com/codenamedevan/pinescriptv6/tree/main/reference)**: The strict API dictionary.
* [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`).
* **[LLM_MANIFEST.md](https://github.com/jabez4jc/pinescriptv6/blob/main/LLM_MANIFEST.md)**: The master index. Start here.
* **[concepts/](https://github.com/jabez4jc/pinescriptv6/tree/main/concepts)**: Explanations of how the Pine engine works (Execution model, Timeframes).
* **[reference/](https://github.com/jabez4jc/pinescriptv6/tree/main/reference)**: The strict API dictionary.
* [variables.md](https://github.com/jabez4jc/pinescriptv6/blob/main/reference/variables.md): Built-ins (`open`, `close`, `syminfo`).
* [constants.md](https://github.com/jabez4jc/pinescriptv6/blob/main/reference/constants.md): Fixed values (`color.red`).
* [functions/](https://github.com/jabez4jc/pinescriptv6/tree/main/reference/functions):
* [ta.md](https://github.com/jabez4jc/pinescriptv6/blob/main/reference/functions/ta.md): Technical Analysis.
* [strategy.md](https://github.com/jabez4jc/pinescriptv6/blob/main/reference/functions/strategy.md): Backtesting.
* [request.md](https://github.com/jabez4jc/pinescriptv6/blob/main/reference/functions/request.md): External data.
* [drawing.md](https://github.com/jabez4jc/pinescriptv6/blob/main/reference/functions/drawing.md): Visuals (`plot`, `line`, `box`).

---

Expand All @@ -62,11 +78,11 @@ 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.
>
> 1. When I ask for code, ALWAYS consult the [LLM_MANIFEST.md](https://github.com/codenamedevan/pinescriptv6/blob/main/LLM_MANIFEST.md) to locate the correct reference file.
> 1. When I ask for code, ALWAYS consult the [LLM_MANIFEST.md](https://github.com/jabez4jc/pinescriptv6/blob/main/LLM_MANIFEST.md) to locate the correct reference file.
> 2. Prefer `ta.*` namespace functions over manual calculations.
> 3. Ensure all scripts start with `//@version=6`.
> 4. 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.
> 5. If I ask for complex visuals, check [reference/functions/drawing.md](https://github.com/codenamedevan/pinescriptv6/blob/main/reference/functions/drawing.md) for `polyline` and `box` capabilities.
> 4. If I ask for a Strategy, strictly check [reference/functions/strategy.md](https://github.com/jabez4jc/pinescriptv6/blob/main/reference/functions/strategy.md) for the latest order placement syntax.
> 5. If I ask for complex visuals, check [reference/functions/drawing.md](https://github.com/jabez4jc/pinescriptv6/blob/main/reference/functions/drawing.md) for `polyline` and `box` capabilities.

---

Expand Down
Loading