Content
# Tool List
## Let AI Upgrade from "Data Mover" to "Data Analyst" - Use Code to Calculate Objective Results
QuantAll (Full A Analysis) is a **local stock market vectorized computing engine** that provides services through the MCP (Model Context Protocol) protocol. It is based on DuckDB and supports factor calculation, strategy backtesting, factor IC analysis, and GPU multi-dimensional visualization for over 5,000 stocks, completely free and running independently (not dependent on external APIs).
## ✨ Features
- **Full Market Vectorized Computing**: Abstract 5,500+ stocks and 150+ dimensions of data into a unified matrix, allowing AI to write vectorized code for rapid computation.
- **Strategy Backtesting**: Supports custom holding matrix, one-click to obtain performance indicators such as return, Sharpe ratio, drawdown, and win rate.
- **Factor Analysis**: Single-factor IC analysis, batch factor horizontal comparison, supports IC time series stability and scatter plot visualization.
- **Visualization Exploration**: Through layer marking, coordinate translation, weight control, and heat map statistics, intuitively mine data patterns.
- **Interactive Analysis**: Users can select scatter plots on the GUI, and AI obtains selected content for in-depth analysis, forming a closed loop of "display → observation → question → verification".
- **Completely Local**: All data is stored in the local DuckDB, no need to connect to the network (except for data updates), protecting privacy and free.
## 🚀 Quick Start
### 1. Install QuantAll Package
The core computing engine of this skill has been released to PyPI, and it is recommended to use a virtual environment to isolate dependencies.
```bash
# Clone or download the skill package (assuming it has been obtained from SkillHub)
cd ~/.workbuddy/skills/quantall
# Create a virtual environment (taking Windows as an example)
python -m venv scripts/.venv
# Activate the virtual environment and install QuantAll (use the Tsinghua mirror source)
scripts/.venv/Scripts/python.exe -m pip install quantall -i https://pypi.tuna.tsinghua.edu.cn/simple
```
> **Note**: QuantAll depends on about 45 packages (including large libraries like PySide6), with a total size of about 300MB. It is strongly recommended to use a domestic mirror source for acceleration.
### 2. Configure MCP Client
Add the following entry to the configuration file of the MCP client (e.g., `~/.workbuddy/mcp.json`):
```json
{
"mcpServers": {
"Full A Analysis": {
"url": "http://127.0.0.1:8686/mcp",
"disabled": false
}
}
}
```
> If there are other MCP configurations, merge them into `mcpServers` and do not overwrite existing entries.
### 3. Start QuantAll Service
Enter the `scripts/` directory and run the startup script:
```bash
scripts/.venv/Scripts/python.exe scripts/Start_QuantAll.py
```
The service will start at `http://127.0.0.1:8686`, providing an HTTP MCP interface.
> **Recommended Practice**: Create a desktop shortcut for one-click startup. For specific methods, refer to `SKILL.md` in the skill package.
### 4. Trust MCP Connection (for WorkBuddy Users)
Since QuantAll is an HTTP MCP (not stdio), WorkBuddy will not automatically discover new services. Please find "Full A Analysis" on the **Connector Management** page, click the **Trust** button to authorize, or directly restart WorkBuddy.
## 🧰 Available Tools
| Tool | Function |
|------|------|
| `ping` | Health check |
| `available_data` | View available data fields in the current database |
| `strategy_backtest` | Strategy backtesting (supports summary/detail/segments/timeline views) |
| `factor_analysis` | Single-factor IC analysis (summary/daily/scatter mode) |
| `batch_factor_analysis` | Batch factor IC analysis (pass multiple factors at once) |
| `save_factor_result` | Save factor analysis results to the database |
| `new_layer_from_code` | Create a custom layer (mark interesting events/conditions) |
| `move_by_code` | Map data dimensions to X/Y axes (coordinate translation) |
| `weight_by_code` | Set statistical weights |
| `select_by_code` | Filter subsets (supports 6 types of set operations) |
| `heat_map` | Obtain a two-dimensional heat map statistics matrix (supports custom range) |
| `get_user_selection` | Get scatter plot information selected by the user on the GUI |
| `MCP_Close` | Close the service (use with caution) |
For detailed parameter descriptions and usage examples, refer to `SKILL.md` in the skill package.
## 📊 Typical Workflow
### Strategy Backtesting
1. `ping` confirms the service is ready
2. `available_data` confirms required fields
3. `strategy_backtest` (first `view=summary` for quick evaluation, then deepen to `detail`/`segments`/`timeline` as needed)
### Factor Analysis
1. `factor_analysis` (`mode=summary`) judges factor validity (|IC_IR|>0.3)
2. If valid, switch to `mode=daily` or `scatter` to view time series and distribution
3. Use `batch_factor_analysis` for horizontal comparison of multiple factors
4. Use effective factors for strategy backtesting verification
### Visualization Exploration
1. `new_layer_from_code` marks interesting events (e.g., buy signals, full market points)
2. `move_by_code` maps factors to X/Y axes
3. `weight_by_code` sets weights (optional)
4. `heat_map` obtains distribution matrix
5. `select_by_code` filters subsets, iterative analysis
6. User selects interesting scatter plots → `get_user_selection` → AI in-depth analysis
## 📁 Data Management
QuantAll itself does not produce data but reads the user's local DuckDB database. The skill package comes with a test database (only including the CSI 300 basic market data for the past two years) for functional verification.
- **Use your own database**: Modify `db_path` in `scripts/DB_setting.json` to point to your DuckDB file and ensure the table structure meets the requirements (see `SKILL.md` for details).
- **Use the UpdateStock auxiliary tool**: If you need AI to automatically create and update the database, you can additionally configure `UpdateStock` MCP (requires tushare API key, see the skill package for specific instructions).
## ⚠️ Precautions
- All tools requiring the `code` parameter run in the **Python Exec environment**, and the code must be **vectorized**, prohibiting the use of `import`, loops, `lambda`, `df.apply()`, etc.
- Stock-based factors must be divided by `d['close']` (non-referenced price) to eliminate dimension.
- In backtesting, the holding matrix is generated using the built-in function `hold_until(buy, sell)`.
- **Parallel tool calls are not supported** - all MCP tools must be executed serially.
## 🔄 Update Skill
When the skill package version is updated, please synchronously upgrade the Python library:
```bash
scripts/.venv/Scripts/python.exe -m pip install --upgrade quantall -i https://pypi.tuna.tsinghua.edu.cn/simple
```
Then restart the QuantAll service and reconnect to the MCP in the client.
## 📄 License
This skill follows the [MIT License](LICENSE) or see the license file in the skill package for specific details. Note: Only this skill, not the Python package quantall.
## 📖 More Documents
For detailed usage patterns, code templates, practical cases, and pit records, please refer to `SKILL.md` and `references/quantall_playbook.md` in the skill package.
## Enjoy the fun of exploring the market with code! 🚀