Visual Flow
Every time the AI writes or edits your strategy, HorizonAI quietly turns it into a node graph in the background. Click the Visual tab and you can see exactly what your script does β inputs feeding indicators, indicators feeding conditions, conditions feeding entries and exits β without reading a single line of code.
Why it exists
Most of our users are traders, not programmers. Asking the AI to explain the code line-by-line over and over gets old fast. Visual Flow replaces that: open the tab, look at the picture, and you instantly see the logic β what triggers an entry, what closes a trade, where the stop loss comes from.
Where to find it
In the chat, look at the right-side panel. There are three tabs at the top:
- Code β the raw Pine Script or MQL5
- Visual β the node graph
- Backtest β performance against real market data
Click Visual. That's it.
How it works
You don't have to do anything to generate it. Every time the AI updates your code, HorizonAI rebuilds the visual in the background. By the time you click the tab, it's already there.
If the code is mid-update when you open the tab, you'll see "Generating visualβ¦" for a few seconds while it catches up.
How to read the graph
The graph flows left to right. Inputs and indicators on the left, conditions in the middle, entries / exits / risk management on the right. Animated dashes on each connection show you which direction data is flowing.
Each box is one piece of your strategy. The colour of the box tells you what kind of piece it is:
| Colour | Kind | What it means |
|---|---|---|
| Slate | Input | A setting you (or the AI) can change β e.g. "RSI Length: 14" |
| Blue | Indicator | A technical indicator β EMA, RSI, MACD, Bollinger Bands, etc. |
| Amber | Condition | A true/false check β e.g. "RSI crosses below 30" |
| Purple | Logic | Internal bookkeeping β state, counters, labels |
| Green | Entry | A rule that opens a trade |
| Red | Exit | A rule that closes a trade β including stop loss and take profit |
| Yellow | Risk | Position sizing, lot calculation, max drawdown limits |
| Grey | Plot | Something the strategy draws on the chart |
| Magenta | Alert | An alert the strategy fires |
| Charcoal | Custom | Anything else specific to your script |
Each box has three parts: a small label at the top (e.g. INDICATOR), a title (e.g. RSI (14)), and usually a short plain-English description of what it does.
The lines between boxes show how data moves. Some of them have small labels like "signal", "filter pass", or "entry trigger" to make the flow even more obvious.
What you can do on the canvas
- Pan β click and drag empty space to move around
- Zoom β scroll or pinch to zoom in and out
- Drag nodes β grab any box and reposition it; the layout will remember it
- Fit to view β the controls in the corner snap the whole graph back into frame
The canvas is read-only β you can't break anything by exploring. To change the strategy, just ask the AI in the chat as you normally would. The visual will update on its own.
When it updates
The visual rebuilds itself whenever the underlying code changes β which means every time the AI edits your strategy in a chat turn. You don't need to refresh, switch tabs, or click anything.
If you switch between threads, the graph is saved per-conversation, so each strategy keeps its own visual.
Supported languages
| Language | Visual Flow |
|---|---|
| Pine Script (TradingView) | Supported |
| MQL5 (MetaTrader 5) | Supported |
| Python | Not yet |
| NinjaScript | Not yet |
If the visual isn't available for your script type, the Visual tab will be greyed out with a tooltip explaining why.
Empty states & edge cases
- "Generating visualβ¦" β the AI is reading the code right now. Usually clears in a few seconds.
- "No visual yet β couldn't build a visual from this code." β generation didn't succeed. Editing the script (or asking the AI to make any change) will trigger another attempt.
- "No visual yet β ask the AI to build or edit a strategy." β you're in an empty chat. As soon as the AI writes something, the visual appears.
- Very large scripts (roughly 30,000+ characters) skip the visual to keep things fast. Most strategies are nowhere near this.
A note on accuracy
The visual is an AI-generated picture of your script. It's designed to give you a fast, intuitive read on the logic β not a 1:1 wiring diagram of every variable. If the code and the visual ever look like they disagree, the code is the source of truth.
You'll see this same note at the bottom of the Visual panel: "AI-generated view of your code Β· the code is the source of truth."
Related Guides
- Quickstart β Build your first strategy with HorizonAI
- How to Talk to Horizon AI β Get better results from the AI
- Backtesting in HorizonAI β Test your strategy in the browser
- Run on TradingView β Deploy your Pine Script strategy
- Setting up MetaTrader 5 β Run your MT5 strategy live