Skip to content

CLI Commands

matchstick init <name>

Create a new strategy project with boilerplate code and sample data.

Usage: matchstick init <PROJECT_NAME>

Arguments:
  <PROJECT_NAME>  Name of the project directory to create

Generated files

FileDescription
src/strategy.jsonMean reversion strategy spec
data/sample_data.csv1440 bars of OHLCV data
matchstick.config.jsonBacktest and risk config
README.mdQuick start guide

matchstick run

Execute strategy backtesting with market data.

Usage: matchstick run [OPTIONS] --strategy <STRATEGY>

Options:
      --strategy <STRATEGY>  Path to strategy file
      --mode <MODE>          Execution mode [default: backtest]
      --data <DATA>          Path to CSV market data file
      --capital <CAPITAL>    Initial capital for backtesting [default: 100000]

CSV format

timestamp,symbol,open,high,low,close,volume

Output metrics

  • Final P&L ($)
  • Return (%)
  • Total Trades
  • Win Rate (%)
  • Sharpe Ratio
  • Max Drawdown (%)

matchstick watchlist show <file>

Display a watchlist from a JSON file with custom computed columns.

Usage: matchstick watchlist show [OPTIONS] <FILE>

Arguments:
  <FILE>  Path to watchlist JSON file

Options:
      --json      Output as JSON instead of ASCII table
      --no-color  Disable colors in output
      --plain     Use plain ASCII instead of Unicode box drawing

Watchlist JSON format

json
{
  "name": "Growth Stocks",
  "symbols": [
    {
      "ticker": "AAPL",
      "financials": {
        "PE_RATIO": 28.5,
        "EPS_GROWTH_5Y": 12.3
      }
    }
  ],
  "custom_columns": [
    {
      "name": "PEG",
      "expression": "PE_RATIO / EPS_GROWTH_5Y",
      "column_type": "ratio",
      "position": 0
    }
  ]
}

Formula DSL

FeatureExample
ArithmeticPE_RATIO / EPS_GROWTH_5Y
ComparisonPE_RATIO < 20
LogicalPE_RATIO < 20 && GROWTH > 10
Functionsavg(A, B, C), min(A, B), max(A, B), abs(X), pct_change(NEW, OLD)
Conditionalif(PE_RATIO < 15, 1, 0)
Percentage15% (evaluates to 0.15)

Built for traders who value data provenance.