Market LabDocs

Market Lab v0.1.6

First-class Jupyter Notebook research with inside your existing Python environment.

v0.1.6 adds a JupyterLab research mode to Market Lab.

Run one command inside an existing Python project and Market Lab launches JupyterLab with historical data and Rust-backed studies available through a preloaded mlab object.

No Market Lab Python package is required. The notebook continues to use the project’s own Python environment, dependencies, and research workflow.

Launch from your Python project

From the project directory, run:

mlab notebook

Market Lab opens JupyterLab in the current folder.

You can select an interpreter with --python. Otherwise, Market Lab can use the project’s local .venv or the Python available on PATH.

The selected environment retains its own NumPy, pandas, Matplotlib, and other research packages. Market Lab does not replace the project’s dependency setup with a separate notebook environment.

If JupyterLab or ipykernel is unavailable, the CLI prints the appropriate installation command for the project’s package manager.

Market Lab inside the kernel

Every notebook launched through mlab notebook receives a ready-to-use mlab object.

Create a historical range and request data directly from a cell:

history = mlab.history(
    start="2026-08-01",
    end="2026-08-20",
)

candles = history.source(
    "btc@candles@hyperliquidf:timeframe=3600"
)

Historical sources are loaded lazily.

The first call fetches and normalizes the requested range. Repeated calls for the same source use the notebook’s in-memory cache instead of fetching the data again.

Returned records are ordinary Python dictionaries, so they can be passed directly into pandas, NumPy, or the rest of the project’s existing research stack.

Rust-backed studies

Notebook cells can call Market Lab’s native Rust study engine directly:

sma = mlab.study.sma(
    candles,
    {
        "field": "c",
        "window": 20,
    },
)

Checkout Built in functions to see supported studies

Designed for research, not simulation

Notebook is meant for research purpose only

It does not expose: ctx, Strategy hooks, The Market Lab simulator, Positions or Live execution

Use Scripting V2 with plain python files:

mlab script backtest

when a strategy must process data sequentially through the Market Lab simulator.

Use:

mlab script run

when the same strategy is ready for live daemon deployment.

See Jupyter Notebook for environment setup, the cell-by-cell workflow, source caching, and the local bridge design.

On this page