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

market-ema

Skill3 starsChanged 4 months agoMITView on GitHub

Computes moving averages (EMA 21/50/100/200) for a ticker. Detects trend alignment, golden/death crosses, and EMA slope. Use for trend direction, support/resistance proxy, or DCA timing. Supports any yfinance ticker.

The file

Files
SKILL.md

market-ema

Computes exponential moving averages and trend structure from daily OHLC data via Yahoo Finance.

When NOT to use

  • This is a single indicator, not a trade idea — pair it with other L1s or an L2/L3 (market-trend-quality, run-all-l3) before acting.
  • EMA alignment lags price; it is structure, not timing — do not use a single EMA cross to enter a position. Combine with market-rsi for oversold entries in an uptrend.
  • Needs 220+ daily candles for EMA(200); with less history it falls back and the long-term read is untrustworthy.

Quick Start

uv run skills/market-ema/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 EMA(200). For intraday (--interval=1h), bump --period to 6mo or 1y; yfinance caps hourly at ~2y and anything sub-hour at ~60d (script warns to stderr when a combo is likely to truncate).

What it returns

  • Current price vs EMA(21), EMA(50), EMA(100), EMA(200)
  • Alignment: FULL_BULL, PARTIAL_BULL, TANGLED, PARTIAL_BEAR, FULL_BEAR
  • Price position: how many EMAs is price above (0-4)
  • Slope of EMA(21) and EMA(50) as % change over 5 days
  • Crossover: golden_cross or death_cross if 21/50 crossed within last 5 days

Signal Interpretation

AlignmentPrice vs EMAsSignal
FULL_BULL + above all 4STRONG UPTREND — DCA with conviction
PARTIAL_BULL + above 3+UPTREND — mostly bullish structure
FULL_BEAR + above 0-1DOWNTREND — bearish, DCA into weakness
TANGLED / mixedTRANSITION — wait for clarity

Golden cross (21 crossing above 50) is bullish reversal. Death cross is bearish.

Edge Cases

  • Needs 220+ daily candles for EMA(200). Tickers with less history get an error.
  • EMA alignment lags price — best used for structure, not timing.
  • Combine with market-rsi for oversold entries aligned with trend.

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.