# Export to TradingView

> Turn a validated strategy into a Pine v6 script you can run on TradingView.

Source: https://docs.texttoquant.com/guides/export-to-pine

---

Once a strategy earns its keep, you can take it to TradingView as a Pine script: to chart it, set
alerts, or paper trade it on your own broker feed.

## 1. Export the strategy

<Steps>
  <Step n={1} title="Open the strategy you want to export">
    Any parsed strategy or completed run can be exported. Validate it first: export a strategy you
    actually trust.
  </Step>
  <Step n={2} title="Export to Pine">
    Use the export action to generate a Pine **v6** script that mirrors the strategy's entries, exits,
    stops and sizing.
  </Step>
  <Step n={3} title="Paste into TradingView">
    Open the Pine editor on TradingView, paste the script, and add it to your chart.
  </Step>
</Steps>

<Callout variant="info" title="Ask an agent to export it">
  Connected an AI agent over the [MCP server](/docs/api/mcp)? Just say “export this to Pine” and it calls
  `export_pine` (or `POST /v1/export/pine` over REST), pass a `parsedQuery` or an existing backtest id.
  Anything Pine can't express faithfully is returned in an `unsupported` list, never silently approximated.
</Callout>

## 2. Expect small differences

TradingView and the TextToQuant engine are not the same simulator. Fills, fee models, slippage and
intrabar assumptions differ, so the numbers won't match to the decimal.

<Callout variant="warning" title="TextToQuant is the source of truth for the backtest">
  Use the Pine export for charting, alerts and live signals, not to reverify performance. The
  rigorous, cost aware, look ahead free backtest is the one you ran here. See the
  [execution model](/docs/concepts/execution-model) for exactly what the engine guarantees.
</Callout>

## 3. Custom indicators

If your strategy references a custom indicator, make sure its Pine source is available on the
TradingView side too. The export references it by name.

Related: [entry & exit logic](/docs/reference/entry-exit),
[custom indicators](/docs/reference/entry-exit).
