agentleFS
krzysukrzysu/market-skills/skills/run-all-l3/SKILL.md

run-all-l3

Skill3 starsChanged 4 months agoMITView on GitHub

Runner that fetches candles once per ticker, then runs all 7 L3 strategy skills in-process. Returns aggregated trade ideas.

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 0 are distinctive, and 2 are 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.

  • 2

    Very specific

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

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

    When you want a conviction-ranked view across baskets — l3-conviction-scan is the ranking layer on top of this.

    line 20
  2. Very specific:

    Every emitted idea in strategies[*].ideas[] is normalized in-process to a canonical schema before the envelope is emitted, regardless of …

    line 76

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 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

run-all-l3

Fetches candles once per ticker, then runs all L3 strategy skills on the cached data. Use this from batch runners or agents that need to evaluate trade ideas across all strategies.

When NOT to use

  • For a deep single-ticker dive — call the individual L3 strategy (strategy-trend-follow, etc.) directly for focused output and flags.
  • To execute — run-all-l3 is analytics-only and never places orders. Vet the idea with risk-engine and hand off to execution-kraken-* with explicit user approval.
  • When you want a conviction-ranked view across baskets — l3-conviction-scan is the ranking layer on top of this.

Why

Same reasoning as run-all-l2/ — each L3 script's run.py calls fetch_ohlc() independently. This runner reduces N×6 fetches to N fetches.

Quick Start

uv run skills/run-all-l3/scripts/run.py SPY
uv run skills/run-all-l3/scripts/run.py SPY BTC-USD AAPL --json

# Custom timeframe (e.g. 4h candles for the past month)
uv run skills/run-all-l3/scripts/run.py AAPL --interval=4h --period=1mo --json

Flags

FlagDefaultNotes
TICKER... (positional, repeatable)—At least one ticker required. Supports provider:ticker.
--jsonhumanEmit JSON envelope to stdout.
--source=PROVIDERauto-detectForce a data provider.
--interval=INTERVAL1d1m/2m/5m/15m/30m/1h/2h/4h/8h/12h/1d/3d/1wk/1M. Passed to each L3.
--period=PERIOD1y1d/5d/1w/2w/3w/4w/1mo/3mo/6mo/1y/2y/5y/10y/ytd/max. Passed to each L3.
--include-notesoffAuto-load active market-notes for each ticker.
--top=NallCap each strategy's ideas list to the N highest-conviction entries (sorted by conviction desc, ticker asc).
--fired-onlyoffDrop strategies that emitted an empty ideas[].
--fields=<csv>minimalProject each idea to the listed keys.
--full—Ship the complete envelope payload.

Both --flag value (space-separated) and --flag=value (equals) syntaxes are accepted; both are validated against analysis/intervals.VALID_INTERVALS / VALID_PERIODS — a bad value exits 2 with a friendly error. JSON output includes top-level interval/period so the consumed timeframe is always visible to downstream agents.

yfinance caveat: when the resolved provider is yfinance and the requested (interval, period) is outside yfinance's per-interval lookback cap (e.g. 4h beyond 1mo, 1h beyond 1mo, 5m beyond 5d), the call returns [] and emits a stderr warning instead of letting yfinance 404 on the unknown token. Route around by using hl:<ticker> or kraken:<ticker> for non-daily intraday data.

Runs

L3 StrategyEntry Logic
strategy-trend-followLong/short in healthy trends
strategy-mean-reversionFade extremes at S/R
strategy-breakout-confirmConfirmed breakouts with volume + squeeze
strategy-accumulation-swingWyckoff spring/reaccumulation in trend
strategy-exhaustion-fadeFade blowoff/capitulation at S/R
strategy-funding-carryHarvest perp funding rates (carry trade)
strategy-liquidity-sweepSweep + accumulation + volume

Output

  • tickers[ticker].strategies[strategy_name].ideas[] — trade ideas from each strategy. Each idea includes version: "v1".."v5" derived from conviction via analysis/contracts.conviction_version.
  • tickers[ticker].strategies[strategy_name].narrative — strategy summary
  • tickers[ticker].strategies[strategy_name].rejection_reasons[] — when ideas is empty, this lists stable tags (insufficient_data, missing_trend, missing_breakout_confirmation, etc.) explaining why the strategy had no signal. Lets LLM agents branch on structured tags without parsing narrative.
  • Non-JSON mode: shows count of ideas per strategy and direction summary

Idea normalization (canonical shape)

Every emitted idea in strategies[*].ideas[] is normalized in-process to a canonical schema before the envelope is emitted, regardless of which strategy produced it:

FieldAlways presentNotes
strategy_nameyesProducer (e.g. strategy-trend-follow) — saves consumers from re-reading the outer envelope key.
idea_idyesDeterministic sha1-derived id from (strategy, ticker, direction, entry, stop, tp[]). Stable across re-runs; lets backtests/paper-traders address specific ideas without uuid persistence.
pairyesThe ticker (already in tickers[*] keys, but mirrored for downstream filtering).
entry_priceyesCanonical; padded with null only when the strategy genuinely omitted it.
entry_rangeyes[low, high]. Auto-mirrored from entry_price when the strategy only emitted a single price.
stop_lossyesCanonical; same as the legacy stop flat field which is also populated.
take_profityesAlways a 3-element list. Padded with None if the strategy emitted fewer TPs.
take_profit_idealwhen emittedUnrounded construction values (mirrors take_profit when present).
rr_to_tpyes[rr_tp1, rr_tp2, rr_tp3] — computed from entry/stop/TP when missing.
conviction, version, direction, entry_type, reasoning, source_skills, veto_reasons, move_maturity_pct, entry_window_validity_pct, asset_classper-strategyWhatever the strategy emitted.

The flat-mirror fields (stop, tp1/tp2/tp3, rr_tp1/rr_tp2/rr_tp3, tp1_pct) are also populated for the l3-conviction-scan extractor and any consumer that prefers them.

Idea-state tracking (stale-idea detection)

This runner does not maintain persistent idea state. The --track-ideas flag that previously lived here was removed — it was a workflow concern (persistent on-disk state plus a hardcoded "30 ticks without 50% progress = stale" policy) that didn't belong in a reusable analysis library.

Workflows that need stale-idea reports should consume the JSON output of this runner and run their own state-tracking step. The runner's JSON envelope (tickers[ticker].strategies[*].ideas[]) is stable and self-describing — any consumer can read entry_price, take_profit[0], and direction to compute progress and staleness on their own terms.

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.

Candle cache (opt-in)

This runner fetches candles once per ticker, then runs all strategies in-process — but each invocation still re-fetches from the venue unless the OHLC cache is enabled. For cron / repeated scans, set a TTL so identical provider:ticker:interval:period requests are served from disk:

MARKET_SKILLS_OHLC_CACHE_TTL=3600 uv run skills/run-all-l3/scripts/run.py SPY BTC-USD

0 (the default) means always fetch live. See the README "Candle cache" section for the full contract (store path, entry cap, staleness guidance).

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.