Skip to Strategy Lab
Phase 1 live — backtest engine operational

Write once.
Backtest.
Deploy live.

Hurst is a TypeScript framework for algorithmic trading. Write a strategy once, run it unchanged in backtest, paper, and live modes against Interactive Brokers. Hexagonal architecture, isolated sub-portfolios, zero vendor lock-in.

SIMULATED · SPY · 2024+24.5% return
equity curve

A working strategy lab, running in this page

Everything below computes locally. No account, no network.

Strategy Lab
Strategy lab status: Ready

Strategy

Natural language

No strategy yet.

Describe one above and Hurst will compile it into editable strategy source.

BTC/USDPrice · indexed to 100

Inspector

No results yet.

Run a backtest to populate performance metrics.

Execution

hurst-engine · local

waiting for a backtest

How it works

One engine. Three modes.

Hexagonal architecture means the strategy you write in backtest is the exact code that trades in production — only the adapter at the edge changes. Phase 1 covers backtest end-to-end; paper and live are additive, not rewrites.

  1. 01

    Strategy

    Extend BaseStrategy — onBar → Signal. SMA crossover and mean-reversion shipped as examples.

  2. 02

    Data

    IDataFeed streams bars from Parquet files. CSV and IBKR adapters planned for later phases.

  3. 03

    Backtest

    BacktestEngine fans out each bar to every strategy concurrently, with isolated sub-portfolios and transaction costs.

  4. 04

    Metrics

    Sharpe, Sortino, max drawdown, win rate — per strategy plus an aggregate portfolio report.

  5. 05

    Paper / LivePlanned

    Same strategy code, swap the broker adapter — IBKR paper trading and live execution planned.

Architecture

Ports & adapters.
No vendor lock-in.

The engine's domain logic never talks to a data source or broker directly — only through interfaces. Write a strategy once, run it unchanged in backtest, paper, and live modes against Interactive Brokers and beyond.

Pattern
Hexagonal (ports & adapters)
Isolation
Sub-portfolio per strategy
Concurrency
Promise.all fan-out per bar
First broker
IBKR (backtest live now)
CLI / APIhurst backtest --strategies sma,mean-reversion
HURST ENGINEBacktestEngine · the run loop · state machine
IDataFeedDATAIDataFeed — Parquet adapter (CSV, IBKR planned)
DomainSTRATEGYBaseStrategy → Signal, fan-out per bar
IBrokerEXECUTIONIBroker — BacktestBroker (Paper/Live planned)
SUB-PORTFOLIOS · AGGREGATE REPORTPer-strategy isolation + master view
Quickstart

It is a CLI first.

The interface is a view onto the engine, not the other way around. Everything the lab does is a command you can run, script, and put in CI.

Figures below are from the simulated dataset shipped with the fixture.

hurst@framework — bash
$ git clone nord-labs/hurst-framework && cd hurst-framework
  • npm install · 109 packages
  • npm run build · tsup → dist/
$ hurst backtest --strategies sma,mean-reversion --data SPY.parquet
  • 2 strategies · 28 trades · concurrent fan-out
  • Sharpe 1.42 · Sortino 2.1 · max DD -12.4%
  • win rate 62.5% · (simulated fixture)
Open source

Fork the engine.
Own the stack.

Hurst is open source under Apache 2.0 — fork it, run it, embed it in proprietary systems with patent grant protection. The parts you are most likely to outgrow — data, brokers, execution — are the parts designed to be replaced.

Write once, run anywhere
Zero code changes switching between backtest, paper, and live modes.
Multi-strategy parallelism
Run dozens of strategies concurrently with isolated sub-portfolios.
Hexagonal by design
Data sources and brokers are adapters — the engine never depends on a vendor.
TypeScript-native
Strict types, ESM, tsup build. Structured for npm publish from day one.

Repository

github.com/nord-labs
  • hurst-framework/
  • ├── src/core/Bar, Signal, Order, Fill, Position
  • ├── src/engine/BacktestEngine + sub-portfolios
  • ├── src/data/IDataFeed + ParquetAdapter
  • ├── src/brokers/IBroker + BacktestBroker
  • ├── src/strategies/BaseStrategy + examples
  • ├── src/metrics/Sharpe, Sortino, drawdown
  • └── src/cli/hurst backtest

Brokers & adapters

IBroker port
  • BacktestBroker
    implemented
  • IBKR (Interactive Brokers)
    planned — Phase 2
  • PaperBroker
    stub — Phase 2
  • SnapTrade multi-broker
    candidate
  • Custom
    implement IBroker