mean-reversion

mean-reversion is a skill for Claude Code from Superior-Trade/superior-skills. It costs 118 tokens per session (1,679 once invoked), scanned A, original, MIT.

A four-hour trading strategy based on mean reversion, the idea that prices in a range may move back toward their average after reaching an extreme. It uses Bollinger Bands, which show a moving average and typical price range, plus ADX to identify range-bound markets.

In plain words
What is it for?
Use it to test long or short entries when price reaches an outer Bollinger Band and the market appears range-bound. It is intended for research and backtesting across the listed crypto pairs and timeframe.
Why use it?
It gives a defined way to trade possible reversals while avoiding some trades during stronger trends. The supplied results are historical tests, so they do not guarantee future performance.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the superior-skills plugin — 31 skills shipped together

Good fit Use it to test long or short entries when price reaches an outer Bollinger Band and the market appears range-bound. It is intended for research and backtesting across the listed crypto pairs and timeframe.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/superior-trade/superior-skills/mean-reversion
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add Superior-Trade/superior-skills --skill mean-reversion
Clone the repo
git clone --depth 1 https://github.com/Superior-Trade/superior-skills

Made for: Claude Code.

Or install superior-skills, the plugin that ships this one along with the rest of its 31 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for mean-reversion

README.md
[![agentmods](https://agentmods.dev/badge/skills/superior-trade/superior-skills/mean-reversion/github.svg)](https://agentmods.dev/skills/superior-trade/superior-skills/mean-reversion)
Your own site
<a href="https://agentmods.dev/skills/superior-trade/superior-skills/mean-reversion"><img src="https://agentmods.dev/badge/skills/superior-trade/superior-skills/mean-reversion/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for mean-reversion

Your own site · 80×15
<a href="https://agentmods.dev/skills/superior-trade/superior-skills/mean-reversion"><img src="https://agentmods.dev/badge/skills/superior-trade/superior-skills/mean-reversion.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 118 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,679 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00118 $0.01679
Opus 5 $0.00059 $0.00839
Sonnet 5 $0.00024 $0.00336
Haiku 4.5 $0.00012 $0.00168

Measured 12d ago against content hash 1af6782b7e3c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

mean-reversion scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/mean-reversion/SKILL.md · 145 lines

How it starts

The opening of the file, as written. The whole thing — 145 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Mean Reversion — Bollinger Reverter 4h

Note: This template was upgraded from the prior 1h / 2.5σ / ADX<30 version to the 4h / 2σ / ADX<25 version after backtesting showed the 4h variant produces meaningfully more trades with comparable risk and validated multi-pair edge. The prior 1h version is preserved at the end for reference.


Symmetric mean-reversion strategy on the 4h timeframe. Long-or-short on Bollinger band touches, gated to range regimes via ADX. Validated across BTC/ETH/SOL/DOGE over 162 days.

Backtest evidence

Config Trades Win Profit Max DD
BTC/USDC:USDC, 162d 18 72% +8.14% 10%
BTC/USDC:USDC, range-regime sub-window (80d) 8 100% +9.88% 0%
BTC/ETH/SOL/DOGE multi-pair, 162d 84 65.5% +8.77% 18.5%

Thesis

When the market is range-bound (ADX < 25), price touching the upper or lower Bollinger Band reliably reverts to the midline. Tight ROI takes profit fast since mean-reversion targets are small; tight stop closes positions that turn into trend breaks rather than reversions.

Mechanics

  • Timeframe: 4h
  • 20-bar Bollinger Bands at 2σ
  • Entry short: close > bb_upper AND rsi > 65 AND adx < 25
  • Entry long: close < bb_lower AND rsi < 35 AND adx < 25
  • Exit: close crosses the band midline
  • Stop: -2%
  • ROI ladder: 2.5% → 1.5% → 0.5% → breakeven over 24h
  • No trailing stop (band reversion targets are small; ROI ladder handles take-profit)

Strategy code

from freqtrade.strategy import IStrategy
import pandas as pd
import talib.abstract as ta


class MeanReversionStrategy(IStrategy):
    INTERFACE_VERSION = 3
    timeframe = "4h"
    can_short = True

    stoploss = -0.02
    trailing_stop = False

    minimal_roi = {
        "0": 0.025,
        "240": 0.015,
        "720": 0.005,
        "1440": 0,
    }

    process_only_new_candles = True
    startup_candle_count = 60
    use_exit_signal = True

    def populate_indicators(self, dataframe: pd.DataFrame, metadata: dict) -> 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"] < 25)
        )
        dataframe.loc[cond_short, "enter_short"] = 1
        dataframe.loc[cond_short, "enter_tag"] = "bb_upper_revert"

        cond_long = (
            (dataframe["close"] < dataframe["bb_lower"])
            & (dataframe["rsi"] < 35)
            & (dataframe["adx"] < 25)
        )
        dataframe.loc[cond_long, "enter_long"] = 1
        dataframe.loc[cond_long, "enter_tag"] = "bb_lower_revert"
        return dataframe

    def populate_exit_trend(self, dataframe: pd.DataFrame, metadata: dict) -> pd.DataFrame:
        dataframe.loc[dataframe["close"] < dataframe["bb_mid"], "exit_short"] = 1
        dataframe.loc[dataframe["close"] > dataframe["bb_mid"], "exit_long"] = 1
        return dataframe

Read the full file on GitHub · 145 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 12d ago First seen · 145 lines · 118 tokens per session scan A 1af6782b7e3c

Subscribe to this mod's changes

mean-reversion is a skill published in the GitHub repository Superior-Trade/superior-skills (209 stars, last pushed yesterday), licensed MIT. It adds 118 tokens to every session and 1,679 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

tushare

A Python interface for Tushare, a financial data service that provides market and company information for stocks, funds, futures, and digital assets. It returns queried data as pandas tables.

HKUDS/Vibe-Trading · 79 tokens

correlation-analysis

Correlation and cointegration analysis — co-movement discovery, deep return-correlation analysis, sector clustering, realized correlation, Engle-Granger / Johansen cointegration, half-life, Kalman dynamic hedge ratio, cross-market linkage analysis, and pair-trading signal generation.

HKUDS/Vibe-Trading · 57 tokens

social-media-intelligence

Social media intelligence: financial signal extraction from Twitter/X, Telegram, Discord, and Reddit for sentiment-driven trading strategies.

HKUDS/Vibe-Trading · 28 tokens

ashare-pre-st-filter

An A-share China stock risk checker that forecasts whether a company may receive an ST or *ST warning in the next financial year. ST labels are Chinese exchange warnings for companies facing specified financial or regulatory problems.

HKUDS/Vibe-Trading · 89 tokens

credit-analysis

A guide to analysing bonds and other fixed-income investments, including issuer credit quality, interest payments, default risk, credit spreads, and convertible bonds. It also covers Chinese fixed-income markets and local-government financing bonds.

HKUDS/Vibe-Trading · 36 tokens

etf-analysis

A framework for comparing exchange-traded funds (ETFs), which are funds bought and sold on a stock exchange and usually track an index, industry, asset, or strategy. It covers fees, how closely an ETF follows its target, trading activity, and portfolio use.

HKUDS/Vibe-Trading · 39 tokens