quant-trading-cn量化交易专家 - 基于印度股市实战经验,支持策略生成、回测、实盘交易(Zerodha/A股适配)
Install via ClawdBot CLI:
clawdbot install guohongbin-git/quant-trading-cn基于 1780 行印度股市实战经验的量化交易系统。
# 启动向导
./scripts/wizard.sh
# 选择:
# 1. 从头生成交易机器人
# 2. 增强现有代码(修复问题、优化)
# 3. 从实时指数数据创建股票池
# 4. 运行回测对比
# 5. 分析表现
🔥 关键:Tick Size 四舍五入
错误:kite.place_order(price=1847.35, ...)
报错:"Tick size for this script is 5.00"
修复:price = round(price / tick_size) * tick_size # 1847.35 → 1850.00
影响:90% 订单拒绝是 tick size 错误
🔥 关键:VWAP 必须每日重置
错误:跨天累计 VWAP
症状:回测 65% 胜率,实盘 40%
修复:开盘时重置(9:15)
影响:回测-实盘不一致的第一大原因
./scripts/wizard.sh
向导会问:
# 从 NSE 获取最新成分股
./scripts/universe-fetch.sh --indices nifty50,nifty100,midcap150
./scripts/check-code.sh ./my_trading_bot.py
# 输出:
⚠️ 发现 3 个问题:
1. Tick size 未四舍五入(第 45 行)- 会导致订单拒绝
2. VWAP 未每日重置(第 89 行)- 回测实盘不一致
3. 无股票冷却期(第 120 行)- 报复交易风险
| 优化 | 之前 | 之后 | 提升 |
|------|------|------|------|
| Parquet 缓存 | 2.3s | 0.08s | 28.7x |
| Polars 向量化 | 450ms | 12ms | 37.5x |
| API 批量请求 | 15 次 | 1 次 | 15x |
| 预计算指标 | 180ms | 90ms | 2x |
| 总回测时间 | 5 min | 12 sec | 25x |
quant-trading-cn/
├── SKILL.md # 本文件
├── KNOWLEDGE.md # 16 个领域(1780 行)
├── NUANCES.md # 30+ 陷阱
├── scripts/
│ ├── wizard.sh # 交互式向导
│ ├── universe-fetch.sh # 股票池获取
│ └── check-code.sh # 代码检查
└── references/
├── KNOWLEDGE_en.md # 原始英文版
└── NUANCES_en.md # 原始英文版
本项目基于印度市场,但可适配 A 股:
| 印度 | A 股 |
|------|------|
| Zerodha | 雪球/同花顺 |
| Nifty 50 | 沪深 300 |
| Nifty Midcap | 中证 500 |
| T+1 结算 | T+1 结算 |
| 9:15-15:30 | 9:30-15:00 |
⚠️ 本 skill 提供教育性指导,不保证盈利。交易有风险,仅用可承受资金。
版本: 1.0.0
来源: skill-algotrader
Generated Mar 1, 2026
This scenario involves using the skill to generate and backtest trading strategies tailored to Indian stock markets, leveraging Zerodha integration and local market nuances like tick size rounding and T+1 settlement. It supports interactive wizard-based bot creation, enabling users to design strategies for intraday, swing, or positional trading with risk management features.
Users can adapt the skill for A-share markets in China by mapping Indian market components to Chinese equivalents, such as Nifty 50 to CSI 300. It facilitates strategy generation, backtesting, and real-time trading simulation with tools like Snowball or Tonghuashun, while addressing local trading hours and settlement rules.
This scenario focuses on enhancing existing trading code by identifying and fixing common pitfalls, such as tick size errors or VWAP reset issues, using the provided check-code.sh script. It helps improve backtest-real consistency and optimize performance through techniques like Parquet caching and Polars vectorization.
Ideal for educational purposes, this scenario uses the skill to teach quantitative trading concepts, including signal generation, risk management with Kelly Criterion, and performance analysis like Sharpe ratio and drawdown. It provides hands-on experience with real-world examples and failure mode insights to build practical skills.
Users can fetch and filter stock universes from indices like Nifty 50 or mid-cap stocks, then apply momentum scoring and liquidity filters to create optimized portfolios. The skill supports backtesting with multi-timeframe alignment and trade cost modeling to evaluate strategy effectiveness before live deployment.
Offer the skill as a cloud-based service where users pay a subscription fee to access interactive wizards, backtesting engines, and real-time data integrations. Revenue can be generated through tiered pricing based on features like advanced analytics, API access, or premium support for Zerodha and A-share adapters.
Provide tailored consulting services to financial institutions or individual traders, using the skill to develop custom trading bots, optimize existing systems, or adapt strategies for specific markets like India or China. Revenue comes from project-based fees, ongoing maintenance contracts, and training workshops.
Leverage the skill's detailed knowledge areas and common pitfalls to create online courses, certifications, or workshops on quantitative trading. Revenue is generated through course enrollment fees, certification exams, and selling supplementary materials like code templates or market analysis reports.
💬 Integration Tip
Ensure Python3 is installed and configure API keys for Zerodha or A-share platforms before using real-time trading features; start with the wizard.sh script for guided setup to avoid common pitfalls.
Analyze stocks and cryptocurrencies using Yahoo Finance data. Supports portfolio management, watchlists with alerts, dividend analysis, 8-dimension stock scoring, viral trend detection (Hot Scanner), and rumor/early signal detection. Use for stock analysis, portfolio tracking, earnings reactions, crypto monitoring, trending stocks, or finding rumors before they hit mainstream.
Get stock prices, quotes, fundamentals, earnings, options, dividends, and analyst ratings using Yahoo Finance. Uses yfinance library - no API key required.
Yahoo Finance (yfinance) powered stock analysis skill: quotes, fundamentals, ASCII trends, high-resolution charts (RSI/MACD/BB/VWAP/ATR), plus optional web a...
Become an autonomous prediction market trader on Polymarket with AI-powered analysis and a performance-backed token on Base. Trade real markets, build a track record, and let the buyback flywheel run.
Get cryptocurrency token price and generate candlestick charts via CoinGecko API or Hyperliquid API. Use when user asks for token price, crypto price, price chart, or cryptocurrency market data.
Trade and monitor Hyperliquid perpetual futures. Check balances, view positions with P&L, place/cancel orders, execute market trades. Use when the user asks about Hyperliquid trading, portfolio status, crypto positions, or wants to execute trades on Hyperliquid.