agentleFS
SKE-LabsSKE-Labs/agent-trading-skills/skills/technical-strategies/macd-trading/SKILL.md

macd-trading

Skill17 starsChanged 4 months agoApache-2.0View on GitHub

Define and test MACD line, signal, histogram, zero-line, and divergence features. Use when evaluating closed-bar momentum/trend rules with explicit parameters, exits, regime context, and costs.

1 other project uses a version of this, 1 of them edited.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 3 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    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. Distinctive:

    Treat the setup as a testable hypothesis, not a prediction.

    line 69
  2. Distinctive:

    Test zero-line and higher-timeframe filters for incremental held-out value.

    line 78
  3. Very specific:

    Treat 12/26/9 as the conventional baseline and record all parameter variants tried.

    line 79
  4. Distinctive:

    Do not label a crossover confirmation unless its conditional outcome distribution supports that use.

    line 81

≈ “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

MACD Trading Strategy

MACD (Moving Average Convergence Divergence) combines trend-following and momentum analysis.

Components

ComponentCalculationUse
MACD Line12 EMA - 26 EMATrend direction
Signal Line9 EMA of MACDEntry trigger
HistogramMACD - SignalMomentum strength
Zero LineCenterlineBull/bear boundary

Signals

Crossover

  • Bullish: MACD crosses above Signal line → buy
  • Bearish: MACD crosses below Signal line → sell
  • Record whether a cross occurs above or below zero as context; do not assign strength without validation

Zero Line Cross

  • MACD above zero = bullish trend
  • MACD below zero = bearish trend
  • Cross of zero = trend change confirmation

Histogram

  • Growing histogram = increasing momentum
  • Shrinking histogram = weakening momentum (often precedes crossover)

Divergence

  • Price new high + MACD lower high → bearish divergence
  • Price new low + MACD higher low → bullish divergence

Workflow

  1. Get MACD:
    get_indicators(indicator_code="macd", symbol=<symbol>, exchange=<exchange>, interval=<interval>)
  2. Record zero-line state as one feature; it does not determine direction by itself
  3. Wait for crossover in trend direction. Confirm with histogram growing in direction.
  4. Check for divergence between price and MACD line/histogram
  5. Get candles for context:
    get_candles_around_date(symbol=<symbol>, exchange=<exchange>, interval=<interval>, date=<date>)
  6. Exit: choose one objective crossover, histogram, price, target, or time rule before entry and test it separately

Evidence and Validation

  • Treat the setup as a testable hypothesis, not a prediction. Define thresholds, entry, invalidation, and exit before evaluating outcomes.
  • Calibrate on the same instrument, venue, session, and timeframe. Use closed candles and a held-out or walk-forward sample; record every variant tried.
  • Include spread, fees, slippage, borrow or funding, partial fills, and latency. Reject the setup when net expectancy is not positive or depends on one narrow parameter.
  • Return observed inputs, missing data, cost assumptions, entry, invalidation, exit, and a valid, watch, or no-trade status.
  • Research basis: Cross-market studies summarized in the technical-rule evidence show MACD performance varies by market and costs; a crossover is a feature, not an edge by itself.

Key Rules

  • A crossover is a lagged price-derived feature; require a separately validated decision rule.
  • Test zero-line and higher-timeframe filters for incremental held-out value.
  • Treat 12/26/9 as the conventional baseline and record all parameter variants tried.
  • Define histogram expansion/shrinkage over a fixed number of closed bars.
  • Do not label a crossover confirmation unless its conditional outcome distribution supports that use.

Related Skills

  • divergence-trading — multi-indicator divergence framework that includes MACD
  • moving-average-crossover — MACD is derived from EMAs; combine for confirmation

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.