A trading strategy is, underneath everything, a flow of data. Prices come in. You narrow a universe down to a handful of names. You compute a signal, fit some parameters, validate the fit on data the fit never saw, then push it forward into time it has never touched. Every one of those steps is a transformation, and every transformation makes an assumption. The trouble is that when you write the whole thing as a script, the assumptions disappear into the spaces between the lines. You cannot see them. And the easiest person to fool, as the saying goes, is yourself.
Primitives is QuanterLab's answer to that problem: a node-graph canvas where you build a research pipeline by wiring boxes together and watch the results appear next to the boxes. It is closer to a video editor for research than to a coding environment. You drag in a clip, connect it to the next, scrub the timeline, and see what you made. The design is deliberate, and the reasons for it are worth stating plainly, because the goal is not to make research look impressive. The goal is to make it harder to fool yourself.
A strategy is a data-flow graph. Writing it as a graph — instead of as prose hidden in code — puts the flow and its assumptions where your eye can find them. You are not just running a pipeline; you are looking at one.
Why a canvas, and not a script
Bret Victor (2013), in his talk on media for thinking the unthinkable, made an argument that sits at the heart of this design: most of our thinking tools force ideas through a single narrow channel — a column of text — when the ideas themselves have shape, structure, and motion that the text can't show. A research pipeline has exactly that kind of structure. There is a real topology to it: this universe feeds these filters, which feed a selector, which feeds a signal, which feeds an optimizer, which feeds a walk-forward, which feeds a forward test. In code, that topology is implied by the order of function calls and the names of variables. On a canvas, it is the thing you are looking at.
In Primitives that topology is literal. Each box is a registered primitive — there are roughly ninety of them — and each belongs to a category: universe, filter, combine, select, regime, signal, opt (optimization), valid (validation / walk-forward), forward (the forward test), and autopsy (dissecting what the forward test did). The categories are ordered, and they read left to right the way a research process actually moves: from a wide, shallow pass over many names down to a narrow, deep test of a committed few. There are dedicated lanes for the indicator path, the stochastic (mean-reversion) path, the pairs path, and the factor path — but they all converge on the same two shared lifecycle stages at the end: validate, then test forward. The shape of the catalog is the shape of an honest workflow.
Victor (2011) also wrote about the "ladder of abstraction" — the practice of moving fluidly between a concrete example and the general system that produced it. A canvas lets you do that. You can look at the whole pipeline at once, or click into a single node and see exactly what it did to the data that passed through it. You are never more than one click from the concrete, and never more than a glance from the whole.
The wires have types, and the wrong wire won't connect
The most opinionated part of the design is the smallest visual detail: the colored dots on the edge of each node. Those are ports, and their color is their type. A price series is one color, a screened universe is another, a committed basket of survivors is another, a signal config is another, a forward-test result is another. The connection rule is simply that two ports can be wired together only if they share a color — in the code, that is the whole of isCompatiblePort: the color map is the type system.
This matters because it makes a large class of nonsense pipelines ungrammatical. You cannot wire a raw, unscreened universe straight into a signal generator, because a signal trades a committed set of survivors, not the whole index — the port types don't match, so the wire never lands. There is exactly one deliberate exception, a directional one: a survivors set is allowed to flow into a port that expects a broader stockset, because a committed basket genuinely is a (very narrow) universe. The subtyping goes one way only. On top of the color rule there is a second layer of node-type rules — a scoring node must feed a selector before it can feed anything else; a committed basket can't be sent back to be re-screened — and when a drop is rejected, the canvas says why, in a sentence, rather than letting you discover the problem as a confusing error at run time.
The firewall does not make your strategy good. It makes a whole family of silent mistakes impossible — the kind where the pipeline runs, produces a number, and the number is meaningless because you fed the wrong thing into the wrong stage. A wire that refuses to connect is a far better error than a backtest that quietly answers the wrong question.
You wire, you run, you see
When you run a circuit, the canvas hands the graph to the executor, which sorts the nodes into dependency order and runs them as of an anchor — a "virtual today." Every price fetch in the run is hard-clipped to that anchor: no bar dated after it can reach a filter, an optimizer, or a walk-forward. (That look-ahead firewall is its own subject; see the companion piece on timeline leakage.) The run happens in the background and the results stream back to the nodes — each box gets a summary of what it produced, and terminal nodes render the full result inline: an equity curve, a drawdown profile, a fold-by-fold walk-forward breakdown, an autopsy of where the forward-test returns actually came from.
That tightness — wire it, run it, see it, next to the thing you wired — is the second reason the canvas exists. Bret Victor (2012), in Inventing on Principle, argued that creators need an immediate connection to what they're making: when the gap between changing something and seeing the consequence shrinks to nothing, you start to notice things you would otherwise have missed. In research, the dangerous version of that gap is the one between an idea and the evidence for it. The longer the loop, the more room there is to fall in love with the idea before the evidence has had its say. A visible, runnable pipeline shortens the loop and keeps the evidence in view.
Learning by building, and an instrument worth caring about
There is a quieter reason for the canvas, too. Seymour Papert (1980), in Mindstorms, argued that people understand things most deeply when they build them — that constructing a working model teaches what being told about it cannot. A pipeline you assembled node by node, and watched run, is understood in a way that a pipeline you copied from a script is not. You know what each stage is for because you had to choose it, wire it, and see its output. The canvas is a place to think with your hands.
And there is the matter of the instrument itself. Christopher Alexander (1979) drew a distinction between a thing that merely works and a thing that is, in his word, alive — that has a quality you can feel but struggle to name. Robert Pirsig (1974) circled the same idea under the heading of Quality and care: that the care put into a tool shows, and that it changes how the tool is used. We take this seriously, and we also try not to oversell it. Primitives is a working instrument with rough edges. But the ambition is for it to be the kind of instrument a careful person actually wants to work in — legible, responsive, and honest about what it is doing — because the quality of the instrument shapes the quality of the thinking it hosts.
- A strategy is a data-flow graph; building it as a graph makes the flow and its assumptions visible instead of hidden in code (Victor 2013, 2011).
- Roughly ninety registered primitives fall into ordered categories — universe, filter, select, signal, optimize, validate, forward-test, autopsy — that read left to right like an honest workflow.
- Port colors are types: a wire connects only when the colors match, with one directional exception (survivors can flow where a universe is expected). The wrong wire simply won't land.
- The type-firewall is a humility feature: it makes a class of silent, meaningless pipelines impossible to build.
- Wire, run, see — results render next to the nodes, shortening the loop between an idea and the evidence for it (Victor 2012).
- You learn the pipeline by building it (Papert 1980), in an instrument built with some care (Alexander 1979, Pirsig 1974).
A closing caution
A good instrument does not make good research. It cannot. A beautiful, perfectly typed pipeline can still encode a hopeful assumption, overfit a parameter, or test forward into a future that happens to be kind. The canvas will not save you from any of that — and we would be fooling you, and ourselves, to suggest otherwise. What it does is more modest and, we think, more useful: it puts the structure of your reasoning where you can see it, refuses to connect the obviously wrong things, and shows you the evidence right next to the claim. The rest is on you. That is the point.
Further Reading
Foundational papers
- Victor, B. (2013). Media for Thinking the Unthinkable (talk). worrydream.com.
- Victor, B. (2012). Inventing on Principle (talk, CUSEC 2012). worrydream.com.
- Victor, B. (2011). Up and Down the Ladder of Abstraction. worrydream.com.
Textbook references
- Papert, S. (1980). Mindstorms: Children, Computers, and Powerful Ideas. Basic Books.
- Alexander, C. (1979). The Timeless Way of Building. Oxford University Press.
- Pirsig, R. M. (1974). Zen and the Art of Motorcycle Maintenance: An Inquiry into Values. William Morrow.
Related QuanterLab articles
Try it in QuanterLab
Try it in QuanterLab. Open Primitives and drag a Universe onto the canvas, then a couple of Filters, a Top-N selector, a Signal, an Optimizer, a Walk-Forward, and a Forward Test — wiring left to right. Watch which wires refuse to connect, and read the one-line reason when they do. Then hit Run and look at the results that appear next to each node. The pipeline you can see is the pipeline you can question.