agentsclimarketplace

Portfolio risk

Skill LisonEvf/finance-skills/skills/trading/portfolio-risk

Analyzes portfolio risk and performance metrics. Computes Value at Risk (VaR), Sharpe ratio, Sortino ratio, beta, correlation matrices, drawdown analysis, and position sizing recommendations. Trigger when the user requests risk analysis, portfolio optimization, or performance attribution.From its SKILL.md

Install
npx -y skills add LisonEvf/finance-skills --skill portfolio-risk

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 2 stars2 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

1.9 KB, as published. Nobody here has run it

Portfolio Risk

Analyzes portfolio risk and recommends position sizing and diversification.

Real Code Reference

  • tradinglearn/backtest/backtester.py — Backtester._calculate_performance() computes Sharpe, max drawdown, win rate, total return, CAGR
  • tradinglearn/utils/parameter_optimizer.py — plot_optimization_results() heatmaps: return, Sharpe, drawdown, win rate
  • tradinglearn/pytdx2/backtest.py — BacktestEngine tracks per-trade P&L for risk analysis

Risk Metrics

  • VaR: historical simulation, parametric, Monte Carlo
  • CVaR (Expected Shortfall): average loss beyond VaR
  • Maximum Drawdown: peak-to-trough with recovery duration
  • Volatility: annualized std of returns

Performance Metrics

  • Sharpe Ratio: (R - Rf) / sigma
  • Sortino Ratio: downside-only volatility
  • Calmar Ratio: annual return / max drawdown
  • Information Ratio: active return / tracking error

Portfolio Analysis

  • Correlation matrix between holdings
  • Beta to market benchmark
  • Position concentration (Herfindahl index)
  • Risk parity weights

Usage

from backtest.backtester import Backtester

bt = Backtester(initial_capital=100000.0)
bt.run_backtest(data, MyStrategy, params)
perf = bt.get_performance()
# {'total_return': 0.15, 'annual_return': 0.12, 'sharpe_ratio': 1.2,
#  'max_drawdown': -0.08, 'win_rate': 0.55, 'total_trades': 42}
portfolio = bt.get_portfolio()
# DataFrame with: portfolio_value, position, cash, returns

Keep looking

Skills are one crate of 609,689. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.