Function reference

q.bt

LEAN backtest orchestration, exact native artifacts, and isolated interactive reports.

bt Backtest execution and reporting.
bt.lean Typed local Lean CLI orchestration.

q.experiment

Backend-neutral experiment runs, parameters, metrics, datasets, models, and artifacts with local and MLflow tracking.

experiment Reproducible experiment runs, metrics, datasets, models, and artifacts.

q.ai

Generation, structured extraction, embeddings, retrieval, agents, batch inference, evaluation, local models, and serving specifications.

ai QRT’s curated generative-AI workbench.
ai.client Configured client for repeatable QRT AI workflows.
ai.types Shared messages, results, capabilities, usage, and provenance types.
ai.embeddings Hosted and local embedding contracts.
ai.vector LanceDB-backed embedded vector indexes.
ai.rag Point-in-time retrieval-augmented generation workflows.
ai.prompts Versioned deterministic prompt assets.
ai.tools Typed, allowlisted tool definitions and execution.
ai.agents Bounded Pydantic AI-backed agent workflows.
ai.batch Stable-key, resumable batch inference.
ai.evals Versioned evaluation suites and regression reports.
ai.tokenize Model-aware token counting and context budgeting.
ai.local Explicit context-managed local model engines.
ai.serve Validated local inference-server specifications.
ai.finetune LoRA and QLoRA adaptation specifications with artifact lineage.

q.indicator

Single-instrument market measurements and explicit provider catalogs.

indicator Stateless market measurements for research, rules, and model inputs.
indicator.talib TA-Lib indicators exposed with a pandas-friendly interface.
indicator.pandas_ta pandas-ta-classic indicators exposed under the qrt indicator namespace.

q.cross_section

Cross-sectional characteristics, rankings, and neutralization.

cross_section Cross-sectional characteristics and relative asset measurements.

q.label

Future-aware financial labels, event detection, and overlap-aware sample weights.

label Leakage-explicit target construction for financial machine learning.

q.dataset

Aligned model inputs, targets, sample weights, metadata, and split schemes.

dataset Aligned datasets that bridge feature and label research with model fitting.

q.transform

Fitted transformations applied at the model-training boundary.

transform Fitted transformations applied at the model-training boundary.
transform.impute Missing-data indicators and imputation.
transform.scale Numeric feature normalization.
transform.outlier Outlier detection and treatment.
transform.encode Categorical feature encoding.
transform.reduction Dimensionality reduction for feature matrices.
transform.selection Feature selection methods.

q.calendar

Exchange sessions, closures, and market-time operations.

calendar Exchange sessions, closures, and market-time operations.

q.signal

Point-in-time investment intent derived from indicators, factors, models, and rules.

signal Point-in-time investment intent derived from scores, models, or rules.

q.stats

Reusable return-stream, risk, and classification statistics, including performance, tail-loss estimators, rolling diagnostics, and multiclass evaluation curves (no plotting dependency).

stats Statistical analytics for return streams: performance, risk, and benchmark-relative metrics.

q.plot

Interactive classification diagnostics, return-stream charts, trade visualizations, and performance reports.

plot Opinionated static and interactive plots for quantitative research.
plot.interactive Interactive Plotly charts for quantitative research return streams.

q.data

Loading/saving local files, market data sources (Yahoo Finance, Binance, DuckDB) each exposed as their own submodule, prepackaged sample datasets, and the master securities database.

data Data access: loading/saving local files, downloading from market data
data.clean Deterministic cleaning and validation for market-data frames.
data.local Local file loading and saving (parquet, csv, …) plus raw trade
data.datasets Prepackaged sample datasets shipped with qrt for offline use – handy
data.sources Data sources: network vendors, databases, and other backends – each
data.sources.yfinance Yahoo Finance market data source (stocks, ETFs, indices).
data.sources.binance Binance futures market data source.
data.sources.duckdb Generic DuckDB-backed data source.

q.model

ML model utilities: PyTorch helpers and a compatibility bridge for sklearn time-series position arrays.

model ML model utilities: helpers for building, inspecting, and training models.
model.torch PyTorch model helpers.
model.selection Compatibility helpers for array-based model selection.

q.env

Environment variables, runtime inspection, hardware reports, and declarative requirements.

env Environment variable and .env file helpers.

q.gym

Gymnasium-compatible financial environments for reinforcement learning.

gym Financial Gymnasium environments for reinforcement-learning agents.
gym.core Gymnasium environments for financial reinforcement learning.

q.utils

Shared utilities.

utils General-purpose helper functions.
Back to top