agentleFS
krzysukrzysu/market-skills/skills/market-macd/SKILL.md

market-macd

Skill3 starsChanged 4 months agoMITView on GitHub

Computes MACD(12,26,9): MACD line, signal line, histogram, histogram flip direction, and signal classification (BULLISH / BEARISH / crossovers). Use for momentum confirmation, divergence detection, and trend direction changes. Supports any yfinance ticker.

The file

Files
SKILL.md

market-macd

MACD (Moving Average Convergence Divergence) momentum indicator using standard parameters 12/26/9.

When NOT to use

  • This is a single indicator, not a trade idea — pair with market-trend for trend context and market-volume for confirmation before acting.
  • MACD flips signal potential turns before price confirms; do not enter on a histogram flip alone — wait for price structure (see market-trend-quality).
  • Needs 35+ daily candles for reliable warm-up; thin history produces noisy crossovers.

Quick Start

uv run skills/market-macd/scripts/run.py AAPL --json

Flags

FlagDefaultNotes
TICKER (positional)—Required. Supports provider:ticker (e.g. hl:LIT, yf:AAPL).
--jsonhumanEmit JSON to stdout.
--source=PROVIDERauto-detectForce a data provider (see README).
--interval=INTERVAL1d1m/2m/5m/15m/30m/1h/2h/4h/8h/12h/1d/3d/1wk/1M.
--period=PERIOD1y1d/5d/1mo/3mo/6mo/1y/2y/5y/10y/ytd/max.

Both timeframe flags are validated — bad values exit 2 with a friendly error. Defaults give daily candles over 1y (~250 bars), enough for MACD(12,26,9) warm-up. For intraday (--interval=1h), bump --period to 6mo or 1y; yfinance caps hourly at ~2y and anything sub-hour at ~60d.

What it returns

  • macd_line — fast EMA(12) minus slow EMA(26)
  • signal_line — EMA(9) of the MACD line
  • histogram — MACD line minus signal line
  • histogram_direction — rising or falling vs previous bar
  • histogram_flip — positive→negative (bearish) or negative→positive (bullish)
  • signal — BULLISH, BEARISH, BULLISH_CROSS, BEARISH_CROSS, or NEUTRAL
  • score — +2 (strong bullish) to -2 (strong bearish)
  • zone — bullish / bearish / neutral

Signal Interpretation

ConditionSignalScore
Histogram > 0, MACD > Signal, risingBULLISH+2
Histogram > 0, MACD > SignalBULLISH+1
MACD crossed above Signal (bullish cross)BULLISH_CROSS+1
Histogram < 0, MACD < SignalBEARISH-1
Histogram < 0, MACD < Signal, fallingBEARISH-2
MACD crossed below Signal (bearish cross)BEARISH_CROSS-1

Edge Cases

  • Requires 35+ daily candles for reliable MACD calculation.
  • Histogram flips signal potential trend changes before price confirms.
  • Best used with market-trend for trend context and market-volume for confirmation.

Output envelope (AXI)

--json output follows the canonical AXI envelope — {data, count, errors, help[]}. Default schema is the per-skill minimal fields (3-6 essentials); pass --fields=<csv> to project or --full for the full payload. count is the item count, help[] is contextual next-step command templates. Lib.py return shapes (L1Result / L2Result / L3Result / L3Idea / RegimeSignal) are unchanged — the envelope wraps them at the scripts/run.py boundary.

Home view (no-arg mode)

No-arg mode prints the home view from $XDG_DATA_HOME/market-skills/<skill>_last.json (last successful run). Errors are not cached.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.