ClawHub Integration
Integrate ZhenQuant quantitative trading factors directly into your ClawHub workflow with a single command.
Quick Start
1. Install the ZhenQuant Skill
Terminal
clawhub install quant-trader2. Get Your API Key
Choose your user type to get started:
3. Configure Your Environment
Add your API key to environment variables:
export ZHENQUANT_API_KEY="your_api_key_here"Code Examples
Python - Basic Usage
from zhenquant import ZhenQuantClient
# Initialize client with API key
client = ZhenQuantClient(api_key="your_api_key_here")
# Calculate moving average
result = client.factors.calculate(
factor_code="MA",
symbols=["AAPL", "TSLA"],
period=20
)
print(result)Python - Advanced (Batch + Billing)
from zhenquant import ZhenQuantClient
client = ZhenQuantClient(api_key="your_api_key_here")
# Calculate multiple factors
factors = client.factors.batch_calculate([
{"code": "MA", "period": 20},
{"code": "RSI", "period": 14},
{"code": "MACD", "fast": 12, "slow": 26, "signal": 9}
], symbols=["AAPL", "TSLA", "GOOGL"])
# Get usage stats
usage = client.billing.get_usage()
print(f"Used: {usage['used_cu']}/{usage['quota_cu']} CU")Node.js / TypeScript
const { ZhenQuantClient } = require('@zhenquant/sdk');
// Initialize client
const client = new ZhenQuantClient({
apiKey: 'your_api_key_here'
});
// Calculate RSI
async function calculateRSI() {
const result = await client.factors.calculate({
factorCode: 'RSI',
symbols: ['AAPL', 'TSLA'],
period: 14
});
console.log(result);
}
calculateRSI();REST API (cURL)
curl -X POST https://your-zhenquant-host/v1/factors/calculate \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"factor": "MA",
"symbols": ["AAPL", "TSLA"],
"params": {
"period": 20
},
"timeframe": "1d"
}'直接 HTTP 集成默认使用 X-API-Key, 并将 your-zhenquant-host 替换为当前环境域名或同源网关地址; 后端仍兼容 Authorization: Bearer。
Features
- 100+ technical & alpha factors
- Real-time compute units tracking
- Flexible billing (subscription + pay-as-you-go)
- Python & Node.js SDKs
- RESTful API with OpenAPI docs
Compute Units
Free1,000 CU/month
Professional (¥50/mo)10,000 CU/month
Enterprise (¥500/mo)Unlimited
Factor costs range from 1-20 CU per request based on complexity.
Documentation & Resources
Need help getting started?