Data and markets
Prepare inputs, define markets, and use adapter-based data loading.
Data and markets
Canonical bars first
The runtime prefers canonical bars. That is why data helpers live in @thecommandcat/fbtf/data.
The main helpers are:
normalizeBarnormalizeBarsparseBarsCsvloadBarsFromCsvFileloadBarsFromHistoricalProvider
Use those helpers to normalize input before handing it to the runner.
Markets
The runner needs an explicit market definition.
Use:
defineMarketfor your own market definitions@thecommandcat/fbtf/marketsfor built-in futures markets likemnq,nq,mes, andes
Market definitions are where runtime assumptions like timezone and futures tick math become explicit.
Historical provider seam
The HistoricalBarsProvider contract exists so provider-specific behavior stays outside the runner.
That means adapters can deal with:
- authentication
- request formats
- pagination/range fetching
- symbol mapping
- provider-specific schemas
while the runtime still consumes normalized bars.
Databento
The repo includes a Databento adapter under @thecommandcat/fbtf/data/databento.
Use it when you want real futures bars loaded through the same canonical path as other data sources.
That keeps the example story realistic without making the runner itself vendor-specific.
Practical guidance
- use
normalizeBars()for tiny in-memory examples and tests - use CSV helpers when you want repeatable local fixtures
- use provider adapters when you want real external data
If you keep that separation, the rest of the runtime stays much easier to reason about.
fbtf docs
Deterministic backtesting and live paper trading docs for TypeScript.
Getting started
Install fbtf and run your first minimal backtest.
Core concepts
Understand the runtime model behind fbtf.
Runtime flow
How feeds, strategies, brokers, and the runner interact during execution.
API overview
Learn the main entrypoints and useful subpaths.
Results and diagnostics
Inspect what happened after a run and understand how the runtime explains itself.
Experiments and CLI
Run experiment modules through the config-first fbtf CLI.
Roadmap
What FBTF is trying to finish next and what is intentionally out of scope.