Technical Analyst
tradermonty/claude-trading-skills
This skill should be used when analyzing weekly price charts for stocks, stock indices, cryptocurrencies, or forex pairs.
Compute and compare investment return metrics including TWR, MWR (dollar-weighted IRR on portfolio cash flows), CAGR, and annualized returns.
$ npx skills add JoelLewis/finance_skills --skill return-calculations -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install JoelLewis/finance_skills return-calculations --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/JoelLewis/finance_skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/core/skills/return-calculations .claude/skills/return-calculations && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "return-calculations" agent skill from https://github.com/JoelLewis/finance_skills/tree/main/plugins/core/skills/return-calculations into .claude/skills/return-calculations/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "return-calculations", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/JoelLewis/finance_skills/tree/main/plugins/core/skills/return-calculationsType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add JoelLewis/finance_skills --skill return-calculations -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install JoelLewis/finance_skills return-calculations --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/JoelLewis/finance_skills.git skills-src && mkdir -p .agents/skills && cp -r skills-src/plugins/core/skills/return-calculations .agents/skills/return-calculations && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "return-calculations" agent skill from https://github.com/JoelLewis/finance_skills/tree/main/plugins/core/skills/return-calculations into .agents/skills/return-calculations/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "return-calculations", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add JoelLewis/finance_skills --skill return-calculations -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install JoelLewis/finance_skills return-calculations --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/JoelLewis/finance_skills.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/plugins/core/skills/return-calculations .cursor/skills/return-calculations && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "return-calculations" agent skill from https://github.com/JoelLewis/finance_skills/tree/main/plugins/core/skills/return-calculations into .cursor/skills/return-calculations/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "return-calculations", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/JoelLewis/finance_skills.git --path plugins/core/skills/return-calculations--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add JoelLewis/finance_skills --skill return-calculations -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install JoelLewis/finance_skills return-calculations --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/JoelLewis/finance_skills.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/plugins/core/skills/return-calculations .gemini/skills/return-calculations && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "return-calculations" agent skill from https://github.com/JoelLewis/finance_skills/tree/main/plugins/core/skills/return-calculations into .gemini/skills/return-calculations/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "return-calculations", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install JoelLewis/finance_skills return-calculationsInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add JoelLewis/finance_skills --skill return-calculations -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/JoelLewis/finance_skills.git skills-src && mkdir -p .github/skills && cp -r skills-src/plugins/core/skills/return-calculations .github/skills/return-calculations && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "return-calculations" agent skill from https://github.com/JoelLewis/finance_skills/tree/main/plugins/core/skills/return-calculations into .github/skills/return-calculations/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "return-calculations", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add JoelLewis/finance_skills --skill return-calculations -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install JoelLewis/finance_skills return-calculations --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/JoelLewis/finance_skills.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/plugins/core/skills/return-calculations .opencode/skills/return-calculations && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "return-calculations" agent skill from https://github.com/JoelLewis/finance_skills/tree/main/plugins/core/skills/return-calculations into .opencode/skills/return-calculations/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "return-calculations", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
return-calculationsCompute and compare investment return metrics including TWR, MWR (dollar-weighted IRR on portfolio cash flows), CAGR, and annualized returns.
Return Calculations is an agent skill from JoelLewis/finance_skills. Compute and compare investment return metrics including TWR, MWR (dollar-weighted IRR on portfolio cash flows), CAGR, and annualized returns. Use when the user asks about portfolio performance calculation, comparing manager returns, linking sub-period returns, understanding why different return methods give different numbers, converting returns across time periods, or computing the IRR of an investor's own contributions and withdrawals. Also trigger when users mention 'how much did I make', 'annual return'…
Its SKILL.md is about 2.2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including scripts (for example `scripts/return_calculations.py`).
It sits in Business, Finance & HR. The repository describes itself as: Claude Code skill plugins for financial services — 81 skills across 7 domain plugins covering investment management, compliance, advisory practice, trading, and operations. The licence is MIT.
Read from SKILL.md and the folder at commit 5c498ea. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Ships 1 file in scripts/ (Python), which the agent can run.
Shell commands in SKILL.md call:
uvpython3From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md. Its commands use uv, which can reach the network depending on how they are called.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Return Calculations loads about 2.2k tokens when it runs. Until then it costs about 207 tokens; SKILL.md has 935 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.
The full file from JoelLewis/finance_skills at commit 5c498ea, republished under its MIT licence (© JoelLewis). 935 words, ~2,154 tokens.
.claude/skills/return-calculations/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.$$R = \frac{V_{end} - V_{begin} + D}{V_{begin}}$$
where D = distributions (dividends, interest) received during the period. If V_end already reflects reinvested distributions, do not add D again.
R_a = (1/n) * sum(R_i) — unbiased estimate of the expected single-period return (use for forward-looking inputs, e.g., mean-variance optimization). Always >= geometric mean; overstates realized compound growth.R_g = [prod(1 + R_i)]^(1/n) - 1 — the correct measure of realized multi-period compound growth. The gap below the arithmetic mean approximates sigma^2 / 2 (volatility drag).r = ln(V_end / V_begin) — time-additive (r_total = r_1 + ... + r_n), so preferred for statistical modeling and multi-period aggregation. Convert with R_simple = e^r - 1 and r = ln(1 + R_simple). Log returns are additive across time but NOT across assets.$$CAGR = \left(\frac{V_{end}}{V_{begin}}\right)^{1/n} - 1$$
where n is measured in years. The annualized geometric growth rate between two valuations with no intermediate cash flows.
Chain-links sub-period returns calculated between each external cash flow, removing the effect of cash flow timing. TWR measures the manager's investment skill independent of investor deposit/withdrawal decisions, and is the GIPS standard for manager performance.
$$1 + R_{TWR} = \prod_{i=1}^{n}(1 + R_i), \qquad R_i = \frac{V_{end,i}}{V_{begin,i} + CF_i} - 1$$
Exact TWR requires a portfolio valuation on every cash flow date.
When valuations on each cash flow date are unavailable, Modified Dietz approximates the period return by day-weighting each external cash flow within the period:
$$R_{MD} = \frac{V_{end} - V_{begin} - CF_{net}}{V_{begin} + \sum_i CF_i \times w_i}, \qquad w_i = \frac{CD - D_i}{CD}$$
where CF_net = sum of external cash flows, CD = calendar days in the period, and D_i = day of flow i (so w_i is the fraction of the period the flow was invested). It is a money-weighted approximation; chain-linking Modified Dietz sub-period returns approximates TWR. Accuracy degrades when flows are large relative to portfolio value or markets are volatile within the period — revalue on large-flow dates instead.
The internal rate of return that sets the NPV of all investor cash flows (contributions, withdrawals, and terminal value) to zero:
$$0 = \sum_{t=0}^{T} \frac{CF_t}{(1 + r)^t}$$
MWR reflects the actual investor experience because it is sensitive to the timing and magnitude of cash flows. Solved numerically (Newton-Raphson or bisection).
$$R_{annual} = (1 + R_{period})^{periods_per_year} - 1$$
For example, a 2% quarterly return annualizes to (1.02)^4 - 1 = 8.24%.
$$(1 + R_{total}) = \prod_{i=1}^{n}(1 + R_i)$$
The foundational identity behind TWR and CAGR.
Given: An investment of $10,000 grows to $16,105.10 over exactly 5 years with no intermediate cash flows.
Calculate: The compound annual growth rate (CAGR).
Solution:
CAGR = (V_end / V_begin)^(1/n) - 1
CAGR = (16,105.10 / 10,000)^(1/5) - 1
CAGR = (1.610510)^(0.2) - 1
CAGR = 1.10 - 1
CAGR = 0.10 = 10%The investment grew at a compound annual rate of 10% per year.
Verification: $10,000 * (1.10)^5 = $10,000 * 1.61051 = $16,105.10
Given: A fund has the following history:
Calculate: Both TWR and MWR, and explain the divergence.
Solution:
Time-Weighted Return (TWR):
Sub-period 1 return: R_1 = (120,000 - 100,000) / 100,000 = +20%
Sub-period 2 return: R_2 = (198,000 - 220,000) / 220,000 = -10%
TWR (cumulative) = (1 + 0.20) * (1 + (-0.10)) - 1
= 1.20 * 0.90 - 1
= 1.08 - 1
= +8.0%
TWR (annualized) = (1.08)^(1/2) - 1 = 3.92%Money-Weighted Return (MWR / IRR): Cash flows from the investor's perspective:
Solve: -100,000 + (-100,000)/(1+r) + 198,000/(1+r)^2 = 0
This is quadratic in x = 1/(1+r); the positive root gives r = -0.66815% (verifiable with the bundled script or any IRR solver).
NPV check at r = -0.0066815:
-100,000 + (-100,000)/0.9933185 + 198,000/0.9933185^2
= -100,000 - 100,672.65 + 200,672.65
= 0.00 (exact)The MWR is approximately -0.67% annualized.
Interpretation: The TWR of +3.92% annualized reflects the manager's skill: the fund gained 20% then lost 10%, netting +8% over two years. The MWR of approximately -0.67% reflects the investor's experience: more money was at risk during the losing year (Year 2) because of the large deposit, so the investor's dollar-weighted outcome was slightly negative. This divergence highlights why TWR is preferred for evaluating manager performance, while MWR better describes the specific investor's realized result.
(1.02)^52 - 1 = 180%, which amplifies noise and is misleading. Annualization is most meaningful for periods of at least one year.V_end already includes reinvested dividends, do not add D separately in the holding period return formula.scripts/return_calculations.py provides a Returns class with static methods for every formula above (holding period return, TWR, MWR/IRR via Newton's method, Modified Dietz is straightforward to compose from these, CAGR, annualization, linking, arithmetic/geometric means, log-return conversions).
uv run scripts/return_calculations.py (PEP 723 inline metadata resolves numpy automatically), or python3 scripts/return_calculations.py with numpy installed.--verify) prints a demo of all functions and asserts the worked-example values above (Example 1 CAGR = 10%, Example 2 TWR = +8.0% cumulative / 3.92% annualized, MWR = -0.6682%), exiting nonzero on any mismatch.--help lists the available functions and import usage.from return_calculations import Returns.© JoelLewis, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 1 other file (scripts) in plugins/core/skills/return-calculations of JoelLewis/finance_skills.
Open the folder on GitHubat commit 5c498ea
Return Calculations next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Return Calculations this skillJoelLewis/finance_skills | 205 | — | ~2.2k | Automated safety check: Pass | MIT | |
| Technical Analysttradermonty/claude-trading-skills | 3k | 4 repos | ~4.6k | Automated safety check: Pass | MIT | |
| Theme Detectortradermonty/claude-trading-skills | 3k | 2 repos | ~4.9k | Automated safety check: Pass | MIT | |
| Creating Financial ModelsChen-zexi/open-ptc-agent | 729 | 3 repos | ~1.3k | Automated safety check: Pass | MIT | |
| Stock APIzhangxiangliang/stock-api | 2k | — | ~507 | Automated safety check: Pass | MIT | |
| Itr Walakaranb192/itr-wala | 871 | — | ~3.6k | Automated safety check: Pass | MIT |
tradermonty/claude-trading-skills
This skill should be used when analyzing weekly price charts for stocks, stock indices, cryptocurrencies, or forex pairs.
tradermonty/claude-trading-skills
Detect and analyze trending market themes across sectors. An agent skill from tradermonty/claude-trading-skills.
Chen-zexi/open-ptc-agent
This skill provides an advanced financial modeling suite with DCF analysis, sensitivity testing, Monte Carlo simulations, and scenario planning for investment decisions
zhangxiangliang/stock-api
Fetch real-time stock quotes, K-line (candlestick) history, and search symbols for China A-shares, Hong Kong, and US markets.
karanb192/itr-wala
File Indian income tax returns (ITR) for FY 2025-26 / AY 2026-27.
zillionare/zillionare
面向中文自然语言的 Tushare 数据研究技能。用于把“看看这只股票最近怎么样”“帮我查财报趋势”“最近哪个板块最强”“北向资金在买什么”“给我导出一份行情数据”这类请求,转成可执行的数据获取、清洗、对比、筛选、导出与简要分析流程。适用于 A 股、指数、ETF/基金、财务、估值、资金流、公告新闻、板块概念与宏观数据等研究场景。
JoelLewis/finance_skills
Determine how to distribute capital across asset classes using strategic and tactical allocation frameworks.
JoelLewis/finance_skills
Determine how much capital to allocate to individual positions within a portfolio.
JoelLewis/finance_skills
Analyze commodity markets including futures curve dynamics, roll yield, and supply/demand fundamentals.
JoelLewis/finance_skills
Analyze currency markets, exchange rate mechanics, and FX risk management for international portfolios.
JoelLewis/finance_skills
Provide frameworks for managing and paying off personal debt effectively.
JoelLewis/finance_skills
Build diversified portfolios using correlation analysis, efficient frontier construction, and factor-based diversification.
Categories
Compute and compare investment return metrics including TWR, MWR (dollar-weighted IRR on portfolio cash flows), CAGR, and annualized returns. Return Calculations is an agent skill from JoelLewis/finance_skills. Compute and compare investment return metrics including TWR, MWR (dollar-weighted IRR on portfolio cash flows), CAGR, and annualized returns.
Return Calculations fits situations like: the user asks about portfolio performance calculation; comparing manager returns; linking sub-period returns; understanding why different return methods give different numbers.
Run `npx skills add JoelLewis/finance_skills --skill return-calculations -a claude-code`. Or copy the skill folder (plugins/core/skills/return-calculations in JoelLewis/finance_skills) into .claude/skills/return-calculations in your project. Claude Code loads it when a task matches its description.
Run `npx skills add JoelLewis/finance_skills --skill return-calculations -a codex`. Or copy the skill folder (plugins/core/skills/return-calculations in JoelLewis/finance_skills) into .agents/skills/return-calculations in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add JoelLewis/finance_skills --skill return-calculations -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/return-calculations, .gemini/skills/return-calculations, .github/skills/return-calculations and .opencode/skills/return-calculations in your project.
Going by SKILL.md and its folder, Return Calculations needs Python for the scripts in its folder and the command-line tools its instructions call (uv and python3). Our summary lists: Python 3.
SKILL.md contains no URLs. Its commands use uv, which can reach the network depending on how they are called. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.
Return Calculations is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 2.2k tokens (SKILL.md is roughly 8.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Return Calculations: Technical Analyst (tradermonty/claude-trading-skills, 3k stars), Theme Detector (tradermonty/claude-trading-skills, 3k stars), Creating Financial Models (Chen-zexi/open-ptc-agent, 729 stars) and Stock API (zhangxiangliang/stock-api, 2k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
JoelLewis (a GitHub user) maintains it in JoelLewis/finance_skills, which has 205 GitHub stars. The repository holds 91 skills in this directory. The repository was last updated on July 18, 2026.
Source: JoelLewis/finance_skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.