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:

  • normalizeBar
  • normalizeBars
  • parseBarsCsv
  • loadBarsFromCsvFile
  • loadBarsFromHistoricalProvider

Use those helpers to normalize input before handing it to the runner.

Markets

The runner needs an explicit market definition.

Use:

  • defineMarket for your own market definitions
  • @thecommandcat/fbtf/markets for built-in futures markets like mnq, nq, mes, and es

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.

On this page