Logo vun Pine Script

Pine Script

Organisatioun
jackson-video-resources
pine-script

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

Iwwersiicht

Editeurjackson-video-resources
Repositoryskills
Skill-Nummpine-script
Stären
26
Forks
14
Matgeliwwert Fichieren
Nëmmen Instruktiounen
LizenzMIT
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • Alles an den Instruktiounen

    Alles, wat de Modell brauch, steet an den Instruktiounen — keng zousätzlech Dateien ze synchroniséieren.

  • Open Source

    Vum jackson-video-resources op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Pine Script an TypingMind, fir e mat all LLM ze benotzen, oder füügt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vun GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier hei drënner an a bestätegt.
    https://github.com/jackson-video-resources/skills/tree/main/skills/pine-script
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill afügen → Vu GitHub-URL, pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an de Skill-Verzeechnes vun deem KI-Agent.

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
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Pine Script an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Pine Script automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Pine Script net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Keys.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

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.

Heefeg gestallte Froen

Wat mécht de KI-Skill Pine Script?

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

Firwat Pine Script op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Pine Script besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt amplaz vun engem Abonnement pro Benotzerplaz. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Pine Script an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/jackson-video-resources/skills/tree/main/skills/pine-script an. TypingMind liest d'Datei SKILL.md an installéiert de Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Pine Script benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Pine Script benotzen?

Esou vill Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Pine Script domat benotzen – GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama a méi – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Pine Script gratis?

Jo. De Skill gëtt vum jackson-video-resources ënner der Lizenz MIT op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbaart Pak vun Instruktiounen, dat engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt en nokënnt a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a keng Lafzäitëmfeld a funktionéiere mat all Modell.

All weisen

Elo Ären eegene KI-Workspace ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇