How-to guide

Export to TradingView

Turn a validated strategy into a Pine v6 script.

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#

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.

Export to Pine

Use the export action to generate a Pine v6 script that mirrors the strategy's entries, exits, stops and sizing.

Paste into TradingView

Open the Pine editor on TradingView, paste the script, and add it to your chart.

Ask an agent to export it

Connected an AI agent over the MCP server? 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.

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.

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 for exactly what the engine guarantees.

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, custom indicators.