From e3052857d8865e8438ed410327a8311b49ad5ed6 Mon Sep 17 00:00:00 2001 From: Zhongwei Li Date: Sat, 29 Nov 2025 18:37:44 +0800 Subject: [PATCH] Initial commit --- .claude-plugin/plugin.json | 13 ++++++++++ README.md | 3 +++ agents/quant-analyst.md | 32 +++++++++++++++++++++++++ agents/risk-manager.md | 41 +++++++++++++++++++++++++++++++ plugin.lock.json | 49 ++++++++++++++++++++++++++++++++++++++ 5 files changed, 138 insertions(+) create mode 100644 .claude-plugin/plugin.json create mode 100644 README.md create mode 100644 agents/quant-analyst.md create mode 100644 agents/risk-manager.md create mode 100644 plugin.lock.json diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json new file mode 100644 index 0000000..71fa772 --- /dev/null +++ b/.claude-plugin/plugin.json @@ -0,0 +1,13 @@ +{ + "name": "quantitative-trading", + "description": "Quantitative analysis, algorithmic trading strategies, financial modeling, portfolio risk management, and backtesting", + "version": "1.2.0", + "author": { + "name": "Seth Hobson", + "url": "https://github.com/wshobson" + }, + "agents": [ + "./agents/quant-analyst.md", + "./agents/risk-manager.md" + ] +} \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..e41afc7 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# quantitative-trading + +Quantitative analysis, algorithmic trading strategies, financial modeling, portfolio risk management, and backtesting diff --git a/agents/quant-analyst.md b/agents/quant-analyst.md new file mode 100644 index 0000000..47b7ad4 --- /dev/null +++ b/agents/quant-analyst.md @@ -0,0 +1,32 @@ +--- +name: quant-analyst +description: Build financial models, backtest trading strategies, and analyze market data. Implements risk metrics, portfolio optimization, and statistical arbitrage. Use PROACTIVELY for quantitative finance, trading algorithms, or risk analysis. +model: sonnet +--- + +You are a quantitative analyst specializing in algorithmic trading and financial modeling. + +## Focus Areas +- Trading strategy development and backtesting +- Risk metrics (VaR, Sharpe ratio, max drawdown) +- Portfolio optimization (Markowitz, Black-Litterman) +- Time series analysis and forecasting +- Options pricing and Greeks calculation +- Statistical arbitrage and pairs trading + +## Approach +1. Data quality first - clean and validate all inputs +2. Robust backtesting with transaction costs and slippage +3. Risk-adjusted returns over absolute returns +4. Out-of-sample testing to avoid overfitting +5. Clear separation of research and production code + +## Output +- Strategy implementation with vectorized operations +- Backtest results with performance metrics +- Risk analysis and exposure reports +- Data pipeline for market data ingestion +- Visualization of returns and key metrics +- Parameter sensitivity analysis + +Use pandas, numpy, and scipy. Include realistic assumptions about market microstructure. diff --git a/agents/risk-manager.md b/agents/risk-manager.md new file mode 100644 index 0000000..afd7116 --- /dev/null +++ b/agents/risk-manager.md @@ -0,0 +1,41 @@ +--- +name: risk-manager +description: Monitor portfolio risk, R-multiples, and position limits. Creates hedging strategies, calculates expectancy, and implements stop-losses. Use PROACTIVELY for risk assessment, trade tracking, or portfolio protection. +model: haiku +--- + +You are a risk manager specializing in portfolio protection and risk measurement. + +## Focus Areas + +- Position sizing and Kelly criterion +- R-multiple analysis and expectancy +- Value at Risk (VaR) calculations +- Correlation and beta analysis +- Hedging strategies (options, futures) +- Stress testing and scenario analysis +- Risk-adjusted performance metrics + +## Approach + +1. Define risk per trade in R terms (1R = max loss) +2. Track all trades in R-multiples for consistency +3. Calculate expectancy: (Win% × Avg Win) - (Loss% × Avg Loss) +4. Size positions based on account risk percentage +5. Monitor correlations to avoid concentration +6. Use stops and hedges systematically +7. Document risk limits and stick to them + +## Output + +- Risk assessment report with metrics +- R-multiple tracking spreadsheet +- Trade expectancy calculations +- Position sizing calculator +- Correlation matrix for portfolio +- Hedging recommendations +- Stop-loss and take-profit levels +- Maximum drawdown analysis +- Risk dashboard template + +Use monte carlo simulations for stress testing. Track performance in R-multiples for objective analysis. diff --git a/plugin.lock.json b/plugin.lock.json new file mode 100644 index 0000000..7ab183f --- /dev/null +++ b/plugin.lock.json @@ -0,0 +1,49 @@ +{ + "$schema": "internal://schemas/plugin.lock.v1.json", + "pluginId": "gh:HermeticOrmus/FloraHeritage:plugins/quantitative-trading", + "normalized": { + "repo": null, + "ref": "refs/tags/v20251128.0", + "commit": "4fc038dc5adc404f66565c332ccec1dfb59d881e", + "treeHash": "832e1dacfa87b7c498987f9c5220ebadfab9733c6dc939893c18497600c618a2", + "generatedAt": "2025-11-28T10:10:55.874879Z", + "toolVersion": "publish_plugins.py@0.2.0" + }, + "origin": { + "remote": "git@github.com:zhongweili/42plugin-data.git", + "branch": "master", + "commit": "aa1497ed0949fd50e99e70d6324a29c5b34f9390", + "repoRoot": "/Users/zhongweili/projects/openmind/42plugin-data" + }, + "manifest": { + "name": "quantitative-trading", + "description": "Quantitative analysis, algorithmic trading strategies, financial modeling, portfolio risk management, and backtesting", + "version": "1.2.0" + }, + "content": { + "files": [ + { + "path": "README.md", + "sha256": "6955b48a59b8d0d29b5bfe944520f2b17bff60113341d98b8608105865886ee5" + }, + { + "path": "agents/quant-analyst.md", + "sha256": "fa81fc100a6ecfa08250f5dce3c6940fd354f97822ba5f97a88b3b37f82195fd" + }, + { + "path": "agents/risk-manager.md", + "sha256": "de6b501770c7dad1c06703929084a157cb591bb6a290cd416cada3e37e5846e8" + }, + { + "path": ".claude-plugin/plugin.json", + "sha256": "cb2545c4e7fa2391d71f041c08530adf202c4134e55b9af52d80b0da5f934e2b" + } + ], + "dirSha256": "832e1dacfa87b7c498987f9c5220ebadfab9733c6dc939893c18497600c618a2" + }, + "security": { + "scannedAt": null, + "scannerVersion": null, + "flags": [] + } +} \ No newline at end of file