Apply consistent financial formulas, data standards, and simulation rules for portfolio analysis.

Install

mkdir -p .claude/skills/finance-guide && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/15046" && unzip -o skill.zip -d .claude/skills/finance-guide && rm skill.zip

Installs to .claude/skills/finance-guide

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

This document defines financial conventions, formulas, and simulation rules. The goal is to ensure consistent, correct implementation of portfolio simulation, investment strategies, and performance metrics. Domain-specific financial logic, mathematical formulas, and backtesting conventions.
291 charsno explicit “when” triggerlonger than Claude Code's old 250-char listing cap (fine on current versions)
Advanced

Key capabilities

  • Process market data for time-series analysis
  • Calculate arithmetic and logarithmic returns
  • Compute Compound Annual Growth Rate (CAGR)
  • Determine annualized volatility and Sharpe Ratio
  • Calculate drawdowns from peak portfolio equity
  • Implement various investment strategies like trend following and dollar-cost averaging

How it works

The skill defines financial conventions and mathematical formulas for processing market data, modeling portfolios, and calculating performance and risk metrics, ensuring consistent and correct implementation.

Inputs & outputs

You give it
Market data, portfolio state, or investment signals
You get back
Calculated financial metrics (returns, volatility, Sharpe ratio, drawdown) or trading signals based on defined strategies

When to use finance-guide

  • Calculating portfolio performance metrics
  • Standardizing time-series market data
  • Implementing portfolio simulation logic

About this skill

1. Financial Data Standards

When processing market data for time-series analysis, the following conventions apply:

  • Primary Pricing: The "Adjusted Close" price is the gold standard as it accounts for corporate actions (splits, dividends).
  • Time Continuity: Data must be strictly chronological (ascending). Missing data points should be handled via "Forward Fill" (Last Observation Carried Forward) to preserve the integrity of technical indicators.
  • Look-ahead Bias: Calculations at time $t$ must never access data from $t+1$. Any "future leakage" invalidates the simulation.

2. Discrete-Time Portfolio Model

The portfolio state at any time step $t$ is defined by:

  • Cash Balance ($C_t$): Non-invested capital.
  • Asset Holdings ($S_t$): Quantity of the security held.
  • Portfolio Equity ($V_t$): $V_t = C_t + (S_t \times Price_t)$
  • Order Execution: Orders generated by a signal at the close of $t$ are traditionally executed at the close of $t$ (theoretical) or the open of $t+1$ (realistic).

3. Performance & Risk Mathematics

Return Metrics

  • Arithmetic Return: $R = \frac{V_{final} - V_{initial}}{V_{initial}}$
  • Logarithmic Return: $r_t = \ln(Price_t / Price_{t-1})$
  • Compound Annual Growth Rate (CAGR): $CAGR = \left( \frac{V_{final}}{V_{initial}} \right)^{\frac{1}{\text{years}}} - 1$

Risk Analytics

  • Annualized Volatility ($\sigma$): $\sigma_{ann} = \text{std}(r_{daily}) \times \sqrt{252}$
  • Sharpe Ratio: $S = \frac{\text{mean}(r_{daily})}{\text{std}(r_{daily})} \times \sqrt{252}$ (Assuming a risk-free rate of 0).
  • Drawdown ($DD_t$): The percentage decline from the running peak: $DD_t = \frac{V_t - \text{Peak}_t}{\text{Peak}_t}$ where $\text{Peak}_t = \max(V_0 \dots V_t)$

4. Universal Strategy Logic Patterns

4.1 Passive Allocation (Buy & Hold)

  • Logic: Full capital deployment at $t_0$. No rebalancing or exit signals.

4.2 Trend Following (Moving Average Crossover)

  • Logic: Dual-window calculation.
  • Signal: A "Golden Cross" (Short-term MA crosses above Long-term MA) triggers a Buy; a "Death Cross" (Short-term MA crosses below Long-term MA) triggers a Sell/Exit.

4.3 Systematic Accumulation (Dollar-Cost Averaging)

  • Logic: Periodic capital injection ($C_{inject}$) at fixed intervals (weekly/monthly/quarterly) regardless of price.
  • Share Acquisition: $S_{new} = S_{old} + \frac{C_{inject}}{Price_t}$

4.4 Momentum / Mean Reversion (RSI)

  • Logic: Relative Strength Index calculation over $n$ periods.
  • Signal: Buy when RSI < 30 (Oversold); Sell when RSI > 70 (Overbought).

4.5 Volatility Breakout (Bollinger Bands)

  • Logic: Price relation to standard deviation bands $(\mu \pm 2\sigma)$.
  • Signal: Buy/Sell triggered by price penetration of the upper or lower boundaries.

5. Trading Statistics & Quality Control

  • Win Rate: Ratio of profitable trades to total closed trades.
  • Profit Factor: Gross profits divided by gross losses.
  • Time in Market: Percentage of the total duration where $S_t > 0$.
  • Numerical Stability: Use 64-bit float precision; handle zero-volatility cases to avoid NaN results in Sharpe calculations.

When not to use it

  • When calculations at time 't' need to access data from 't+1'
  • When using data that is not strictly chronological

Limitations

  • Calculations at time 't' must not access data from 't+1'
  • Data must be strictly chronological
  • Missing data points should be handled via Forward Fill

How it compares

This skill provides standardized formulas and conventions for financial calculations, preventing common errors like look-ahead bias and ensuring numerical stability, unlike ad-hoc implementations.

Compared to similar skills

finance-guide side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
finance-guide (this skill)05moNo flagsAdvanced
quant-analyst1033moNo flagsAdvanced
stock-analyzer712moReviewBeginner
creating-financial-models368moReviewAdvanced

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

quant-analyst

zenobi-us

Expert quantitative analyst specializing in financial modeling, algorithmic trading, and risk analytics. Masters statistical methods, derivatives pricing, and high-frequency trading with focus on mathematical rigor, performance optimization, and profitable strategy development.

103355

stock-analyzer

FrancyJGLisboa

Provides comprehensive technical analysis for stocks and ETFs using RSI, MACD, Bollinger Bands, and other indicators. Activates when user requests stock analysis, technical indicators, trading signals, or market data for specific ticker symbols.

71214

creating-financial-models

anthropics

This skill provides an advanced financial modeling suite with DCF analysis, sensitivity testing, Monte Carlo simulations, and scenario planning for investment decisions

36161

reconciliation

anthropics

Reconcile accounts by comparing GL balances to subledgers, bank statements, or third-party data. Use when performing bank reconciliations, GL-to-subledger recs, intercompany reconciliations, or identifying and categorizing reconciling items.

30139

analyzing-financial-statements

anthropics

This skill calculates key financial ratios and metrics from financial statement data for investment analysis

32134

us-stock-analysis

tradermonty

Comprehensive US stock analysis including fundamental analysis (financial metrics, business quality, valuation), technical analysis (indicators, chart patterns, support/resistance), stock comparisons, and investment report generation. Use when user requests analysis of US stock tickers (e.g., "analyze AAPL", "compare TSLA vs NVDA", "give me a report on Microsoft"), evaluation of financial metrics, technical chart analysis, or investment recommendations for American stocks.

24137

Search skills

Search the agent skills registry