asset-allocation
यह क्या करती है
यह स्किल पैसे को संपत्तियों में बाँटने के मुख्य तरीके और अंतर्निहित पोर्टफ़ोलियो ऑप्टिमाइज़र चलाने का तरीका समझाती है। यह उन निवेशकों और विश्लेषकों के लिए है जो आवंटन सिद्धांत समझना और उसे लागू करना चाहते हैं।
कब इस्तेमाल करें
- ✓जब आप किसी साफ़ तरीके से पोर्टफ़ोलियो को कई संपत्तियों में बाँटना चाहें।
- ✓जब आप बाज़ार के विचारों को आधार आवंटन के साथ मिलाना चाहें।
- ✓जब आप ऑप्टिमाइज़र इस्तेमाल करके नतीजा कॉन्फ़िग फ़ाइल में सहेजना चाहें।
Skill का लिंक
https://github.com/HKUDS/Vibe-Trading/blob/main/agent/src/skills/asset-allocation/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“इन पाँच ETF के लिए जोखिम-संतुलित आवंटन बनाइए, तरीका समझाइए, और वज़न कॉन्फ़िग फ़ाइल में लिख दीजिए।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
एजेंट चुने गए तरीके को समझाता है, जैसे मीन-वेरियंस या रिस्क बजट, उसकी ताकत और कमज़ोरी सहित। फिर वह आपकी शर्तों के साथ मेल खाता ऑप्टिमाइज़र चलाता है और नतीजे के वज़न कॉन्फ़िगरेशन फ़ाइल में लिखता है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
Asset Allocation and Portfolio Optimization
Overview
From asset allocation theory to practical implementation, this skill covers classical frameworks (MPT, BL, risk budgeting, all-weather) and the usage of the four optimizers built into this system. The output can be written directly into config.json.
Asset Allocation Theory
1. Modern Portfolio Theory (MPT, Markowitz)
Core idea: maximize expected return for a given level of risk (the efficient frontier).
Optimization problem:
min w'Σw (portfolio variance)
s.t. w'μ = target_return
Σw = 1
w ≥ 0 (no shorting)
| Advantages | Disadvantages |
|---|---|
| Mathematically rigorous | Extremely sensitive to inputs (garbage in, garbage out) |
| Efficient frontier is visualizable | Concentrated-allocation problem (often produces extreme weights) |
| Foundational framework | Assumes normality and ignores fat tails |
Practical advice: do not use raw MPT directly. Add constraints (upper/lower bounds, sector limits) or use a regularized version.
2. Black-Litterman Model
Core idea: start from market equilibrium and incorporate investor views.
Steps:
1. Reverse-imply market equilibrium returns: π = δΣw_mkt
2. Build the view matrices: P (selection matrix), Q (view returns), Ω (view uncertainty)
3. Blend the posterior: μ_BL = [(τΣ)^-1 + P'Ω^-1 P]^-1 [(τΣ)^-1 π + P'Ω^-1 Q]
4. Run Markowitz optimization using posterior μ_BL
Example views:
- Absolute view: "China A-shares will return 10% over the next year" →
P=[1,0,0], Q=[0.10] - Relative view: "China A-shares will outperform US equities by 5%" →
P=[1,-1,0], Q=[0.05]
Parameter guidance:
τ(uncertainty scaling):0.025-0.05Ω: set according to view confidence, where higher confidence = smaller variance
3. Risk Budgeting
Core idea: allocate by risk contribution rather than by capital share.
Risk contribution: RC_i = w_i × (Σw)_i / σ_p
Target: RC_i / σ_p = budget_i (for all i)
| Strategy | Risk Budget | Best Use Case |
|---|---|---|
| Equal risk contribution | Each asset 1/N | When you do not know which asset is best |
| Equity-tilted risk budget | Stocks 60%, bonds 30%, commodities 10% | When you want equities to contribute more risk |
| Dynamic risk budget | Adjust dynamically by signal strength | When you have market-timing ability |
4. All-Weather Strategy
Bridgewater framework: allocate risk equally across economic environments.
Economic environment Asset allocation
───────── ─────────
Growth rising Equities + commodities + corporate bonds
Growth falling Government bonds + inflation-protected bonds
Inflation rising Commodities + inflation-protected bonds + EM debt
Inflation falling Equities + government bonds
Simplified allocation example for China-focused portfolios:
- 30% CSI 300 / CSI 500
- 40% government bonds / credit bonds
- 15% gold
- 15% commodities / REITs
Guide to the 5 Optimizers
Overview of the Built-In Optimizers
Configure them in config.json through optimizer and optimizer_params:
| optimizer | Display Name | Core Idea | Best Use Case |
|---|---|---|---|
equal_volatility |
Equal Volatility | Allocate weights by inverse volatility | Simple and effective baseline |
risk_parity |
Risk Parity | Equalize risk contribution while accounting for correlation | Long-term robust allocation |
mean_variance |
Mean-Variance | Maximize Sharpe ratio or minimize variance | When return forecasts are available |
max_diversification |
Maximum Diversification | Maximize the diversification ratio | When pursuing a low-correlation portfolio |
turnover_aware |
Turnover-Aware | Mean-variance utility with an L1 penalty on weight changes vs the previous rebalance | When trading costs matter; tune turnover_penalty to your data frequency |
1. equal_volatility
{
"optimizer": "equal_volatility",
"optimizer_params": {
"lookback": 60
}
}
Principle: w_i = (1/σ_i) / Σ(1/σ_j)
| Parameter | Default | Description |
|---|---|---|
| lookback | 60 | Volatility calculation window (trading days) |
Advantages: simple and fast, no return forecast required, no correlation matrix required.
Disadvantages: ignores cross-asset correlation.
2. risk_parity
{
"optimizer": "risk_parity",
"optimizer_params": {
"
अक्सर पूछे जाने वाले सवाल
क्या कच्चा मीन-वेरियंस ऑप्टिमाइज़ेशन काफ़ी है?
स्किल इसे अकेले इस्तेमाल करने के खिलाफ़ चेताती है, क्योंकि नतीजे इनपुट के प्रति बहुत संवेदनशील होते हैं, और शर्तें जोड़ने की सलाह देती है।
ब्लैक-लिटरमैन क्या है?
यह बाज़ार के आधार से शुरू होता है और उसे आपके खास संपत्तियों पर विचारों से समायोजित करता है।
क्या वज़न सीधे इस्तेमाल किए जा सकते हैं?
उन्हें कॉन्फ़िग फ़ाइल में लिखा जा सकता है, पर किसी असली उपयोग से पहले उनकी समीक्षा होनी चाहिए।
जानकारी
लेखक का मूल विवरण
Asset allocation theory and optimizer usage — MPT / Black-Litterman / risk budgeting / all-weather strategy, including guides for 5 optimizers and rebalancing rules.
repo: HKUDS/Vibe-Trading
लोकप्रियता
- GitHub स्टार
- 37k
- रैंकिंग में स्थान
- #7498
- लाइसेंस
- MIT
- अपडेट की गई
- 1/11/2026
कमेंट
- …
इस repository की और skills
vibe-trading
37kयह आपके एजेंट को वित्त शोध का पूरा टूलकिट देती है, जिसमें बैकटेस्ट, फ़ैक्टर एनालिसिस, ऑप्शन प्राइसिंग और कई बाज़ारों का डेटा शामिल है।
adr-hshare
37kयह आपके एजेंट को दिखाती है कि कई बाज़ारों में लिस्टेड एक चीनी कंपनी के भाव की तुलना कैसे करें, जैसे अमेरिकी ADR और हॉन्गकॉन्ग शेयर।
akshare
37kयह आपके एजेंट को चीनी और वैश्विक शेयरों, फ़्यूचर्स, फ़ॉरेक्स और आर्थिक संकेतकों का मुफ़्त बाज़ार डेटा लेने देती है, बिना API key के।
alpha-zoo
37kयह आपके एजेंट को बने-बनाए स्टॉक फ़ैक्टरों की लाइब्रेरी देखने और चुने हुए बाज़ार पर उनके पूरे समूह के रिटर्न की भविष्यवाणी की क्षमता जाँचने देती है।
मिलती-जुलती skills
gitcrawl
394kयह आपके एजेंट को GitHub issues और pull requests के सेव आर्काइव में खोजने, मिलते-जुलते मामलों को समूह में रखने और लाइव स्थिति जांचने देती है।
slacrawl
394kयह आपके एजेंट को स्थानीय Slack आर्काइव में संदेश खोजने और गिनने, उसकी ताज़गी जांचने और ज़रूरत पड़ने पर उसे ताज़ा करने देती है।
goplaces
394kयह आपके एजेंट को Google Places से जगहें खोजने, उनका विवरण और समीक्षाएं पाने, और जगह के नाम हल करने में मदद करती है, स्क्रिप्ट के लिए JSON आउटपुट के साथ।