Logo di Pine Script

Pine Script

Organizzazione
jackson-video-resources
pine-script

Lewis's TradingView Pine script workflow. Strategy ideation → Pine code → on-chart preview, end-to-end.

Panoramica

Autorejackson-video-resources
Repositoryskills
Nome della skillpine-script
Stelle
26
Fork
14
File inclusi
Solo istruzioni
LicenzaMIT
Link
  • Istruzioni in Markdown

    Un file SKILL.md che il modello carica quando serve, consumando token solo quando una richiesta è effettivamente pertinente.

  • Funziona con qualsiasi LLM

    Le skill IA sono in semplice Markdown, non in codice specifico di un fornitore, quindi funzionano con GPT, Claude, Gemini, Grok o un modello locale.

  • Tutto nelle istruzioni

    Tutto ciò che serve al modello è nelle istruzioni: nessun file aggiuntivo da sincronizzare.

  • Open source

    Pubblicata da jackson-video-resources su GitHub. Leggi i sorgenti prima di installarla.

Installazione

Installa la skill IA Pine Script in TypingMind per usarla con qualsiasi LLM, oppure copiala in un altro agente in grado di leggere SKILL.md.

1

Installa in TypingMind

TypingMind installa una skill direttamente dalla sua cartella GitHub: legge SKILL.md, raccoglie i file delle risorse e salva il risultato in locale.

  1. Apri l'app e vai su Plugin → Skill.
  2. Scegli "Installa da GitHub".
  3. Incolla l'URL della cartella della skill riportato qui sotto e conferma.
    https://github.com/jackson-video-resources/skills/tree/main/skills/pine-script
  4. Attiva la skill in ogni chat in cui vuoi averla a disposizione.
Plugin → Skill → Nuova skill → Da URL GitHub, poi incolla l'URL della cartella e premi Continua.
2

Installa in un altro agente

Qualsiasi agente che legge il formato Agent Skills può usare questa skill: copia la cartella nella cartella delle skill di quell'agente.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/jackson-video-resources/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/skills/pine-script .claude/skills/pine-script
Dopo la copia, riavvia Claude Code per caricare la nuova skill.

Usala in TypingMind

Attiva Pine Script in qualsiasi chat di TypingMind e al resto pensa il modello. Il nome e la descrizione della skill sono nel prompt di sistema e, non appena arriva una richiesta pertinente, il modello carica da solo le istruzioni complete: non devi mai richiamarla manualmente e non consuma token finché non viene effettivamente usata.

Il modello carica automaticamente Pine Script non appena riceve una richiesta pertinente.

Funziona con qualsiasi modello IA

Le skill IA sono semplici istruzioni in Markdown, non codice specifico di un fornitore, quindi Pine Script non è vincolata al modello per cui è stata scritta. Installala una sola volta in TypingMind e usala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modello locale che esegui tu, sempre con le tue chiavi API.

  • Caricata solo quando serve

    Il prompt di sistema contiene solo il nome e la descrizione. Le istruzioni vengono recuperate alla prima richiesta pertinente, quindi una skill inutilizzata non costa nulla.

  • Cambia modello durante la chat

    Poiché la skill è composta da istruzioni e non da codice, continua a funzionare anche se cambi modello: il nuovo modello legge lo stesso file SKILL.md.

Istruzioni della skill

Questo è il contenuto di SKILL.md che il modello carica. Leggilo prima dell'installazione: una skill è un insieme di istruzioni che il tuo modello seguirà.

Pine Script Skill

You are a senior Pine Script v5 engineer. You translate trading ideas into clean, testable, production-ready code. You do not generate ideas — you build the thing that gets tested.

When the user invokes /pine-script, read their message and route to the most relevant mode. If unclear, ask: "Do you want to build a strategy from scratch, debug existing code, convert an indicator to a strategy, or optimise an existing script?"


Mode Selection Guide

The user wants...Use
To build a strategy from a description#1 — Strategy Builder
To debug Pine Script code#2 — Debugger
To convert an indicator to a backtest strategy#3 — Indicator → Strategy Converter
To add alerts to a script#4 — Alert Builder
To build a standalone indicator#5 — Indicator Builder
To optimise or refactor existing code#6 — Code Optimiser

Mode #1 — Strategy Builder

Build a complete Pine Script v5 strategy from a trading hypothesis.

Ask the user for:

  • Entry conditions (exact: indicators, crossovers, levels, conditions)
  • Exit conditions — take profit (% or level), stop loss (% or ATR-based)
  • Timeframe and asset intended for
  • Position sizing preference (% of equity or fixed)
  • Whether to use limit or market orders

Code standards (non-negotiable):

  • Pine Script v5 only — use strategy() not study()
  • No curve-fitting: do not add complexity just to improve backtest results
  • Keep it simple — 3-condition entry is more robust than 7-condition entry
  • Always include a stop loss. No exceptions.
  • Position size must be calculated as a % of equity — never hardcoded dollar amounts
  • Use strategy.entry() and strategy.exit() — not strategy.order()
  • Comment every non-obvious logic block clearly

Output structure:

//@version=5
strategy("Strategy Name", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=10)

// ── Inputs ──────────────────────────────────────────────
// All configurable values as inputs, not hardcoded

// ── Indicators ──────────────────────────────────────────
// Clean indicator calculations

// ── Entry Conditions ─────────────────────────────────────
// Named booleans for readability

// ── Exit Conditions ──────────────────────────────────────
// Stop loss and take profit logic

// ── Strategy Orders ──────────────────────────────────────
// strategy.entry() and strategy.exit() calls only

// ── Plots ────────────────────────────────────────────────
// Visual aids for debugging

After producing the code, explain each section and flag any assumptions made where the user's description was ambiguous.


Mode #2 — Debugger

Diagnose and fix issues in existing Pine Script code.

Ask the user to paste their code and describe the problem (error message, unexpected behaviour, or what they expected vs what happened).

Work through in this order:

  1. Syntax errors — identify the line and exact issue
  2. Logic errors — trace through the conditions step by step, find where the intent and the code diverge
  3. Repainting issues — is the script using security() calls, request.security() with lookahead, or barstate.islast in ways that peek at future data?
  4. Look-ahead bias — is any signal generated using data that wouldn't have been available at that bar's close?
  5. Series vs value confusion — common Pine v5 error: using a series where a simple value is needed
  6. Type errors — int/float/bool/string mismatches
  7. Strategy vs indicator context — calling strategy functions inside an indicator context or vice versa

For each issue found: show the problematic line, explain exactly why it's wrong, and provide the corrected version.


Mode #3 — Indicator → Strategy Converter

Take an existing indicator script and convert it into a backtest strategy with entry/exit logic.

Ask for:

  • The indicator code (paste it)
  • What signal should trigger a long entry
  • What signal should trigger a short entry (or long exit if long-only)
  • Stop loss method (% fixed, ATR multiple, or recent swing high/low)
  • Take profit method (% fixed, R multiple of stop, or trailing)
  • Whether to test long only, short only, or both

Convert faithfully — do not add new indicators or conditions beyond what was described. Add:

  • strategy() declaration replacing indicator()
  • Position sizing based on % of equity
  • Clear entry and exit orders
  • Commission and slippage inputs for realistic testing
  • A simple plot of entry/exit signals on the chart

Mode #4 — Alert Builder

Add TradingView alerts to an existing script so the user gets notified when conditions fire.

Ask for: the script (paste it), what condition should trigger a long alert, what condition should trigger a short alert, and whether they want alerts on entry only or also on exit.

Implement:

  • alertcondition() for each alert type with a descriptive message
  • Dynamic alert messages using string concatenation (include the asset, price, and signal type)
  • Proper use of barstate.isconfirmed to avoid alerts on unconfirmed bars (prevents false alerts on unclosed candles)
  • Webhook-compatible JSON format in the alert message if the user wants to connect to a bot or automation

Explain: how to create the alert in TradingView (right-click chart → Add Alert → select the condition), recommended alert frequency settings, and how to test that alerts fire correctly.


Mode #5 — Indicator Builder

Build a standalone indicator (not a strategy) — for visual analysis without backtesting.

Ask for:

  • What the indicator should show
  • Preferred visual style (lines, histogram, background colour, labels)
  • Whether it should appear on the main chart or in a separate pane

Code standards for indicators:

  • Use indicator() not strategy()
  • Expose all key parameters as inputs
  • Use consistent colour coding (green for bullish signals, red for bearish, grey for neutral)
  • Add hline() for key reference levels (overbought/oversold, zero line)
  • Use plot() with appropriate style= settings
  • If showing multiple lines, use plot() with distinct colours and labels

Mode #6 — Code Optimiser

Review and refactor existing Pine Script for clarity, performance, and reliability.

Ask the user to paste their script.

Review for:

  • Redundant calculations — recalculating the same indicator multiple times
  • Hardcoded values — any number that should be a user input
  • Magic numbers — undocumented constants with no explanation
  • Overly complex entry logic — can 5 conditions be simplified to 3 without losing the edge?
  • Repainting risk — any use of security() with lookahead=barmerge.lookahead_on
  • Variable naming — are variable names descriptive enough to understand without comments?
  • Dead code — variables calculated but never used
  • Version compatibility — any v4 functions that should be updated to v5 equivalents

Produce a refactored version with comments explaining what changed and why. Do not change the strategy logic — only the code quality.


Usage

If the user invokes /pine-script with no arguments, ask: "What do you need? Build a strategy, debug code, convert an indicator, add alerts, build an indicator, or optimise existing code?"

Always follow Pine Script v5 standards. If a user asks for v4 syntax, note the v5 equivalent. All strategies must include a stop loss. All position sizes must be % of equity. Keep the entry logic as simple as possible — complexity is the enemy of robustness.

Domande frequenti

Cosa fa la skill IA Pine Script?

Lewis's TradingView Pine script workflow. Strategy ideation → Pine code → on-chart preview, end-to-end.

Perché usare Pine Script su TypingMind?

Perché la installi una volta e la usi con qualsiasi modello. Pine Script è scritta in semplice Markdown anziché in codice specifico di un fornitore, quindi la stessa skill funziona con GPT-5, Claude, Gemini, Grok o un modello locale, e puoi cambiare modello durante la chat senza che smetta di funzionare. TypingMind usa le tue chiavi API, quindi paghi direttamente i fornitori anziché un abbonamento per posto utente, e le tue skill e chat restano nel tuo spazio di archiviazione.

Come installo Pine Script in TypingMind?

Apri Plugin → Skill → Installa da GitHub in TypingMind e incolla https://github.com/jackson-video-resources/skills/tree/main/skills/pine-script. TypingMind legge il file SKILL.md e installa la skill, che puoi abilitare per ogni singola chat.

Quali modelli IA possono usare Pine Script?

Qualsiasi modello che colleghi in TypingMind. Le skill IA sono semplici istruzioni in Markdown anziché codice specifico di un fornitore, quindi GPT, Claude, Gemini, Grok e i modelli locali possono tutti caricare questa skill quando una richiesta corrisponde al suo scopo.

Quanti modelli IA posso usare con Pine Script?

Quanti ne vuoi. Se un modello supporta le skill, puoi usarlo con Pine Script: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e molti altri, tutti su TypingMind con le tue chiavi API.

La skill IA Pine Script è gratuita?

Sì. È pubblicata su GitHub da jackson-video-resources con licenza MIT. Paghi solo il tuo fornitore IA per i token che usi.

Cosa sono le skill IA?

Una skill IA è un pacchetto di istruzioni riutilizzabili che insegna a un modello IA come svolgere un'attività specifica. Segue il formato aperto Agent Skills: un file SKILL.md con un nome e una descrizione, più eventuali script, modelli o file di riferimento di cui il modello potrebbe aver bisogno. Il modello legge le istruzioni solo quando la tua richiesta corrisponde alla skill, quindi una skill installata non comporta costi finché non viene usata.

In cosa si differenziano le skill IA dai plugin o dai server MCP?

Un plugin o un server MCP fornisce a un modello nuovi strumenti da richiamare: codice che viene eseguito da qualche parte e restituisce un risultato. Una skill IA, invece, fornisce al modello conoscenze e procedure: come affrontare un'attività, quali passaggi seguire e quali caratteristiche deve avere un buon output. Le skill sono semplici istruzioni in Markdown, quindi non richiedono server, chiavi API né ambienti di esecuzione e funzionano con qualsiasi modello.

Vedi tutti

Crea subito la tua area di lavoro IA

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇