Overview
Run on TradingView
Add your AI‑generated Pine Script to a TradingView chart in minutes
Follow these steps to take code from HorizonAI and run it directly in TradingView’s Pine Editor.
1) Copy your code from HorizonAI
- In the app, finish your edits and click the Copy button at the top‑right.
- Your Pine Script is now on your clipboard.
2) Open a TradingView chart
- Go to the TradingView website and open any chart you want to test on.
3) Open the Pine Editor
- At the bottom of the TradingView page, click Pine Editor to open the editor panel.
4) Replace the editor contents
- Select all existing code in the Pine Editor and delete it.
- Paste the code you copied from HorizonAI into the editor.
5) Add to chart
- Click Add to chart.
- TradingView compiles the script and adds it to your chart.
That's it. If you want changes, return to HorizonAI, tweak your prompt, copy again, and repeat the steps above.
Next Steps
Once your strategy is running on TradingView:
- Backtest on TradingView — Test your strategy on historical data to see how it performs
- How to Backtest a Trading Strategy — Learn best practices for validating strategies
- Backtesting Metrics Explained — Understand profit factor, Sharpe ratio, and drawdown
Troubleshooting
Getting compile errors?
- Check out Common Pine Script Warnings for solutions
- Return to HorizonAI and ask: "fix the compile error" or describe what's not working
Want to improve your prompts?
- Read How to Prompt for tips on getting better results from HorizonAI
Learn Pine Script
Want to understand the code you're running?
- Pine Script Tutorial for Beginners — Learn Pine Script basics in 10 minutes
- Best Pine Script Strategies — Study proven Pine Script systems
- Pine Script vs MQL5 — Compare TradingView to MetaTrader 5
Related Guides
- Getting Started with HorizonAI — Create your first strategy
- Convert Pine Script to MT5 — Port your strategy to MetaTrader 5
- Planning Mode — Build complex strategies step-by-step