# Mean Reversion

> Use when writing a Bollinger-band mean-reversion strategy on Superior Trade — anything described as mean reversion, BB bands, oversold bounce, fade, range trade, ADX low, sigma extension. Upgraded 2026-05-18 from the prior 1h/2.5σ variant to the validated 4h/2σ/ADX<25 version (+8.77% multi-pair, 65.5% win over 162d). Prior 1h variant is preserved at the end of the file as an archived reference.

- **Type:** Skill
- **Install:** `agentstack add skill-superior-trade-superior-skills-mean-reversion`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [Superior-Trade](https://agentstack.voostack.com/s/superior-trade)
- **Installs:** 0
- **Category:** [AI & ML](https://agentstack.voostack.com/c/ai-and-ml)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [Superior-Trade](https://github.com/Superior-Trade)
- **Source:** https://github.com/Superior-Trade/superior-skills/tree/main/skills/mean-reversion

## Install

```sh
agentstack add skill-superior-trade-superior-skills-mean-reversion
```

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

## About

# Mean Reversion — Bollinger Reverter 4h

**Note:** This template was upgraded from the prior 1h / 2.5σ / ADX bb_upper AND rsi > 65 AND adx  pd.DataFrame:
        bb = ta.BBANDS(dataframe, timeperiod=20, nbdevup=2.0, nbdevdn=2.0)
        dataframe["bb_upper"] = bb["upperband"]
        dataframe["bb_mid"] = bb["middleband"]
        dataframe["bb_lower"] = bb["lowerband"]
        dataframe["rsi"] = ta.RSI(dataframe, timeperiod=14)
        dataframe["adx"] = ta.ADX(dataframe, timeperiod=14)
        return dataframe

    def populate_entry_trend(self, dataframe: pd.DataFrame, metadata: dict) -> pd.DataFrame:
        cond_short = (
            (dataframe["close"] > dataframe["bb_upper"])
            & (dataframe["rsi"] > 65)
            & (dataframe["adx"]  pd.DataFrame:
        dataframe.loc[dataframe["close"]  dataframe["bb_mid"], "exit_long"] = 1
        return dataframe
```

## Reference config (multi-pair)

```json
{
  "exchange": {
    "name": "hyperliquid",
    "pair_whitelist": ["BTC/USDC:USDC", "ETH/USDC:USDC", "SOL/USDC:USDC", "DOGE/USDC:USDC"]
  },
  "stake_currency": "USDC",
  "stake_amount": 75,
  "dry_run_wallet": {"USDC": 350},
  "timeframe": "4h",
  "max_open_trades": 4,
  "minimal_roi": {"0": 100.0},
  "stoploss": -0.02,
  "trading_mode": "futures",
  "margin_mode": "isolated",
  "entry_pricing": {"price_side": "same", "price_last_balance": 0.0},
  "exit_pricing": {"price_side": "same", "price_last_balance": 0.0},
  "pairlists": [{"method": "StaticPairList"}]
}
```

## Honest framing

In strong-trend windows the strategy loses small (-1.75% on BTC during the first-half strong bear). In rangy windows it shines (+9.88% on BTC second-half). The mixed-regime full-period multi-pair number (+8.77% in 162d on $350 wallet) is the credible expectation.

DOGE was the negative pair (-0.65%) — meme volatility breaks more bands than reverts to them. Use this strategy on majors.

Pair with `donchian-strong-regime` for full-regime coverage.

---

## Prior version (1h, 2.5σ, archived)

The previous version was tighter (2.5σ bands, ADX<30) on a 1h timeframe. Its own honest framing noted "5 trades in 4 months" — too rare to be useful. The 4h version produces ~3× the signal density with the same risk profile. The 1h version is preserved here for users who want a deeper-fade variant:

```python
# Archived 1h variant — fewer, deeper signals
timeframe = "1h"
# bb = ta.BBANDS(dataframe, timeperiod=100, nbdevup=2.5, nbdevdn=2.5)
# rsi gates same; adx < 30 (looser)
```

If you prefer the rarer-but-deeper setup, restore the 1h timeframe and 2.5σ. The exit logic is unchanged.

## Source & license

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

- **Author:** [Superior-Trade](https://github.com/Superior-Trade)
- **Source:** [Superior-Trade/superior-skills](https://github.com/Superior-Trade/superior-skills)
- **License:** MIT

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-superior-trade-superior-skills-mean-reversion
- Seller: https://agentstack.voostack.com/s/superior-trade
- 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%.
