Indicator

A local Indicator for agents and terminal users to fetch TradingView-style market data, write Pine Script v6, push scripts into TradingView's Pine Editor, and capture chart screenshots.

Conda + Make trading-view CLI Playwright browser profile MCP servers Pine v6 agent skill

Open this file locally

From the project root:

open docs/integration.html

Start with the health checks:

make doctor
make session-check

How the pieces connect

1User / AgentAsks for TSLA check, indicator creation, or chart screenshot.
2Make + CLImake rating, make push, or direct trading-view ... command.
3Data layertvdatafeed for OHLCV and tradingview-screener for ratings/screeners.
4Pine skillAgents use skills/pinescript-v6 to author valid Pine v6 files.
5Browser layerPlaywright logs in, switches symbol, pastes Pine, applies script, screenshots.

1. Install

Creates/updates the indicator conda env and installs package deps.

make install
cp .env.example .env
make doctor

2. Login

Preferred: let Playwright save your TradingView browser session.

make login
make session-check

Fallback: paste TV_SESSIONID into .env.

3. Use it

Run through Make without activating conda.

make rating SYMBOL=NASDAQ:TSLA
make screenshot SYMBOL=NASDAQ:TSLA

Common terminal workflows

GoalCommand
Find a tickermake search Q=tesla
Get OHLCVmake ohlcv SYMBOL=NASDAQ:TSLA INTERVAL=1D BARS=30
Get TV ratingmake rating SYMBOL=NASDAQ:TSLA
Take screenshotmake screenshot SYMBOL=NASDAQ:TSLA
Create indicator templatemake pine-new KIND=indicator NAME=my_indicator
Validate Pine locallymake pine-validate SCRIPT=scripts/indicators/my_indicator.pine
Push Pine to chartmake push SCRIPT=scripts/indicators/my_indicator.pine APPLY=NASDAQ:TSLA SHOT=1

Direct trading-view CLI

Activate the conda env if you prefer calling the CLI directly.

source conda-env-active.sh indicator

trading-view data search "tesla"
trading-view data rating NASDAQ:TSLA
trading-view data ohlcv NASDAQ:TSLA --interval 1D --bars 50
trading-view browser screenshot --symbol NASDAQ:TSLA
trading-view browser push scripts/indicators/my_indicator.pine --apply NASDAQ:TSLA --screenshot

Agent integration

The canonical Pine skill lives at skills/pinescript-v6/SKILL.md. Project-local discovery files point to it for Claude Code, pi, Cursor, Gemini, and Codex-style agents.

Agent/toolProject pathPurpose
pi.pi/agent/skills/pinescript-v6Project-local skill symlink.
Claude Code.claude/skills/pinescript-v6Project-local skill symlink.
Cursor.cursor/rules/pinescript-v6.mdcThin rule pointing to the canonical skill.
Codex/OpenCode/AiderAGENTS.mdProject agent instructions.
Gemini CLIGEMINI.mdProject agent instructions.
make install-skills
make check-skills
make update-skills

MCP integration

Expose data and browser functions to MCP-capable agents.

make mcp-config-claude
make mcp-config-pi
make mcp

MCP server:

  • indicator-mcp: OHLCV, search, screener, ratings, session check, push script, screenshot, and agent docs

Generated artifacts

Screenshots are runtime output and are intentionally gitignored: screenshots/* is ignored while screenshots/.gitkeep is tracked.

Files you usually commit:

  • scripts/indicators/*.pine and scripts/strategies/*.pine
  • skills/pinescript-v6/**
  • src/indicator/**
  • Makefile, README.md, docs/integration.html

Example: check TSLA end-to-end

make search Q=tesla
make rating SYMBOL=NASDAQ:TSLA
make ohlcv SYMBOL=NASDAQ:TSLA INTERVAL=1D BARS=30
make screenshot SYMBOL=NASDAQ:TSLA
make push SCRIPT=scripts/indicators/tsla_levels.pine APPLY=NASDAQ:TSLA SHOT=1

This produces market context, a chart screenshot, and — if the Pine file exists — applies the indicator to the TSLA chart. Screenshot PNGs stay local and are not committed.