For AI Assistants & Power-Prompt Users
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/.
| Artifact | URL | Size | Use it for |
|---|---|---|---|
| Curated index | /llms.txt | ~6 KB | AI crawlers, quick map of the docs |
| Full specification | /llms-full.txt | ~25 KB | Paste into any LLM context as ground truth |
| JSON Schema | /schemas/trade-command.schema.json | ~30 KB | OpenAI 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:
- Canonical TradeCommand reference:
/llms-full.txt— 84 fields with type, default, allowed values, gotchas. - Machine-readable schema:
/schemas/trade-command.schema.json. - Field-by-field reference (HTML version): Parameter Reference — All 84 Properties.
- Edge cases and common errors: Common LLM Hallucinations.
- Webhook receiver behaviour: Trade Command Anatomy.
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:
- Invented field names —
amount_pct,side,type,takeProfits[]. - Wrong format conventions —
BTC/USDTinstead ofBTCUSDT,"10x"instead of10. - Token in the URL or HTTP header — TVH puts it in the body.
- Auto-magic defaults missed —
postOnlydefaults totrue, silent fail for marketable limits. - Wrong webhook URL —
api.tv-hub.organdtradingview-hub.com/api/tradeare both wrong.
Every entry in Common LLM Hallucinations maps to a real ticket.
Workflow for users
- Read How to Prompt an LLM — the Golden Prompt Template and five concrete examples.
- Copy a Strategy Template as a starting point — eight schema-correct Pine + JSON pairs.
- Customize with your favourite LLM — paste the template, describe your changes.
- Validate against Common Hallucinations before live deployment.
- Test on demo first — see Quickstart for the 5-minute demo wire-up.
How this section is maintained
llms-full.txtis 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.txtis 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
- How to Prompt an LLM — Golden template plus five real-world examples.
- Canonical Schema (Plain Text) — The full spec in token-efficient plain text.
- Common LLM Hallucinations — Fifteen typical errors and their fixes.
- Strategy Templates — Eight Pine + JSON starter kits.