monthly-analysis

Fetch end-of-month prices, calculate returns and momentum, and merge Rice Data Portal fundamentals.

Updated Jun 20, 2025
One-click install
npx skills add https://github.com/kerryback/mgmt638 --skill monthly-analysis
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: monthly-analysis
Source: https://github.com/kerryback/mgmt638/tree/main/.claude/skills/monthly-analysis
Command: npx skills add https://github.com/kerryback/mgmt638 --skill monthly-analysis

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires requests, pandas, numpy, python-dotenv, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill provides a complete, self-contained workflow for monthly stock analysis, including fetching end-of-month prices, computing returns and momentum, and merging with fundamental data from the Rice Data Portal. It is designed to streamline monthly research and portfolio analysis with minimal manual steps.

Core Features & Use Cases

  • Automated monthly price retrieval: Fetch end-of-month prices and compute monthly returns.
  • Momentum and sizing: Calculate momentum and size-related indicators for month-over-month analysis.
  • Fundamental integration: Merge price signals with SEC/Rice fundamentals and shift data to avoid look-ahead bias.
  • Use Case: A portfolio analyst wants a reproducible monthly analysis that combines price signals with fundamentals for backtesting.

Quick Start

Use the monthly-analysis skill to fetch data starting from a specific date, then merge with fundamentals:

  1. python .claude/skills/monthly-analysis/scripts/fetch_monthly_data.py 2020-01-01 monthly.parquet
  2. python .claude/skills/monthly-analysis/scripts/merge_monthly_fundamentals.py monthly.parquet fundamentals.parquet monthly_merged.parquet

Frequently Asked Questions about monthly-analysis

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automate monthly stock analysis with price and fundamental data?

Monthly stock analysis combines end-of-month prices, returns, and momentum with fundamentals from Rice Data Portal or SEC filings. This Skill fetches monthly prices, calculates momentum indicators, merges fundamental data, and exports a unified dataset for backtesting and portfolio analysis without manual data alignment.

What does look-ahead bias mean in momentum and return calculations?

Look-ahead bias occurs when future data leaks into historical calculations, distorting backtest results. This Skill mitigates it by shifting fundamental data appropriately so month-over-month returns and momentum reflect only information available at decision time, ensuring realistic portfolio performance estimates.

Can I merge daily price data with quarterly fundamentals for monthly analysis?

Yes. This Skill aligns DAILY price feeds with SF1 quarterly fundamentals by aggregating prices to end-of-month and shifting fundamental timestamps to avoid look-ahead bias. The merged output supports monthly time-series analysis, backtesting, and factor research across multiple data frequencies.

How do I prepare Rice Data Portal and SEC filing data before merging with prices?

Fetch end-of-month prices starting from your analysis date using the provided script, then prepare fundamental data in a compatible format. This Skill's merge script aligns both datasets by ticker and date, applies temporal shifts to prevent bias, and outputs a parquet file ready for downstream analytics.

What file formats does this workflow support for input and output?

The Skill reads price and fundamental data as parquet or similar tabular formats and outputs merged results as parquet. Parquet preserves data types and compression, making it efficient for large monthly time-series datasets used in portfolio backtesting and research.

Do I need Python and pandas installed to run monthly stock analysis?

Yes. This Skill requires Python with pandas, numpy, requests, and python-dotenv. These dependencies handle data fetching, manipulation, and environment configuration for API credentials, enabling end-to-end monthly analysis from data retrieval through export.