Quant Trading CN
量化交易专家 - 基于印度股市实战经验,支持策略生成、回测、实盘交易(Zerodha/A股适配)
MIT-0 · Free to use, modify, and redistribute. No attribution required.
⭐ 1 · 2.7k · 21 current installs · 22 all-time installs
byGuohongbin@guohongbin-git
MIT-0
Security Scan
OpenClaw
Suspicious
high confidencePurpose & Capability
Name/description promise: generate strategies, backtest, and run live trading (Zerodha/A-share). Declared requirements: only 'python3', no env vars or credentials. SKILL.md and README instruct how to run a wizard, fetch universes, and — critically — create a .env with KITE_API_KEY/KITE_API_SECRET/KITE_ACCESS_TOKEN for live trading. The metadata omits these sensitive env vars, and the skill bundle does not include the runtime scripts it tells you to run. Asking for Zerodha credentials is coherent with live-trading functionality, but the omission in requires.env and the absence of the referenced scripts in the package are inconsistent and suspicious.
Instruction Scope
The SKILL.md tells the agent/user to run ./scripts/wizard.sh which 'scans current directory for trading code', run check-code to analyze and optionally modify user code, fetch live index constituents from NSE, and to create/use .env files containing API keys. These instructions therefore: (a) require access to local files and may modify user code if the wizard applies fixes; (b) request and use sensitive API credentials for live trading; and (c) instruct network operations (NSE, Kite API). None of this is declared in the skill metadata. The instructions also reference scripts and files (scripts/) that are not included in the packaged files, so following them as-is would either fail or pull external code first — a potentially risky step.
Install Mechanism
The skill is instruction-only (no install spec), which is low-risk by itself. However the README/SKILL.md explicitly recommend cloning an external GitHub repo (javajack/skill-algotrader), running start.sh, creating a venv, and pip installing requirements.txt. Those recommended steps would download and run arbitrary external code not vetted here. The package as published does not include the scripts it references, so the user would likely be directed to fetch remote code before the advertised functionality works — this raises moderate risk.
Credentials
Declared required env vars: none. But instructions show the skill expects Zerodha credentials (KITE_API_KEY, KITE_API_SECRET, KITE_ACCESS_TOKEN) and advises creating a .env with those secrets. That is a direct mismatch: the skill will need sensitive keys for live trading, yet does not declare them as required. The skill asks to access the user's filesystem (scanning directories) and to possibly store credentials in a .env file. Requesting or handling live-trading API keys is reasonable for live execution, but failing to declare this in metadata is an important discrepancy for security review.
Persistence & Privilege
The skill does not request 'always: true' nor bundle executable code that would be installed persistently. It is instruction-only, so on its face it does not gain permanent platform privileges. However the runtime instructions encourage cloning and running an external repository and running scripts that can modify user files (the wizard claims it can 'apply fixes automatically'), which means following the skill's guidance could result in arbitrary changes to the user's workspace. This is an operational risk but not a declared persistence privilege in the skill manifest.
What to consider before installing
This skill looks like a genuine trading guide but has important mismatches and missing pieces. Before installing or running anything: 1) Do not paste your Zerodha/API secrets into chat — the skill did not declare them in metadata even though its README instructs creating a .env with KITE_API_KEY/KITE_API_SECRET/KITE_ACCESS_TOKEN. 2) The SKILL.md references ./scripts/*.sh and other files that are not present in the packaged bundle; the README suggests cloning an external GitHub repo — review that repo and its scripts manually before running them. 3) If you plan to use live trading, use a paper trading or limited-permission API key, rotate keys after testing, and never reuse production credentials. 4) Expect the wizard to scan and potentially modify files in your current directory; back up your code first and run the tool in an isolated environment (container or VM). 5) If you want to proceed, ask the publisher for clarity (origin, full repo, and which scripts are missing) and inspect requirements.txt/start.sh and any scripts for network calls, telemetry, or unexpected behavior before executing. Given the metadata/instruction discrepancies, avoid running any automatically-applied fixes or start scripts until you verify the external code.Like a lobster shell, security has layers — review code before you run it.
Current versionv1.0.0
Download zipfinancelatestquanttrading
License
MIT-0
Free to use, modify, and redistribute. No attribution required.
Runtime requirements
📈 Clawdis
Binspython3
SKILL.md
量化交易专家
基于 1780 行印度股市实战经验的量化交易系统。
功能
🎯 交互式机器人生成向导
# 启动向导
./scripts/wizard.sh
# 选择:
# 1. 从头生成交易机器人
# 2. 增强现有代码(修复问题、优化)
# 3. 从实时指数数据创建股票池
# 4. 运行回测对比
# 5. 分析表现
📊 16 个知识领域
- Zerodha 集成 - Tick size 四舍五入、仓位对账、止损生命周期
- 回测-实盘一致性 - 数据缓存、T vs T-1 对齐、VWAP 重置
- 信号生成 - Fortress 信号(65% 胜率)、多因子确认
- 调仓逻辑 - 周频 vs 日频、交易成本建模
- 股票池选择 - 流动性过滤、动量评分
- 性能优化 - Parquet(28x)、Polars 向量化(37x)
- 印度市场特性 - 交易时段、熔断机制、T+1 结算
- 失败模式 - 5 个生产问题 + 修复
- 指标公式 - RSI、MACD、ATR、ADX、VWAP、EMA
- 多时间框架 - 日内 vs 波段、MTF 对齐
- 日志可观测 - 结构化日志、实时监控
- 交易后分析 - P&L 分解、夏普比率、回撤分析
- 信号归因 - 追踪哪个指标触发
- 退出策略 - 时间衰减、追踪止损、部分退出
- 风险管理 - Kelly Criterion、组合热度
- 资金复利 - 市场状态检测、牛市放大
⚠️ 30+ 常见陷阱
🔥 关键: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
向导会问:
- 交易风格:日内、波段、持仓
- 股票池:Nifty 50、中盘、自定义
- 策略:动量、VWAP 回调、开盘突破
- 资金:起始资金和单笔风险
- 风险偏好:保守(0.5%)、平衡(1%)、激进(2%)
获取股票池
# 从 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 股:
| 印度 | 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
Files
6 totalSelect a file
Select a file to preview.
Comments
Loading comments…
