# Divergence Trading

> Identify regular and hidden divergences across RSI, MACD, Stochastic, and OBV for reversal and continuation signals. Use when price makes new highs/lows but indicators disagree, or when confirming trend exhaustion.

- **Type:** Skill
- **Install:** `agentstack add skill-ske-labs-agent-trading-skills-divergence-trading`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [SKE-Labs](https://agentstack.voostack.com/s/ske-labs)
- **Installs:** 0
- **Category:** [Finance & Payments](https://agentstack.voostack.com/c/finance-and-payments)
- **Latest version:** 0.1.0
- **License:** Apache-2.0
- **Upstream author:** [SKE-Labs](https://github.com/SKE-Labs)
- **Source:** https://github.com/SKE-Labs/agent-trading-skills/tree/main/skills/technical-strategies/divergence-trading

## Install

```sh
agentstack add skill-ske-labs-agent-trading-skills-divergence-trading
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Divergence Trading

Divergence occurs when price and an indicator move in opposite directions, signaling potential trend change or continuation.

## Divergence Types

### Regular Divergence (Reversal)

| Type | Price | Indicator | Signal |
| --- | --- | --- | --- |
| **Bullish Regular** | Lower Low | Higher Low | Momentum weakening, potential reversal up |
| **Bearish Regular** | Higher High | Lower High | Momentum weakening, potential reversal down |

### Hidden Divergence (Continuation)

| Type | Price | Indicator | Signal |
| --- | --- | --- | --- |
| **Bullish Hidden** | Higher Low | Lower Low | Uptrend pullback ending, continuation up |
| **Bearish Hidden** | Lower High | Higher High | Downtrend rally ending, continuation down |

## Multi-Indicator Detection

| Indicator | Best For | Extreme Zone |
| --- | --- | --- |
| RSI | OB/OS exhaustion | 70 for regular div |
| MACD histogram | Momentum shifts | Compare histogram peaks/troughs with price |
| Stochastic | Ranging markets | 80 (skip mid-range div) |
| MFI (volume proxy) | Smart money confirmation | Rising MFI + falling price = accumulation |

**Strength**: 1 indicator diverging = note only. 2 = trade with confirmation. 3+ = high probability.

## Validation Rules

- Minimum **5 candles** between comparison points (fewer is noise)
- Maximum **50 candles** between comparison points (too far = weak)
- RSI must be in extreme zone (70) for regular divergence
- If RSI crosses 50 between the two points, divergence is invalidated
- Both price swings must be visually clear, not micro-swings

## Workflow

1. **Get indicator data**:
   ```
   get_indicators(indicator_code="rsi", symbol=, exchange=, interval=)
   get_indicators(indicator_code="macd", symbol=, exchange=, interval=)
   get_indicators(indicator_code="stoch", symbol=, exchange=, interval=)
   ```

2. **Compare swings**: For each indicator, identify last two significant peaks/troughs and compare direction vs price direction

3. **Score**: Count diverging indicators (1-3). Check if at key S/R level for bonus confluence.

4. **Get candles for chart drawing**:
   ```
   get_candles_around_date(symbol=, exchange=, interval=, date=)
   ```

5. **Mark divergence on chart**:
   ```
   draw_chart_analysis(action="create", drawing={
       "type": "trend",
       "points": [
           {"time": , "price": },
           {"time": , "price": }
       ],
       "options": {"text": "Bullish Divergence (RSI + MACD)"}
   })
   ```

6. **Wait for confirmation candle** (engulfing, hammer, pin bar) at the divergence zone before entry

## Key Rules

- NEVER trade single-indicator divergence alone; require 2+ indicators
- NEVER trade mid-range RSI divergence (RSI 40-60 is meaningless)
- NEVER enter without a confirmation candle; divergence is a warning, not an entry
- Higher timeframe divergence is far more reliable than LTF; use 1H+ minimum
- Divergence can persist in strong trends; use hidden divergence (continuation) in trends, regular divergence only at extremes
- Entry on confirmation candle close; stop beyond the second divergence swing point

## Related Skills

- **rsi-divergence** — focused RSI divergence framework; this skill extends it to multiple indicators
- **macd-trading** — MACD histogram divergence is one of the four indicators in multi-indicator scoring

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [SKE-Labs](https://github.com/SKE-Labs)
- **Source:** [SKE-Labs/agent-trading-skills](https://github.com/SKE-Labs/agent-trading-skills)
- **License:** Apache-2.0

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-ske-labs-agent-trading-skills-divergence-trading
- Seller: https://agentstack.voostack.com/s/ske-labs
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
