소스 정보
- 저장소
- tools-only/X-Skills
- 최근 소스 활동
- 2026년 2월 9일 04:32
- 감지된 SKILL.md 언어
- 영어
- 스타
- 7
- 포크
- 1
설치 방법
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
소스 파일 검토
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
메뉴
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/tools-only/X-Skills --skill openbb-portfolio명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
Index of Build Systems Skills
Coordination patterns for distributed dataflow systems including barriers, epochs, and distributed snapshots
Windowing, sessionization, time-series aggregation, and late data handling for streaming systems
SOC 직업 분류 기준
SKILL.md 표시 중
| name | openbb-portfolio |
| description | Portfolio analysis and optimization using OpenBB - performance tracking,... |
Comprehensive portfolio management and optimization using OpenBB Platform.
/openbb-portfolio [--analyze] [--optimize] [--benchmark SPY]
Analyzes portfolio performance, calculates risk metrics, and provides optimization recommendations.
from openbb import obb
import pandas as pd
# Define portfolio (can load from file or define inline)
portfolio = {
"AAPL": {"shares": 50, "cost_basis": 150.00},
"MSFT": {"shares": 30, "cost_basis": 300.00},
"GOOGL": {"shares": 20, "cost_basis": 2500.00},
"BTC-USD": {"shares": 0.5, "cost_basis": 45000.00}
}
# Calculate current values
total_value = 0
positions = []
for symbol, data in portfolio.items():
current_price = obb.equity.price.quote(symbol=symbol).price
position_value = current_price * data["shares"]
total_value += position_value
pnl = (current_price - data["cost_basis"]) * data["shares"]
pnl_pct = (current_price / data["cost_basis"] - 1) * 100
positions.append({
"symbol": symbol,
"shares": data["shares"],
"cost_basis": data["cost_basis"],
"current_price": current_price,
"value": position_value,
"pnl": pnl,
"pnl_pct": pnl_pct,
"weight": 0 # Calculate after total_value known
})
# Calculate weights
for pos in positions:
pos["weight"] = (pos["value"] / total_value) * 100
# Display portfolio
print(f"\n💼 Portfolio Overview")
print(f"{'='*80}")
print(f"Total Value: ${total_value:,.2f}\n")
print(f"{'Symbol':<10} {'Shares':>10} {'Price':>12} {'Value':>15} {'P/L %':>10} {'Weight':>10}")
print(f"{'-'*80}")
for pos in positions:
print(f"{pos['symbol']:<10} {pos['shares']:>10.2f} ${pos['current_price']:>11.2f} "
f"${pos['value']:>14.2f} {pos['pnl_pct']:>9.1f}% {pos['weight']:>9.1f}%")
# Calculate portfolio-level risk metrics
returns = []
for symbol in portfolio.keys():
hist = obb.equity.price.historical(symbol=symbol, period="1y")
returns.append(hist.to_dataframe()['close'].pct_change())
portfolio_returns = pd.concat(returns, axis=1).mean(axis=1)
portfolio_vol = portfolio_returns.std() * (252 ** 0.5) * 100 # Annualized
# Sharpe Ratio (assuming 4% risk-free rate)
risk_free_rate = 0.04
sharpe = (portfolio_returns.mean() * 252 - risk_free_rate) / (portfolio_returns.std() * (252 ** 0.5))
# Max Drawdown
cumulative = (1 + portfolio_returns).cumprod()
running_max = cumulative.expanding().max()
drawdown = (cumulative - running_max) / running_max
max_dd = drawdown.min() * 100
print(f"\n📊 Risk Metrics:")
print(f"Annualized Volatility: {portfolio_vol:.2f}%")
print(f"Sharpe Ratio: {sharpe:.2f}")
print(f"Max Drawdown: {max_dd:.2f}%")
print(f"\n🎯 Optimization Recommendations:")
# Diversification score
diversification = 100 - max([pos['weight'] for pos in positions])
print(f"Diversification Score: {diversification:.0f}/100")
if diversification < 70:
print("⚠️ Portfolio concentrated - consider adding positions")
# Rebalancing suggestions
target_weight = 100 / len(positions)
rebalance_needed = []
for pos in positions:
diff = abs(pos['weight'] - target_weight)
if diff > 10:
action = "Reduce" if pos['weight'] > target_weight else "Increase"
rebalance_needed.append(f"{action} {pos['symbol']}: {pos['weight']:.1f}% → {target_weight:.1f}%")
if rebalance_needed:
print(f"\n🔄 Rebalancing Suggestions:")
for suggestion in rebalance_needed:
print(f" • {suggestion}")
# Analyze current portfolio
/openbb-portfolio --analyze
# Optimize allocation
/openbb-portfolio --optimize
# Compare to SPY benchmark
/openbb-portfolio --benchmark=SPY