MarketLab Docs

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

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.

Verbose JSON

Add --verbose to include expanded context.

Examples:

cargo run -- study spread --provider mmt --exchange bybitf --symbol BTC/USDT --depth 20 --output json --verbose
cargo run -- strategy backtest sma-crossover --provider mmt --exchange bybitf --symbol BTC/USDT --timeframe 60 --from 1779660000000 --to 1779705600000 --fast 20 --slow 50 --output json --verbose

Stream JSONL

Use jsonl for stream-oriented commands.

Examples:

cargo run -- source candles --provider mmt --exchange binancef --symbol BTC/USDT --timeframe 60 --stream --output jsonl
cargo run -- strategy run sma-crossover --provider mmt --exchange bybitf --symbol BTC/USDT --timeframe 60 --output jsonl

Study Shape

Default compact study JSON contains:

  • type
  • version
  • provider
  • exchange
  • symbol
  • ts_ms
  • stream
  • metrics

Verbose study JSON also includes:

  • inputs
  • meta

Strategy Shape

Run strategy JSON is event-oriented.

Backtest strategy JSON is summary-oriented.

Default compact backtest JSON contains:

  • type
  • version
  • strategy
  • provider
  • exchange
  • symbol
  • ts_ms
  • performance

Verbose backtest JSON also includes:

  • window
  • inputs
  • latest_state
  • reasons

Default compact stream strategy JSON contains:

  • type
  • version
  • strategy
  • provider
  • exchange
  • symbol
  • ts_ms
  • mode
  • signal
  • decision
  • metrics

On this page