Skip to content
Merged
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
6 changes: 2 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ on:
branches:
- main
workflow_dispatch:
schedule:
- cron: '0 0 * * *'

jobs:
# Deterministic checks: no network access to TradingView is needed.
Expand Down Expand Up @@ -54,9 +52,9 @@ jobs:
# The smoke test imports the packed tarball under Node and Bun.
- run: npm run smoke

# Talks to TradingView: nightly or manual only, never blocking.
# Talks to TradingView. Paused: run the live suite locally when needed.
Live:
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
if: false
runs-on: ubuntu-latest
continue-on-error: true
steps:
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ Get realtime market prices, indicator values and backtests from TradingView!

🌐 English · [Français](docs/README.fr.md) · [Español](docs/README.es.md) · [Português](docs/README.pt.md)

## 🟢 Need help with your project?
> [!NOTE]
> **Unofficial, independent project.** Not affiliated with, endorsed or sponsored by TradingView, Inc. TradingView is a trademark of TradingView, Inc. Use it with your own account and in line with [TradingView's Terms of Use](https://www.tradingview.com/policies/).

🚀 **[Click here to get help with your project](https://molted.studio/dreams/ai-agent-for-tradingview-data?utm_source=github&utm_medium=readme&utm_campaign=tradingview-api&utm_content=need-help)**
## 🟢 Need help with your project?

<a href="https://molted.studio/dreams/ai-agent-for-tradingview-data?utm_source=github&utm_medium=readme&utm_campaign=tradingview-api&utm_content=film"><img src="assets/readme-film.webp" alt="Film: a trader gets help from an AI agent that installs TradingView-API, backtests the setup and runs it on a demo account" width="100%"></a>
🚀 **[Click here to get help with your project](https://forms.gle/qPp5RKo8L55C5oJE7)**

## ✨ Features

Expand Down
Binary file removed assets/readme-film-fr.webp
Binary file not shown.
Binary file removed assets/readme-film.webp
Binary file not shown.
7 changes: 4 additions & 3 deletions docs/README.es.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@

🌐 [English](../README.md) · [Français](README.fr.md) · Español · [Português](README.pt.md)

## 🟢 ¿Necesitas ayuda con tu proyecto?
> [!NOTE]
> **Proyecto no oficial e independiente.** No está afiliado, respaldado ni patrocinado por TradingView, Inc. TradingView es una marca de TradingView, Inc. Úsalo con tu propia cuenta y respetando los [Términos de uso de TradingView](https://www.tradingview.com/policies/).

🚀 **[Haz clic aquí para recibir ayuda con tu proyecto](https://molted.studio/dreams/ai-agent-for-tradingview-data?utm_source=github&utm_medium=readme&utm_campaign=tradingview-api&utm_content=need-help)**
## 🟢 ¿Necesitas ayuda con tu proyecto?

<a href="https://molted.studio/dreams/ai-agent-for-tradingview-data?utm_source=github&utm_medium=readme&utm_campaign=tradingview-api&utm_content=film"><img src="../assets/readme-film.webp" alt="Película: un trader recibe ayuda de un agente de IA que instala TradingView-API, prueba su estrategia con datos históricos y la ejecuta en una cuenta demo" width="100%"></a>
🚀 **[Haz clic aquí para recibir ayuda con tu proyecto](https://forms.gle/qPp5RKo8L55C5oJE7)**

## ✨ Funcionalidades

Expand Down
7 changes: 4 additions & 3 deletions docs/README.fr.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ Récupérez les prix en temps réel, les valeurs d’indicateurs et des backtest

🌐 [English](../README.md) · Français · [Español](README.es.md) · [Português](README.pt.md)

## 🟢 Besoin d’aide sur votre projet ?
> [!NOTE]
> **Projet non officiel et indépendant.** Il n’est ni affilié à TradingView, Inc., ni approuvé ou sponsorisé par elle. TradingView est une marque de TradingView, Inc. Utilisez-le avec votre propre compte et dans le respect des [conditions d’utilisation de TradingView](https://www.tradingview.com/policies/).

🚀 **[Cliquez ici pour obtenir de l’aide sur votre projet](https://molted.studio/fr/dreams/ai-agent-for-tradingview-data?utm_source=github&utm_medium=readme&utm_campaign=tradingview-api&utm_content=need-help)**
## 🟢 Besoin d’aide sur votre projet ?

<a href="https://molted.studio/fr/dreams/ai-agent-for-tradingview-data?utm_source=github&utm_medium=readme&utm_campaign=tradingview-api&utm_content=film"><img src="../assets/readme-film-fr.webp" alt="Film : un trader se fait aider par un agent IA qui installe TradingView-API, backteste sa stratégie et la fait tourner sur un compte démo" width="100%"></a>
🚀 **[Cliquez ici pour obtenir de l’aide sur votre projet](https://forms.gle/qPp5RKo8L55C5oJE7)**

## ✨ Fonctionnalités

Expand Down
7 changes: 4 additions & 3 deletions docs/README.pt.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ Obtenha preços em tempo real, valores de indicadores e backtests do TradingView

🌐 [English](../README.md) · [Français](README.fr.md) · [Español](README.es.md) · Português

## 🟢 Precisa de ajuda com seu projeto?
> [!NOTE]
> **Projeto não oficial e independente.** Não é afiliado, endossado nem patrocinado pela TradingView, Inc. TradingView é uma marca da TradingView, Inc. Use-o com sua própria conta e de acordo com os [Termos de Uso da TradingView](https://www.tradingview.com/policies/).

🚀 **[Clique aqui para receber ajuda com seu projeto](https://molted.studio/dreams/ai-agent-for-tradingview-data?utm_source=github&utm_medium=readme&utm_campaign=tradingview-api&utm_content=need-help)**
## 🟢 Precisa de ajuda com seu projeto?

<a href="https://molted.studio/dreams/ai-agent-for-tradingview-data?utm_source=github&utm_medium=readme&utm_campaign=tradingview-api&utm_content=film"><img src="../assets/readme-film.webp" alt="Filme: um trader recebe ajuda de um agente de IA que instala a TradingView-API, faz o backtest da estratégia e a executa em uma conta demo" width="100%"></a>
🚀 **[Clique aqui para receber ajuda com seu projeto](https://forms.gle/qPp5RKo8L55C5oJE7)**

## ✨ Funcionalidades

Expand Down
4 changes: 2 additions & 2 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ npx @mathieuc/tradingview

Run it from your project directory with Node.js 20+. Choose a path:

1. **Autonomous agent (recommended)** — opens the [TradingView-API page on molted.studio](https://molted.studio/dreams/ai-agent-for-tradingview-data?utm_source=github&utm_medium=docs&utm_campaign=tradingview-api). No local project setup.
1. **Get help with your project** — opens a short [assistance form](https://forms.gle/qPp5RKo8L55C5oJE7). No local project setup.
2. **Claude Code CLI** — starts your installed `claude` CLI here with a ready-to-use project prompt.
3. **Codex CLI** — starts your installed `codex` CLI here with the same prompt.
4. **Another local coding agent** — prints the prompt to paste into your agent.
5. **Install the library only** — runs `npm install @mathieuc/tradingview` here, without generating files or starting an agent.

Claude Code and Codex must already be installed and authenticated. Their normal permission prompts remain enabled. If launch fails, the prompt is printed for manual use. If no browser is available, the hosted link remains visible.
Claude Code and Codex must already be installed and authenticated. Their normal permission prompts remain enabled. If launch fails, the prompt is printed for manual use. If no browser is available, the form link remains visible.

Use `--choice 4` to print the prompt directly, or `--help` for usage. Non-interactive callers must pass `--choice`. To try the launcher from a checkout:

Expand Down
2 changes: 1 addition & 1 deletion docs/release-4.0.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Release channel: `latest`. Patch release; no API changes.

## Changes

- The `npx @mathieuc/tradingview` quick-start opens the TradingView agent page on molted.studio directly (the previous `market-watch-alerts` URL redirected there), with `utm_medium=cli` tracking.
- The `npx @mathieuc/tradingview` quick-start opened a hosted help page directly (since replaced by an assistance form).
- README (EN/FR/ES/PT) opens with the product film; the film files are excluded from the npm tarball to keep installs small.
- The Bun proxy test accepts newer Bun wording for HTTP 407 WebSocket errors. Client behavior is unchanged.

Expand Down
2 changes: 1 addition & 1 deletion llms.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ Backtest API (import from '@mathieuc/tradingview/backtest', since 4.1.0): write
- report is plain JSON with identifiers only (exit ids, reasons, IS/OOS, warning codes): createdAt, library, snapshot info, settings (signal id/params, exits id/kind/params), segments with dates and buyHold, signals, rows (metrics: trades, netReturn, winRate, profitFactor or null, maxDrawdown; baseline; percentile), trades with bar indices, refBars and times, causality, warnings. formatReport(report), formatWarning(w), tradesToCsv(trades).
- backtestMany({ markets: [{ symbol, timeframe }], exits?: list or (market) => list, signal }) -> [{ id, report, snapshot }]. chartData(report, snapshot, signal) -> { bars, indicators, warmupEndTime, splitTime, signals, trades by exit } for a price chart page.
- No claim of profitability: a negative or inconclusive result is a valid outcome. Docs: docs/backtest.md. Example: examples/honest-backtest/.
The interactive setup CLI is available with npx @mathieuc/tradingview. It opens Molted Studio, launches a local coding agent with a prompt, prints that prompt, or installs the library. It is not a market-data query CLI. No MCP server or hosted trading API is shipped, and the library places no orders.
The interactive setup CLI is available with npx @mathieuc/tradingview. It opens an assistance form, launches a local coding agent with a prompt, prints that prompt, or installs the library. It is not a market-data query CLI. No MCP server or hosted trading API is shipped, and the library places no orders.
Questions and bugs: https://github.com/Mathieu2301/TradingView-API/issues/new/choose
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
"docs",
"scripts/endurance.mjs",
"scripts/probe-account.mjs",
"assets",
"!assets/readme-film*.webp",
"llms.txt",
"examples",
"scripts/parity.mjs",
Expand Down
2 changes: 1 addition & 1 deletion scripts/smoke.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
return execFileSync(cmd, args, { cwd, stdio: ['ignore', 'pipe', 'pipe'] }).toString();
} catch (error) {
process.stderr.write(`${error.stdout ?? ''}${error.stderr ?? ''}`);
throw new Error(`Command failed: ${cmd} ${args.join(' ')}`);

Check warning on line 16 in scripts/smoke.mjs

View check run for this annotation

codefactor.io / CodeFactor

preserve-caught-error

There is no `cause` attached to the symptom error being thrown.
}
};

Expand All @@ -32,7 +32,7 @@

const launcher = join(dir, 'node_modules', '@mathieuc', 'tradingview', 'bin', 'tradingview.mjs');
const help = run('node', [launcher, '--help'], dir);
if (!help.includes('Autonomous agent (recommended)')) throw new Error('CLI help missing');
if (!help.includes('Get help with your project (form)')) throw new Error('CLI help missing');
const prompt = run('node', [launcher, '--choice', '4'], dir);
if (!prompt.includes('@mathieuc/tradingview')) throw new Error('CLI prompt missing');
const noTty = spawnSync('node', [launcher], { cwd: dir, encoding: 'utf8' });
Expand Down
6 changes: 3 additions & 3 deletions src/quick-start.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { spawnSync, type SpawnSyncOptions, type SpawnSyncReturns } from 'node:child_process';
import { createInterface } from 'node:readline/promises';

export const LANDING_URL = 'https://molted.studio/dreams/ai-agent-for-tradingview-data?utm_source=github&utm_medium=cli&utm_campaign=tradingview-api';
export const LANDING_URL = 'https://forms.gle/qPp5RKo8L55C5oJE7';
export const PACKAGE_SPEC = '@mathieuc/tradingview';
export const AGENT_PROMPT = `Help me build a project using TradingView-API V4 (${PACKAGE_SPEC}).
First ask what I want to build and inspect the current project and its instructions before making changes.
Expand All @@ -16,7 +16,7 @@ export const HELP = `TradingView-API quick-start (Node.js 20+)

Usage: npx @mathieuc/tradingview [--choice 1|2|3|4|5]

1. Autonomous agent (recommended)
1. Get help with your project (form)
2. Claude Code CLI
3. Codex CLI
4. Another local coding agent
Expand All @@ -41,7 +41,7 @@ function printPrompt(log: (text: string) => void): void {
}

function openLanding({ run, log, platform, env }: Required<Runtime>): number {
log(`Continue with an autonomous agent:\n${LANDING_URL}`);
log(`Get help with your project:\n${LANDING_URL}`);
const [command, args]: [string, string[]] = platform === 'darwin' ? ['open', [LANDING_URL]]
: platform === 'win32' ? ['rundll32.exe', ['url.dll,FileProtocolHandler', LANDING_URL]]
: ['xdg-open', [LANDING_URL]];
Expand Down
5 changes: 3 additions & 2 deletions tests/unit/quick-start.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { AGENT_PROMPT, HELP, LANDING_URL, PACKAGE_SPEC, main, runChoice } from '

describe('quick-start', () => {
const ok = { status: 0, signal: null, error: undefined };
it.each(['linux', 'darwin', 'win32'] as const)('opens the hosted path on %s without installing anything', (platform) => {
it.each(['linux', 'darwin', 'win32'] as const)('opens the assistance form on %s without installing anything', (platform) => {
const commands: string[] = [];
const messages: string[] = [];
expect(runChoice('1', { platform, log: (s) => messages.push(s), run: (cmd, args) => {
Expand Down Expand Up @@ -64,7 +64,8 @@ describe('quick-start', () => {
expect(runChoice('6', { log: () => {}, run: () => { throw new Error('must not spawn'); } })).toBe(1);
});
it('documents all choices and supports help and explicit prompt mode', async () => {
expect(HELP).toContain('Autonomous agent (recommended)');
expect(HELP).toContain('Get help with your project (form)');
expect(LANDING_URL).toBe('https://forms.gle/qPp5RKo8L55C5oJE7');
expect(await main(['--help'])).toBe(0);
expect(await main(['--choice', '4'])).toBe(0);
expect(await main(['--choice', '6'])).toBe(1);
Expand Down
Loading