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.
A working strategy lab, running in this page
Everything below computes locally. No account, no network.
Strategy
Natural languageNo strategy yet.
Describe one above and Hurst will compile it into editable strategy source.
Inspector
No results yet.
Run a backtest to populate performance metrics.
Execution
hurst-engine · local› waiting for a backtest
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.
- 01
Strategy
Extend BaseStrategy — onBar → Signal. SMA crossover and mean-reversion shipped as examples.
- 02
Data
IDataFeed streams bars from Parquet files. CSV and IBKR adapters planned for later phases.
- 03
Backtest
BacktestEngine fans out each bar to every strategy concurrently, with isolated sub-portfolios and transaction costs.
- 04
Metrics
Sharpe, Sortino, max drawdown, win rate — per strategy plus an aggregate portfolio report.
- 05
Paper / LivePlanned
Same strategy code, swap the broker adapter — IBKR paper trading and live execution planned.
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)
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.
$ 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)
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-labshurst-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- BacktestBrokerimplemented
- IBKR (Interactive Brokers)planned — Phase 2
- PaperBrokerstub — Phase 2
- SnapTrade multi-brokercandidate
- Customimplement IBroker