Get the FREE Ultimate OpenClaw Setup Guide →

fundamentals

npx machina-cli add skill staskh/trading_skills/fundamentals --openclaw
Files (1)
SKILL.md
3.1 KB

Fundamentals

Fetch fundamental financial data from Yahoo Finance.

Instructions

Note: If uv is not installed or pyproject.toml is not found, replace uv run python with python in all commands below.

uv run python scripts/fundamentals.py SYMBOL [--type TYPE]

Arguments

  • SYMBOL - Ticker symbol
  • --type - Data type: all, financials, earnings, info (default: all)

Output

Returns JSON with:

  • info - Key metrics (market cap, PE, EPS, dividend, etc.)
  • financials - Recent quarterly/annual income statement data
  • earnings - Historical and estimated earnings

Present key metrics clearly. Compare actual vs estimated earnings if relevant.


Piotroski F-Score

Calculate Piotroski's F-Score to evaluate a company's financial strength using 9 fundamental criteria.

Instructions

uv run python scripts/piotroski.py SYMBOL

What is Piotroski F-Score?

Piotroski's F-Score is a fundamental analysis tool developed by Joseph Piotroski that evaluates a company's financial strength using 9 criteria. Each criterion scores 1 point if passed, 0 if failed, for a maximum score of 9.

The 9 Criteria

  1. Positive Net Income - Company is profitable
  2. Positive ROA - Assets are generating returns
  3. Positive Operating Cash Flow - Company generates cash from operations
  4. Cash Flow > Net Income - High-quality earnings (cash exceeds accounting profit)
  5. Lower Long-Term Debt - Decreasing leverage (improving financial position)
  6. Higher Current Ratio - Improving liquidity
  7. No New Shares Issued - No dilution (or share buybacks)
  8. Higher Gross Margin - Improving profitability efficiency
  9. Higher Asset Turnover - More efficient use of assets

Score Interpretation

  • 8-9: Excellent - Very strong financial health
  • 6-7: Good - Strong financial health
  • 4-5: Fair - Moderate financial health
  • 0-3: Poor - Weak financial health

Output

Returns JSON with:

  • score - F-Score (0-9)
  • max_score - Maximum possible score (9)
  • criteria - Detailed breakdown of each criterion with pass/fail status and values
  • interpretation - Text description of financial health level
  • data_available - Boolean indicating if year-over-year comparison data is available for criteria 5-9

Implementation Details

  • Criteria 1-4 use quarterly financial data (most recent year)
  • Criteria 5-9 use annual financial data for year-over-year comparisons
  • Compares most recent fiscal year vs previous fiscal year

Use Cases

Use Piotroski F-Score when:

  • Evaluating fundamental financial strength
  • Screening for value stocks with improving fundamentals
  • Assessing financial health trends
  • Comparing financial strength across companies
  • Identifying companies with strong fundamentals but undervalued prices

Dependencies

  • pandas
  • yfinance

Source

git clone https://github.com/staskh/trading_skills/blob/main/.claude/skills/fundamentals/SKILL.mdView on GitHub

Overview

Fetch fundamental financial data from Yahoo Finance, including financials, earnings, and key metrics. This skill also provides Piotroski F-Score analysis to gauge financial strength, helping compare profitability, liquidity, and leverage across companies.

How This Skill Works

Use the fundamentals tool to retrieve info, financials, and earnings for a given ticker. You can select the data type with --type (all, financials, earnings, info). For financial strength, run the Piotroski F-Score script to obtain a score, criteria details, and an interpretation.

When to Use It

  • When the user asks for company financials like revenue, profit, balance sheet, or income statement
  • When the user needs key metrics such as market cap, P/E, EPS, and dividend information
  • When earnings history and estimates are required
  • When evaluating financial strength with Piotroski F-Score for a single company or a set of peers
  • When screening or comparing multiple companies based on fundamentals

Quick Start

  1. Step 1: uv run python scripts/fundamentals.py SYMBOL [--type TYPE]
  2. Step 2: uv run python scripts/piotroski.py SYMBOL (optional for F-Score)
  3. Step 3: Review the JSON output containing info, financials, earnings, and F-Score details

Best Practices

  • Use --type all for a comprehensive view, or specify financials, earnings, or info for targeted data
  • Cross-check earnings against estimates in the earnings section to gauge accuracy
  • Compute and compare Piotroski F-Scores across candidates to identify stronger fundamentals
  • Verify the SYMBOL ticker matches the intended company and be mindful of Class A/B tickers
  • Refresh data after quarterly results to maintain up-to-date insights

Example Use Cases

  • AAPL: Retrieve Apple’s latest info, financials, and earnings
  • MSFT: Pull Microsoft’s annual revenue, net income, and key metrics
  • NVDA: Compute Piotroski F-Score and compare with peers
  • AMZN: Compare P/E, market cap, and other fundamentals across peers
  • TSLA: Screen multiple stocks by pulling info, earnings, and F-Score for prioritization

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers