agentleFS
krzysukrzysu/market-skills/skills/market-s-r/SKILL.md

market-s-r

Skill3 starsChanged 4 months agoMITView on GitHub

Identifies nearest support and resistance levels from swing highs/lows with distance %, touch counts, and clustered price levels. Use for entry/exit placement, stop positioning, and level quality assessment. Supports any yfinance ticker.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Do not enter purely off a level — confirm with volume/trend confluence (an L2 like market-breakout or market-liquidity-sweep).

    line 20

≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

market-s-r

Support and Resistance analysis from swing point clustering. Identifies key price levels where the market has previously reversed.

When NOT to use

  • This is a context/level skill, not a directional signal — it returns levels, never a buy/sell call. Pair with a directional read (market-trend) before acting.
  • Requires 20+ candles; on thin history the "nearest support/resistance" is a weak single swing, not a real level. Prefer touches >= 3 for structural strength.
  • Do not enter purely off a level — confirm with volume/trend confluence (an L2 like market-breakout or market-liquidity-sweep).

Quick Start

uv run skills/market-s-r/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) for swing-point clustering. For intraday (--interval=1h), bump --period to 6mo or 1y; yfinance caps hourly at ~2y and anything sub-hour at ~60d.

What it returns

  • nearest_support, nearest_resistance — closest levels below/above price
  • support_distance_pct, resistance_distance_pct — distance from current price
  • support_touches, resistance_touches — how many swing points cluster at that level
  • clustered_levels — all detected levels with price and touch counts
  • support_count, resistance_count — total levels found in each direction

Interpretation

MetricMeaning
Distance%How close price is to a level — tighter = more reactive
TouchesMore touches = stronger level (3+ is significant)
Clustered levelsNearby swing points that merge into a zone

Edge Cases

  • Context skill: no directional score or signal.
  • Swing point window=3 for broad detection; cluster tolerance=1.5%.
  • Levels closer than 0.1% to price are reported as current_price_sits_on_level.
  • Requires 20+ candles minimum.

Extracting multiple structural levels (not just nearest)

The text output only prints the nearest support/resistance (single row). For goal-price placement (TP ladders, stop clusters, position-watchdog level lists), you need all clustered levels above/below price with their touch counts — which tells you level strength.

The --json output exposes this in indicators.clustered_levels as [{price: float, touches: int}, ...]. Workflow:

# Get all resistance levels above current price, sorted by price, with touch counts
uv run skills/market-s-r/scripts/run.py ETHEUR --json \
  | jq '.indicators.clustered_levels | map(select(.price > .[].price)) | sort_by(.price)'

Or via read_file after saving JSON to disk (per Kraken CLI pitfall — never pipe market-skills JSON to python3 -c for parsing):

uv run skills/market-s-r/scripts/run.py ETHEUR --json > /tmp/sr.json 2>/tmp/sr_err.txt

Then read_file /tmp/sr.json and grep clustered_levels.

Touch-count thresholds for structural strength:

  • touches >= 2 — real level, worth watching
  • touches >= 3 — significant, strong S/R
  • touches >= 5 — historical structural level (cycle top/bottom, multi-year consolidation)

Use cases:

  • Building TP ladders for position-watchdog: pick TPs from levels with touches >= 3 above current price
  • Position stops: pick stops from levels with touches >= 3 below current price
  • Zone identification: consecutive levels within 2% of each other form a zone

See references/swing-levels-extraction.md for the full pattern + worked examples.

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.