Python API / native extension

API reference

Complete reader, database, and broker documentation for stocks, crypto, currencies, indices, futures, and options.

Choose a reference

The package has two data representations: compressed CSV archives and fixed-record, per-instrument databases. Both expose typed records. Database replay adds a broker where that instrument family supports one.

Instrument coverage

Each row links to the parser's complete record fields and its database constructor. Trades and quotes are separate datasets. Massive-provided minute and daily aggregate files are not parsed; build bars from tick records with the aggregators.

Readers, databases, and execution support
RecordCSV readerDatabaseTime keyBroker
StockTradeFlatFiles.Stock.TradeStockTradeDatabasesip_timestampSimpleMarket
StockQuoteFlatFiles.Stock.QuoteStockQuoteDatabasesip_timestampSimpleMarket
CryptoTradeFlatFiles.Crypto.TradeCryptoTradeDatabaseparticipant_timestampNo built-in broker
CurrencyQuoteFlatFiles.currency.QuoteCurrencyQuoteDatabaseparticipant_timestampNo built-in broker
IndexValueFlatFiles.Indices.ValueIndexValueDatabasetimestampNo built-in broker
FuturesTradeFlatFiles.Futures.TradeFuturesTradeDatabasetimestampFuturesMarket
FuturesQuoteFlatFiles.Futures.QuoteFuturesQuoteDatabasetimestampFuturesMarket
OptionTradeFlatFiles.Options.TradeOptionTradeDatabasesip_timestampOptionMarket
OptionQuoteFlatFiles.Options.QuoteOptionQuoteDatabasesip_timestampOptionMarket

Shared conventions

Conventions used throughout this reference
ConcernContract
Importsimport massive_speedup as ms. Names in signatures use this alias.
Filesstr or os.PathLike for native file paths; database readers use MASSIVE_SPEEDUP_DB_PATH unless overridden by database_path=....
TimeRecord and search timestamps are integer nanoseconds since Unix epoch. Market event tuples expose floating-point seconds. Each reference states its sort key.
DateYYYY-MM-DD or datetime.date for database/session dates. Futures dates represent the session's ending date.
IterationCSV and replay iterators advance once and are exhausted at the end. Daily database objects can create fresh iterators. Records expose read-only attributes.
Native extensionDatabase construction, mmap access, aggregators, and broker replay require the compiled extension. The Python fallback does not implement all native APIs.
ExamplesExamples use 2026-09-11 and representative instrument keys. Substitute dates and identifiers that exist in your downloaded/built files; no example fetches missing data automatically.

Keep each decision in its own time

Feed one observed event into your state, then decide. This matches the incremental update model used by RTTA: historical replay can drive the same update loop as live observations.

Market broker calls return no future fill price, and market summaries are gated until replay finishes. Direct database searches and the lower-level TradeEmulator expose broader access. Follow the documented visibility boundary when writing strategy code.

For an end-to-end workflow, start with the seven-step quick start. This reference follows the native Python bindings and Python helpers.