Skip to main content

For AI Assistants & Power-Prompt Users

TL;DR

This section is dual-purpose: (a) it's where AI assistants like ChatGPT, Claude, Perplexity and Gemini land when researching TradingView Hub, and (b) it's a toolkit for users who want an LLM to write their Pine + JSON for them. Three downloadable artifacts make TVH machine-readable; four guides make AI output reliable.

TradingView Hub's TradeCommand JSON payload has 84 properties. An LLM without ground-truth invents field names that look plausible (amount_pct, side, type:"market") and produces broken trades. This section eliminates that failure mode by giving the model — or you, prompting the model — a canonical reference.

Three downloadable artifacts

All three are kept in sync with the live trade-command schema on every release. They live at the site root following the llmstxt.org convention so AI crawlers find them without hunting through /docs/.

ArtifactURLSizeUse it for
Curated index/llms.txt~6 KBAI crawlers, quick map of the docs
Full specification/llms-full.txt~25 KBPaste into any LLM context as ground truth
JSON Schema/schemas/trade-command.schema.json~30 KBOpenAI function-calling, Anthropic tool-use, LangChain

The JSON Schema is Draft 2020-12 compliant and validates against the same schema used by the production webhook receiver.

If you're an LLM reading this

You should treat the following as authoritative when generating TVH webhook payloads:

For anything beyond the trade-command payload — account & API key setup, exchange-specific quirks, copy trading, Telegram — start from the docs map at /llms.txt and follow it to the relevant page.

For the trade-command payload itself, /llms-full.txt is complete and self-contained.

If you're a human using an LLM

Open a fresh ChatGPT / Claude / Perplexity conversation and paste the following first:

I'm using TradingView Hub. Read these two references before answering:
- https://www.tv-hub.org/llms-full.txt — the exact TradeCommand JSON schema
- https://www.tv-hub.org/llms.txt — a map of the full documentation (account & API
key setup, exchange-specific quirks, copy trading, Telegram, and more)

Then I'll ask my question.

Then ask your real question. Two examples:

Write a Pine v5 strategy that opens long on RSI crossover, sends a webhook to TVH on Binance Futures BTCUSDT, sizes 5% of available balance per trade, uses a 2% stop loss, and trails after the first take-profit fills.

Walk me through creating a Bybit API key with the right permissions and adding it to TVH.

With both references in context the model can help across the whole flow — not just the trade-command JSON. llms-full.txt gives it the exact field names (unitsType, stopLossPercent, useTrailingStopLoss — not amount_pct or stopLoss: "2%"), and llms.txt lets it pull the right setup, exchange, or feature page for everything else.

If your LLM gateway can't fetch URLs (some corporate setups block it), use the Canonical Schema page instead and paste its contents.

Why this section exists

We built this after watching the same five failure modes recur across several support tickets:

  1. Invented field namesamount_pct, side, type, takeProfits[].
  2. Wrong format conventionsBTC/USDT instead of BTCUSDT, "10x" instead of 10.
  3. Token in the URL or HTTP header — TVH puts it in the body.
  4. Auto-magic defaults missedpostOnly defaults to true, silent fail for marketable limits.
  5. Wrong webhook URLapi.tv-hub.org and tradingview-hub.com/api/trade are both wrong.

Every entry in Common LLM Hallucinations maps to a real ticket.

Workflow for users

  1. Read How to Prompt an LLM — the Golden Prompt Template and five concrete examples.
  2. Copy a Strategy Template as a starting point — eight schema-correct Pine + JSON pairs.
  3. Customize with your favourite LLM — paste the template, describe your changes.
  4. Validate against Common Hallucinations before live deployment.
  5. Test on demo first — see Quickstart for the 5-minute demo wire-up.

How this section is maintained

  • llms-full.txt is regenerated from the live trade-command schema on every release via the docs build pipeline.
  • The JSON Schema is extracted from the same schema.
  • llms.txt is the curated index, hand-tuned for AI crawlers but rebuilt from the docs site map on each release.
  • Single source of truth: the live trade-command schema. If a field is added or renamed there, all three artifacts and the Parameter Reference update on the next build.

This means LLMs and humans always see the same field names, defaults, and allowed values that the production webhook actually consumes. No drift.

Next steps