JSON Output
Compact machine output, verbose mode, and stream-friendly JSONL behavior.
JSON Output
Market Lab has two priorities:
- good human terminal output
- compact machine-readable output
Market Catalog JSON
The markets command uses a dedicated --json flag:
mlab markets --provider bulk --jsonFull catalog JSON contains:
schemaVersionprovidersourceUrlfetchedAtmarkets
Requesting one symbol returns that market object directly:
mlab markets --provider bulk --symbol BTC/USDT --jsonEach market contains symbol mapping, status, precision, tick and lot sizes, minimum notional, maximum leverage, order types, and time-in-force values. This output is an embedded rules snapshot, not live market data.
Default JSON
For study and strategy, default JSON is intentionally compact.
That means the default output includes only the fields an agent or script usually needs.
Script JSON follows the same rule: default output stays compact, while runtime reports can be inspected separately with script runs list and script runs show.
Verbose JSON
Add --verbose to include expanded context.
Examples:
mlab study spread --provider mmt --exchange bybitf --symbol BTC/USDT --depth 20 --output json --verbosemlab strategy backtest sma-crossover --provider mmt --exchange bybitf --symbol BTC/USDT --timeframe 60 --from 1779660000000 --to 1779705600000 --fast 20 --slow 50 --output json --verboseStream JSONL
Use jsonl for stream-oriented commands.
Examples:
mlab source candles --provider mmt --exchange binancef --symbol BTC/USDT --timeframe 60 --stream --output jsonlmlab strategy run sma-crossover --provider mmt --exchange bybitf --symbol BTC/USDT --timeframe 60 --output jsonlStudy Shape
Default compact study JSON contains:
typeversionproviderexchangesymbolts_msstreammetrics
Verbose study JSON also includes:
inputsmeta
Strategy Shape
Run strategy JSON is event-oriented.
Backtest strategy JSON is summary-oriented.
Default compact backtest JSON contains:
typeversionstrategyproviderexchangesymbolts_msperformance
Verbose backtest JSON also includes:
windowinputslatest_statereasons
Default compact stream strategy JSON contains:
typeversionstrategyproviderexchangesymbolts_msmodesignaldecisionmetrics
Script Shape
Script hooks return only the script payload:
metrics- optional
signal - optional
intent - optional
meta
Market Lab wraps that payload in command output.
Default script backtest JSON contains:
typeversionproviderexchangesymbolts_msscriptsummaryperformanceparams
Verbose script backtest JSON also includes:
windowclosed_tradesopen_positionslatest_outputmeta
Script Runtime Reports
Script runtime reports are stored locally and can be viewed from the CLI.
mlab script runs list --output jsonmlab script runs show <run-id> --output jsonRuntime report JSON contains:
scriptcommandproviderexchangesymbolstarted_at_msended_at_msduration_msstatuslimitsruntimeerror