Generate regime reports for crypto perpetual futures using technical indicators.
bash
# Run a daily regime report
python3 {baseDir}/scripts/regime_report.py
# Run a weekly regime report
python3 {baseDir}/scripts/regime_report.py --weekly
Or ask directly: "What's the regime on BTC?" or "Run a market report."
Note: The script outputs a formatted report to stdout. The agent handles delivery (e.g., sending to Telegram, displaying in chat).
Price & Trend:
Volume & Liquidity:
Perpetuals Data:
Market Context:
Option A: Edit the default config
Edit {baseDir}/references/config.json to customize your asset list:
json
{
"watchlist": [
{"symbol": "BTC", "name": "Bitcoin", "okx": "BTC-USDT-SWAP"},
{"symbol": "ETH", "name": "Ethereum", "okx": "ETH-USDT-SWAP"}
],
"indicators": {
"supertrend": { "period": 10, "multiplier": 3 },
"adx": { "period": 14, "strong_threshold": 25, "weak_threshold": 20 }
}
}
Option B: Use a custom config file
bash
# Via environment variable (must be relative path within skill directory)
REGIME_CONFIG=references/my-config.json python3 {baseDir}/scripts/regime_report.py
Security note: For security, config paths are restricted to the skill directory. Absolute paths and path traversal (e.g., ../) are not allowed.
An example config is provided at {baseDir}/references/config.example.json — copy and modify it for your needs.
Config fields:
symbol — Short ticker (used for display)name — Full name (used for display)okx — OKX perpetual symbol (must match OKX's format: ASSET-USDT-SWAP)To find OKX symbols: Visit OKX Markets or use:
bash
curl -s "https://www.okx.com/api/v5/public/instruments?instType=SWAP"
# Optionally pipe through jq to filter: | jq '.data[].instId'
Adjust in config.json:
SettingDefaultDescriptionsupertrend.period10Lookback period for ATR calculationsupertrend.multiplier3.0ATR multiplier for band widthadx.period14Lookback period for ADXadx.strong_threshold25ADX level for "strong" trendadx.weak_threshold20ADX level for "weak" trend
Use OpenClaw's cron system to receive reports automatically.
Via CLI:
bash
# Morning report (6am PST)
openclaw cron add \
--name "Morning Regime Report" \
--schedule "0 6 * * *" \
--timezone "America/Los_Angeles" \
--message "Run the crypto regime morning report"
# Evening report (3pm PST)
openclaw cron add \
--name "Evening Regime Report" \
--schedule "0 15 * * *" \
--timezone "America/Los_Angeles" \
--message "Run the crypto regime evening report"
# Friday weekly summary (4pm PST)
openclaw cron add \
--name "Friday Weekly Summary" \
--schedule "0 16 * * 5" \
--timezone "America/Los_Angeles" \
--message "Run the crypto regime weekly report with --weekly flag"
Via config ( ~/.openclaw/openclaw.json):
json5
{
// ... other config ...
"cron": {
"jobs": [
{
"name": "Morning Regime Report",
"schedule": { "kind": "cron", "expr": "0 6 * * *", "tz": "America/Los_Angeles" },
"sessionTarget": "isolated",
"payload": { "kind": "agentTurn", "message": "Run the crypto regime morning report" },
"delivery": { "mode": "announce" }
},
{
"name": "Evening Regime Report",
"schedule": { "kind": "cron", "expr": "0 15 * * *", "tz": "America/Los_Angeles" },
"sessionTarget": "isolated",
"payload": { "kind": "agentTurn", "message": "Run the crypto regime evening report" },
"delivery": { "mode": "announce" }
},
{
"name": "Friday Weekly Summary",
"schedule": { "kind": "cron", "expr": "0 16 * * 5", "tz": "America/Los_Angeles" },
"sessionTarget": "isolated",
"payload": { "kind": "agentTurn", "message": "Run the crypto regime weekly report with --weekly flag" },
"delivery": { "mode": "announce" }
}
]
}
}
bash
# Test daily report
python3 {baseDir}/scripts/regime_report.py
# Test weekly report
python3 {baseDir}/scripts/regime_report.py --weekly
SupertrendADXRegimeBullish> 25Strong BullBullish20-25Weak BullBearish> 25Strong BearBearish20-25Weak BearEither< 20Ranging
DataSourceNotesDaily OHLCVOKX APIFree, no key requiredWeekly OHLCVYahoo Finance11+ years history, OKX fallbackFunding RatesOKX APIFree, no key requiredOpen InterestOKX APIFree, no key required
OKX API endpoints:
/api/v5/market/candles/api/v5/public/funding-rate/api/v5/public/open-interestregime_report.py — Main script that fetches data and generates the reportconfig.json — Default watchlist configuration (edit this to customize)config.example.json — Example config you can copy and modify