Skip to content

CLI Reference

ShortLongTypeDefaultDescription
-s--symbolstringsample dataTicker (e.g. AAPL, BTCUSDT). If omitted, chartgen uses random sample data. In --trade mode, defaults to BTCUSDT.
-i--intervalstring4hCandle interval: 1m, 5m, 15m, 1h, 4h, 1d, 1wk.
-p--panelsstring (repeat)cipher_b, macdIndicator names, bottom to top. Repeat the flag for multiple indicators. See the indicator reference.
-n--barsinteger120Number of bars.
-o--outputstringchart.pngOutput file path (one-shot render mode only).
--widthinteger1920Image width in pixels.
--heightinteger1080Image height in pixels.
--sourcestringautoData source: auto, binance, or yahoo. auto picks by ticker suffix (see below).
--mcpflagoffRun as MCP stdio JSON-RPC server. Use with Claude Desktop.
--serveflagoffRun as remote MCP HTTP server with OAuth 2.1 PKCE. See MCP integration and OAuth.
--portinteger9315HTTP server port, used by both --serve and --trade.
--tradeflagoffStart the trading engine: live WebSocket feed, indicator state manager, order tracker, alert engine, and the same HTTP + OAuth server as --serve. Exposes 12 extra MCP tools on top of the 3 charting tools. Mutually exclusive with --serve. See the trading guide.
--testnetflagoffIntended to route --trade orders to Binance testnet. Currently a no-op — see the caution in the trading guide.

chartgen has four modes, picked by the first matching flag in this order (src/main.rs dispatches sequentially and returns early):

  1. --mcp — MCP stdio JSON-RPC, for Claude Desktop.
  2. --serve — HTTP MCP server with OAuth 2.1 PKCE, for Claude.ai (charting tools only).
  3. --trade — trading engine plus the same HTTP + OAuth server as --serve, with all 15 tools exposed.
  4. One-shot render (no mode flag) — fetch data, render chart.png, exit.

--serve and --trade are mutually exclusive; passing both runs only --serve. Use --trade whenever you want the engine — it already serves HTTP.

With --source auto (the default), the ticker suffix picks the provider:

SuffixSource
USDT, BTC, ETHBinance
anything elseYahoo Finance

Force a provider with --source binance or --source yahoo.

Terminal window
chartgen -s BTCUSDT -i 4h -n 200 \
-p ema_stack -p vpvr -p wavetrend \
--width 2560 --height 1440 \
-o btc.png

Live trading engine served over HTTP for Claude.ai:

Terminal window
chartgen --trade --testnet \
--symbol BTCUSDT --interval 1h \
--port 9315 \
-p cipher_b -p rsi_mfi_stoch