| name | openfinclaw-quant-research |
| description | AI-powered quantitative research and backtesting platform with end-to-end workflow from research to strategy publication |
| triggers | ["run a backtest","analyze stock fundamentals","create a trading strategy","quantitative research","screen for technical signals","test momentum strategy","backtest my trading idea","analyze market data"] |
OpenFinClaw Quant Research
Skill by ara.so — Hermes Skills collection.
OpenFinClaw is an AI-powered quantitative research platform that enables end-to-end quant workflows through natural language prompts. It provides 60+ built-in analysis skills covering technical, fundamental, sentiment, risk, and factor analysis across US equities, A-shares, HK, crypto, and forex markets. The platform integrates with 20+ AI agents via MCP (Model Context Protocol) and supports streaming research, strategy generation, backtesting, paper trading, and community strategy publishing.
Installation
Quick Install (Interactive Wizard)
npx @openfinclaw/cli@latest install
The wizard will:
- Guide you through API key setup
- Configure MCP for detected AI agents
- Register skill definitions for Claude Code/Cursor
- Run connectivity checks
Non-Interactive Install
npx @openfinclaw/cli@latest install --yes \
--platforms cursor,claude-code \
--tool-groups deepagent,strategy \
--api-key $OPENFINCLAW_API_KEY \
--register-skill
Manual MCP Configuration
Add to your AI agent's MCP config:
Claude Code (~/.claude/settings.json):
{
"mcpServers": {
"openfinclaw": {
"command": "npx",
"args": ["@openfinclaw/cli", "serve", "--tools=deepagent,strategy"],
"env": {
"OPENFINCLAW_API_KEY": "fch_xxx"
}
}
}
}
Cursor (.cursor/mcp.json):
{
"mcpServers": {
"openfinclaw": {
"command": "npx",
"args": ["@openfinclaw/cli", "serve", "--tools=deepagent,strategy"],
"env": {
"OPENFINCLAW_API_KEY": "fch_xxx"
}
}
}
}
VS Code Copilot (settings.json):
{
"github.copilot.chat.codeGeneration.instructions": [
{
"file": "~/.claude/skills/openfinclaw/SKILL.md"
}
],
"mcp.servers": {
"openfinclaw": {
"command": "npx",
"args": ["@openfinclaw/cli", "serve"]
}
}
}
Core Commands
DeepAgent (Research & Backtesting)
openfinclaw deepagent +research "Find RSI divergence on NVDA in last 6 months"
openfinclaw deepagent skills
openfinclaw deepagent threads
openfinclaw deepagent messages --thread-id <id>
openfinclaw deepagent backtests --limit 10
openfinclaw deepagent download --package-id <id> --output ./results
Strategy Management
openfinclaw leaderboard --limit 20
openfinclaw strategy-info <strategy-id>
openfinclaw fork <strategy-id>
openfinclaw list-strategies
openfinclaw validate ./strategies/my-strategy
openfinclaw publish ./my-strategy.zip
openfinclaw publish-verify --submission-id <id>
System Commands
openfinclaw doctor
openfinclaw update
openfinclaw examples
openfinclaw skill-install
openfinclaw serve --tools=deepagent,strategy
Raw API Access
openfinclaw api GET /api/v2/deepagent/threads
openfinclaw api POST /api/v2/deepagent/research/submit \
--json '{"query": "Analyze AAPL momentum", "skill_ids": ["technical_momentum"]}'
Configuration
API Key Setup
Get your API key from hub.openfinclaw.ai.
Environment Variable:
export OPENFINCLAW_API_KEY=fch_xxx
Config File: ~/.openfinclaw/config.json
{
"apiKey": "fch_xxx"
}
Command-line:
openfinclaw deepagent +research "query" --api-key fch_xxx
Resolution order: --api-key → OPENFINCLAW_API_KEY → config file
Tool Groups
Optimize token usage by loading only needed tools:
openfinclaw serve --tools=deepagent
openfinclaw serve --tools=strategy
openfinclaw serve
Common Research Patterns
Technical Analysis
const query = "Find RSI divergence signals on NVDA in the last 6 months, then backtest them";
const query = "Compare a Bollinger Bands strategy on TSLA vs AAPL over 1 year — which wins?";
const query = "Screen the S&P 500 for golden-cross signals this month";
const query = "Backtest a 50/200 SMA crossover on SPY from 2015. Include costs and slippage";
Fundamental Analysis
const query = "Pull Apple's last 8 quarters of revenue, margins, and guidance. Summarize the trend";
const query = "What's driving the NVDA move this quarter — earnings, guidance, or narrative?";
const query = "Compare AMD / INTC / NVDA on growth, margin, and valuation";
Strategy Generation
const query = "Design a momentum strategy on US mega-cap tech. Backtest 2y. Tell me where it breaks";
const query = "Write a mean-reversion strategy on BTC and show drawdown behavior through 2022";
const query = "A-shares 沪深 300 日内轮动策略,年化目标 15%,最大回撤 < 10%";
MCP Tool Reference
DeepAgent Tools (14 total)
fin_deepagent_health()
fin_deepagent_skills()
fin_deepagent_research_submit({ query: string, skill_ids?: string[] })
fin_deepagent_research_poll({ submission_id: string })
fin_deepagent_research_finalize({ submission_id: string })
fin_deepagent_status({ task_id: string })
fin_deepagent_cancel({ task_id: string })
fin_deepagent_threads({ limit?: number, offset?: number })
fin_deepagent_messages({ thread_id: string })
fin_deepagent_backtests({ limit?: number, offset?: number })
fin_deepagent_backtest_result({ backtest_id: string })
fin_deepagent_packages({ limit?: number })
fin_deepagent_package_meta({ package_id: string })
fin_deepagent_download_package({ package_id: string, output_path: string })
Strategy Tools (7 total)
strategy_leaderboard({ limit?: number, offset?: number })
strategy_get_info({ strategy_id: string })
strategy_fork({ strategy_id: string, output_dir?: string })
strategy_list_local({ strategies_dir?: string })
strategy_validate({ strategy_path: string })
strategy_publish({ strategy_path: string })
strategy_publish_verify({ submission_id: string })
Strategy Development Workflow
1. Fork and Customize
openfinclaw leaderboard
openfinclaw fork strat_abc123
2. Edit Strategy
strategy.py (Python):
from openfinclaw import Strategy, Signal
class MyStrategy(Strategy):
def __init__(self):
self.rsi_period = 14
self.overbought = 70
self.oversold = 30
def on_bar(self, bar):
rsi = self.indicators.rsi(self.rsi_period)
if rsi < self.oversold and not self.position:
return Signal.BUY
elif rsi > self.overbought and self.position:
return Signal.SELL
return Signal.HOLD
fep.yaml (FEP v2.0 metadata):
version: "2.0"
strategy:
name: "RSI Mean Reversion"
description: "Buy oversold, sell overbought"
author: "your_username"
tags: ["technical", "rsi", "mean-reversion"]
parameters:
rsi_period: 14
overbought: 70
oversold: 30
backtest:
start_date: "2020-01-01"
end_date: "2023-12-31"
initial_capital: 100000
symbols: ["AAPL", "MSFT", "GOOGL"]
3. Validate and Publish
openfinclaw validate ./strategies/strat_abc123
cd strategies/strat_abc123
zip -r ../../my-strategy.zip .
cd ../..
openfinclaw publish ./my-strategy.zip
openfinclaw publish-verify --submission-id sub_xyz789
Streaming vs. Polling Patterns
Streaming (Human-Friendly CLI)
openfinclaw deepagent +research "Analyze TSLA momentum indicators"
Output streams token-by-token with progress indicators.
Polling (Agent/Script Integration)
SUBMISSION_ID=$(openfinclaw api POST /api/v2/deepagent/research/submit \
--json '{"query":"Analyze TSLA"}' | jq -r .submission_id)
while true; do
STATUS=$(openfinclaw api GET /api/v2/deepagent/research/poll/$SUBMISSION_ID \
| jq -r .status)
[[ "$STATUS" == "completed" ]] && break
sleep 2
done
openfinclaw api GET /api/v2/deepagent/research/finalize/$SUBMISSION_ID
Prompt Engineering Tips
Effective Research Queries
✅ Good:
- "Find RSI divergence on NVDA last 6 months, then backtest with 2% stop-loss"
- "Compare Bollinger Bands vs RSI on AAPL 2020-2023, which has better Sharpe ratio?"
- "Screen S&P 500 for MACD golden cross this week, rank by volume"
❌ Too Vague:
- "Analyze stocks"
- "Good trading ideas"
- "What should I buy?"
Include Constraints
"Backtest momentum strategy on TSLA Jan 2022 - Dec 2023"
"Mean reversion BTC, max drawdown < 15%, position size 10%"
"Design strategy: 15% annual return, Sharpe > 1.5, max 10% drawdown"
Multi-Step Workflows
const query = `
1. Analyze AAPL price action last 2 years
2. Design a momentum strategy based on findings
3. Backtest with transaction costs
4. Suggest parameter optimizations
`;
Troubleshooting
API Key Issues
cat ~/.openfinclaw/config.json
openfinclaw doctor
openfinclaw install --yes --api-key $OPENFINCLAW_API_KEY
MCP Connection Failed
npx @openfinclaw/cli serve --tools=deepagent
tail -f ~/.openfinclaw/logs/mcp-server.log
Strategy Validation Errors
openfinclaw validate ./my-strategy
openfinclaw leaderboard
openfinclaw fork <top-strategy-id>
Backtest Timeout
SUBMISSION_ID=$(openfinclaw deepagent research-submit \
--query "Long backtest query" --json | jq -r .submission_id)
openfinclaw deepagent research-poll --submission-id $SUBMISSION_ID
openfinclaw deepagent research-finalize --submission-id $SUBMISSION_ID
Package Download Issues
openfinclaw deepagent packages
openfinclaw deepagent package-meta --package-id pkg_abc123
openfinclaw deepagent download --package-id pkg_abc123 --output ./downloads
Advanced Configuration
Custom API Endpoints
export HUB_API_URL=https://custom-hub.example.com
export DEEPAGENT_API_URL=https://custom-deepagent.example.com
Timeout Configuration
export REQUEST_TIMEOUT_MS=60000
export DEEPAGENT_SSE_TIMEOUT_MS=300000
Config File Location
export OPENFINCLAW_CONFIG_PATH=/custom/path/config.json
Integration Examples
Use with Claude Code
After install, triggers activate automatically:
User: "Backtest a momentum strategy on NVDA"
Claude: [auto-triggers fin_deepagent_research_submit]
Use with Cursor
In chat:
@openfinclaw design a mean reversion strategy for BTC with max 10% drawdown
Use in Scripts
import { exec } from 'child_process';
import { promisify } from 'util';
const execAsync = promisify(exec);
async function runBacktest(query: string) {
const { stdout } = await execAsync(
`openfinclaw deepagent +research "${query}"`,
{ env: { ...process.env, OPENFINCLAW_API_KEY: 'fch_xxx' } }
);
return stdout;
}
const result = await runBacktest('Test RSI strategy on AAPL');
console.log(result);
GitHub Actions
name: Validate Strategy
on: [push]
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- run: npx @openfinclaw/cli validate ./strategy
env:
OPENFINCLAW_API_KEY: ${{ secrets.OPENFINCLAW_API_KEY }}
Community Resources
Best Practices
- Start with fork: Don't build from scratch—fork a top strategy and customize
- Validate early: Run
openfinclaw validate before lengthy backtests
- Use constraints: Always specify risk limits, timeframes, and performance targets
- Test iteratively: Start with short backtests, then extend timeframe
- Version strategies: Use git to track strategy.py changes before publishing
- Read backtest output: Check trade count, Sharpe ratio, max drawdown—not just returns
- Load selectively: Use
--tools=deepagent or --tools=strategy to reduce token usage
Quick Reference Card
npx @openfinclaw/cli@latest install
openfinclaw deepagent +research "your query"
openfinclaw leaderboard
openfinclaw fork <id>
openfinclaw validate ./strategy
openfinclaw publish strategy.zip
openfinclaw doctor
openfinclaw deepagent skills
openfinclaw examples