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 createGenerated files
| File | Description |
|---|---|
src/strategy.json | Mean reversion strategy spec |
data/sample_data.csv | 1440 bars of OHLCV data |
matchstick.config.json | Backtest and risk config |
README.md | Quick 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,volumeOutput 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 drawingWatchlist 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
| Feature | Example |
|---|---|
| Arithmetic | PE_RATIO / EPS_GROWTH_5Y |
| Comparison | PE_RATIO < 20 |
| Logical | PE_RATIO < 20 && GROWTH > 10 |
| Functions | avg(A, B, C), min(A, B), max(A, B), abs(X), pct_change(NEW, OLD) |
| Conditional | if(PE_RATIO < 15, 1, 0) |
| Percentage | 15% (evaluates to 0.15) |