Scripting V2 - Python
Research interactively in Jupyter or backtest and deploy plain Python files.
Market Lab provides two Python workflows.
Scripting with Jupyter Notebook
Use JupyterLab for interactive historical research, pandas or NumPy analysis, visualization, and native Market Lab studies.
mlab notebookMarket Lab injects mlab into the notebook kernel. This workflow has no script manifest, callback hooks, simulator, or live execution.
Start with Scripting with Jupyter Notebook.
Plain Python Files
Write a normal .py strategy and run it through Market Lab's sequential backtester, daemon, and execution runtime.
mlab script backtest strategy.py --from 2026-08-01 --to 2026-08-20
mlab script run strategy.pyPlain files use on_data(ctx, history), retained source history, simulated or live execution, positions, PnL, and artifacts. They require no Market Lab Python package or base class.
Start with Plain Python Files.