Horizon + TradingView
HorizonAI writes Pine Script, the language of TradingView. There are two ways to work: build in the Horizon platform and export to Pine Script at the end (recommended), or set the script type to Pine Script and talk to it directly. This page gives you the whole picture.
The recommended flow: build in Horizon, export to Pine
This is the main pipeline, and the best experience for almost everyone:
- Build your strategy by chatting in the Horizon platform. It appears on a live chart with candlesticks as you talk.
- Backtest it right in the chat, with results in seconds. Run multi-market backtests and a stress test to prove the edge is real.
- Export the finished strategy as Pine Script with one click.
- Run it on TradingView: paste the exported code into the Pine Editor. See Run on TradingView.
Talking to Pine Script directly
Prefer to stay in Pine the whole way? Set the script type to Pine Script in a chat and the AI writes and edits Pine Script itself. The code you see is exactly what you'll run on TradingView, with no export step, and there's plenty of support behind it:
- Write, read and edit real Pine Script. Describe a strategy and get working code, or paste in a script you already have and iterate on it in plain English.
- Backtest in your own TradingView account. Install the free Chrome extension, keep a TradingView tab open, and click Backtest in the chat. The full report, equity curve and trade list come back into the conversation, where the AI reads them and suggests improvements.
- Convert from other languages. Turn an MQL5 or NinjaScript strategy into Pine with the Converter.
- Fix errors fast. Paste any TradingView compile error into the chat, or check Pine Script Warnings.
Good to know
- There's no chart in Horizon for Pine threads. Pine Script only renders inside TradingView, so the Chart tab stays off; you see your strategy on your own TradingView chart instead. If you want to watch the strategy draw live while you build, that's what the Horizon platform is for.
- Backtesting from the chat needs the free Chrome extension (Pro and Elite plans) and an open TradingView tab; the test runs in your own TradingView account, on TradingView's own data. See Backtest with the Chrome Extension.
- You can always backtest by hand. Click Copy Code, paste into the Pine Editor, and read the Strategy Tester yourself. Works on any plan; the AI just can't see the results that way.
- Multi-market backtests and stress testing live in the Horizon platform; build there and export if you want them.
Getting set up
- Open a chat at app.horizontrading.ai and set the script type to Pine Script.
- On Pro or Elite, install the Chrome extension for one-click backtests.
- Open a chart on tradingview.com in another tab (a free TradingView account is fine).
- Describe your strategy and iterate. When it's ready, see Run on TradingView to put it on your chart for good.
Related Guides
- Backtest with the Chrome Extension: one-click TradingView backtests from the chat
- Run on TradingView: paste your code into the Pine Editor and add it to a chart
- Pine Script Warnings: what the common compiler messages mean
- Using the Strategy Tester: drive TradingView's backtester by hand
- Exporting from Horizon: turn a proven Horizon strategy into Pine Script