Projects Flagship

Quant Research Studio

A visual studio for building and testing trading strategies where reproducibility comes first: every strategy compiles to deterministic, readable Python, and every result can be traced back to the code that produced it.

Status
Working prototype
Built with
  • Python
  • React
  • FastAPI
  • NautilusTrader
Source
Private repository
Quant Research Studio in its dark theme. An operator palette on the left; a strategy graph in the centre connecting a dataset to fast and slow EMAs, crossover signals, a long/flat position and a backtest; a run summary on the right with metrics and an equity chart.
An EMA crossover strategy with a completed run on synthetic data. The figures describe a synthetic test, not investment performance. Capture of an earlier demo build; the current research interface differs.

The problem

Backtests are easy to make persuasive and hard to trust. A signal can quietly use data that would not have been available at the time, a script can change between runs, and a good-looking result can be impossible to reproduce a week later.

Quant Research Studio treats those as engineering problems: make the strategy an explicit artefact, make its execution deterministic, and test the operators for the leaks that research mistakes are made of.

What it does

Strategies are graphs of registered, versioned operators — sources, indicators, rules, positions and backtests — connected in a React editor. A validated graph compiles to a Python module, which a worker runs against versioned datasets using NautilusTrader for the simulation. Results are stored with their provenance, and the same compiled code can be exported as a standalone Python bundle.

Strategy graph: dataset bars feed a fast EMA (warm-up 19) and a slow EMA (warm-up 49). Two Cross operators turn them into cross-up and cross-down signals, which drive a Long / flat position. The positions and the bars feed a Backtest.
Detail: every node is a registered, versioned operator, and each shows the warm-up it needs before producing values.

Reproducibility by construction

The compiler’s output depends only on the graph’s nodes, edges and normalised parameters, emitted in a deterministic dependency order. Canvas layout and display names never reach the code. The same strategy therefore always compiles to byte-identical Python, and the code’s SHA-256 hash identifies exactly what was executed.

lines += ["", "def run(ctx: Run) -> None:"]
for node_id in topological_order(doc):
    node = nodes[node_id]
    params = ops[node_id].params.model_validate(node.params).model_dump(mode="json")
    inputs = ", ".join(f"{port!r}: {src.node}[{src.port!r}]" for port, src in sorted(wiring[node_id].items()))
    lines.append(f"    {node_id} = ctx.op({node_id!r}, {node.operator!r}, {node.version}, {{{inputs}}}, {params!r})")
return "\n".join(lines) + "\n"
Excerpt from the strategy compiler: one line of generated Python per node, in topological order, with parameters validated against the operator’s schema.

The studio, the command line and export all pass through one compile-and-check gate, so they accept and refuse the same strategies. Generated code is readable on purpose: the studio shows it alongside each strategy, and exported code can be reviewed without the studio.

Research discipline

Lookahead bias is tested directly. Operator contract tests rewrite later data and check that earlier outputs do not change, and deliberately leaky operators confirm that those tests catch a leak when one exists.

Each run records the compiled-code and result identifiers and labels the weakest class of evidence among the datasets it read, so a result built on synthetic data says so. An analysis-method registry organises descriptive, inference, selection and robustness methods for evaluating results.

Run panel: valid, compiled code d8fad9fae5a1. A run at revision 1 succeeded with code d8fad9fae5a1 and result 24357159ece3. Evidence: synthetic, the weakest class among the datasets this run read. Metrics include net P&L −1,620.00, return −1.62% and maximum drawdown 1.76%.
Detail: each run records its compiled-code and result identifiers and the weakest evidence class among the data it read. The synthetic run lost money; it is shown as captured.

Architecture

  1. Editor
    • React graph editor
  2. Local service
    • Local API and queue
    • Validated graph compiler
  3. Execution
    • Python worker
    • Versioned datasets
    • NautilusTrader simulation
  4. Outputs
    • Results and provenance
    • Standalone Python bundle
Simplified from the compiler, export code and project documentation. The compiler feeds both the worker and the standalone export.

Compiling to ordinary Python, rather than interpreting the graph at run time, keeps one artefact at the centre: what the worker runs, what export produces and what the hash identifies are the same code.

Testing and limits

The project’s latest verification report records a local Linux gate, 36 mutations caught by the test suite, and research and leakage checks. These are the project’s recorded results, not a run performed for this site.

  • macOS and hosted verification remain outstanding. The hosted CI run for the inspected version executed no steps, so it provides no test results either way.
  • Research on real, licensed market data is still to come; the captures here use synthetic data.
  • The studio is a research tool. Nothing on this page is a claim of trading performance.

Status and next steps

Quant Research Studio is a working prototype. Next are hosted and cross-platform verification and a research programme on licensed data.