Skip to content
TickLogits

AI agents & the Ultra API

Connect Claude Code, Codex, Devin or any coding agent to PineTune through the loopback Ultra bridge.

The Developer plan lets a local coding agent operate PineTune: inspect the strategy, edit its Pine source, launch runs, wait for them and apply the best candidate.

Architecture

A Chrome MV3 extension cannot listen on a TCP port. PineTune therefore connects as a WebSocket client to a small, dependency-free Node bridge bound to 127.0.0.1. Your agent calls the bridge over HTTP.

Endpoint Purpose
POST /api Send an action ({ "action": "...", ... })
GET /health Bridge and extension connection status
GET /connect Wake page: nudges the extension to (re)connect
GET /events Live state stream (SSE, or WebSocket upgrade)

Default port: 5678. All responses are { "ok": true, "data": ... } or { "ok": false, "error": "..." }.

Setup

  1. Activate a Developer licence in the popup.
  2. Popup → Agent: enable Agent API and set the port (default 5678).
  3. Open a TradingView chart with your strategy and the Strategy Tester.
  4. Run the one-line installer (needs Node.js 18+). It downloads the kit into ~/pinetune-agent, installs SKILL.md into your coding agent’s skill folder, starts the bridge and opens /connect to wake the extension.
# macOS / Linux
curl -fsSL https://ticklogits.com/pinetune/agent/install.sh | sh

# Windows PowerShell
& ([scriptblock]::Create((iwr 'https://ticklogits.com/pinetune/agent/install.ps1').Content))

--client claude|cursor|windsurf|devin|codex|dsh|pi installs the skill for one agent; the default auto-detects all of them. The Agent tab in the popup shows the same command pre-filled with your port and extension ID (--ext-id), which lets /connect wake the extension automatically on first run.

If /health reports connected: false, open http://127.0.0.1:5678/connect in the browser that has PineTune installed.

curl http://127.0.0.1:5678/health
node "$HOME/pinetune-agent/ultra-client.js" status
node "$HOME/pinetune-agent/ultra-client.js" listTabs

The research loop

  1. Inspect: snapshot --inputs --pine returns strategy, inputs, editable Pine source, metrics and recent results.
  2. Edit code (optional): updatePineSource validates, replaces the full source, saves, updates the chart and verifies the result.
  3. Configure: setConfig with inputs, ranges, mode, objective and filters (partial updates are merged).
  4. Run: call --method start, then waitDone blocks until the run reaches a terminal state.
  5. Analyse: getResults / getHistory.
  6. Apply: applyBest or applyResult, which wait for the tester to settle.

“Best” means best among the combinations tested under your objective and filters, not a global optimum.

Agent Skill

PineTune ships a SKILL.md that teaches skill-aware agents the full loop, the API reference and common pitfalls. The installer places it in your agent’s skill folder; it is also readable at https://ticklogits.com/pinetune/agent/SKILL.md and kept in ~/pinetune-agent. Point your agent at it, then describe the goal in plain language.

Security

  • The bridge only binds to the loopback interface. Never expose it to a LAN or the internet.
  • API responses never include your full licence key or third-party API keys.
  • Don’t put secrets in request files passed with --file.
  • Read-only or protected scripts are never edited around their restrictions.