ProRealCode Studio is on its way. As soon as it is published, this button will take you straight to its Chrome Web Store page.
A code you did not write, or wrote a year ago, is hard to read line by line. The flow map draws it instead: one card per value, setting or calculation, and an arrow from each value to what is computed from it, up to what reaches the chart.
1
2
3
4
Every arrow goes from a value to what is computed from it. Follow them from the left, where the code reads prices and settings, towards the black cards, which are what you see on the chart. When a comment sits just above a line of your code, the card shows that comment as its explanation.
| Card | What it stands for |
|---|---|
| Live price | A price the code reads: the close, the high… Its panel says “A raw market read.” |
| Setting | A value you can change in ⚙ Settings (chapter 08). |
| Switch | A setting that turns a part of the code on or off: “A setting that changes which branch runs below.” |
| Step | A calculation: an average, an RSI, a colour, a table cell. |
| Value | A variable of the code. Its panel says what it is computed from, and on which line. |
| State machine | Several variables that feed each other from one bar to the next. |
| On chart | A curve, a fill or a drawing that reaches the chart. |
A setting — a constant for the whole run, editable from Inputs.
| The line | What it says |
|---|---|
| feeds into, solid | The value is used, on the same bar, to compute the next card. |
| from an earlier bar, dashed | The next card uses the value of a previous bar. |
| set by a setting, dotted | A setting gives the next card its number, a period for instance. |
| only on a condition, amber dots | The value only passes when an IF or FOR test lets it. Hidden until you press “Show conditions”. |
| drawn on chart, thick | The last link, into a card that reaches the chart. |
| ↺ remembers its last bar | On a card: the value starts from its own previous value. |
| Button | What it does |
|---|---|
| Flows left to right | Lays the cards out in columns. The default. |
| Flows top to bottom | Lays them out in rows. |
| Show conditions | Adds the connections that only carry a value when an IF or FOR test passes. Hidden by default: there can be three times as many as the others. |
| Show timings | Measures the code and puts on each card its share of the time (chapter 11). |
| Animate | The dots that run along a traced card's arrows. On by default; the map reads the same without them. |
| Show fewer cards | Folds repeated drawing calls into one card and skips small helpers such as round or abs. No connection is lost. On by itself above 40 cards. |
| Full code | Opens the whole code in a panel on the right. |
| Scroll · drag | Move |
| Ctrl + scroll | Zoom |
| + − | Zoom in, out |
| Arrow keys | Move; with Shift, farther |
| F | Fit the whole map |
| 0 | Reset the view |
⋯ › “Dataflow map” opens the map of the code in front. Cards are what the code reads, computes and draws; arrows go from each value to what uses it. One click on a card lights its whole chain and opens its panel, with the code behind it one more click away. When you need the line itself, “Open in the editor” takes you there.
The map is drawn from a code that runs. Correct the errors listed in Problems (chapter 09), then open it again.
The map reads ProRealCode Script only. A code that starts with //@version= has no map.
Folded by “Show fewer cards”, which switches on by itself above 40 cards. Switch it off to see every card.
Type its line number in the search. A comment, a blank line or a closing word such as ENDIF has no card of its own.
No. The map is a view. “Open in the editor” brings you to the line to change.
Switch “Animate” off. Nothing else changes.
Chapter 11 · Code performance