Regime Overlay logo

Regime Overlay

Organization
Superior-Trade
regime-overlay

Use when adding a regime filter to any directional strategy — regime gate, trend filter, directional confirmation, ADX gate, EMA-separation filter, trade-or-skip overlay. Provides three reusable gates (regime_strong_bear, regime_strong_bull, regime_range) that wrap entry signals with triple confirmation.

Overview

PublisherSuperior-Trade
Repositorysuperior-skills
Skill nameregime-overlay
Stars
215
Forks
9
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by Superior-Trade on GitHub. Read the source before you install it.

Installation

Install the Regime Overlay AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/Superior-Trade/superior-skills/tree/main/skills/regime-overlay
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Superior-Trade/superior-skills.git /tmp/superior-skills
mkdir -p .claude/skills
cp -r /tmp/superior-skills/skills/regime-overlay .claude/skills/regime-overlay
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Regime Overlay in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Regime Overlay on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Regime Overlay is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Regime Overlay — Triple-Confirmation Gate

A reusable filter that wraps any directional strategy and only allows entries when three independent regime confirmations align. Validated as the difference between a fragile and a robust trend strategy.

Searchable under: regime filter, trend gate, trade-or-skip filter, directional confirmation, ADX gate.

Why a separate primitive

After 21 backtests, the single biggest performance lever was not entry logic, stop sizing, or trailing config. It was whether the strategy traded at all during specific market structure.

The proof:

  • Same Donchian-breakdown short on BTC 4h, no regime gate → +12.85% over 162d (looks great)
  • Same strategy, on a different window (the rangy second half) → -4.32% (edge gone)
  • Same strategy with triple-confirmed regime gate → +6.69% with 0% drawdown, fires zero trades in the chop window

The first version captured a real edge mixed with random noise. The third version captured only the real edge. Smaller absolute return; cleaner equity curve; no losing periods.

The three confirmations

A signal is "in regime" when ALL three of these hold simultaneously:

IndicatorThresholdWhat it confirms
(EMA50 - EMA200) / EMA200< -0.06 (for bear)Structural trend direction — not a fresh cross, real separation
ADX(14)> 25Strength of the current trend
close.pct_change(30)< -0.10 (for bear)Recent momentum is actually moving

Three independent angles — structure, strength, recency. A market can satisfy any one or two by accident; satisfying all three is genuinely rare and genuinely informative.

For long-side strategies, invert the signs:

  • (EMA50 - EMA200) / EMA200 > +0.06
  • ADX(14) > 25 (same — ADX is direction-agnostic)
  • close.pct_change(30) > +0.10

Implementation

python
def regime_strong_bear(df: pd.DataFrame) -> pd.Series:
    ema50 = ta.EMA(df, timeperiod=50)
    ema200 = ta.EMA(df, timeperiod=200)
    adx = ta.ADX(df, timeperiod=14)
    ema_sep = (ema50 - ema200) / ema200
    ret_30 = df["close"].pct_change(30)
    return (ema_sep < -0.06) & (adx > 25) & (ret_30 < -0.10)


def regime_strong_bull(df: pd.DataFrame) -> pd.Series:
    ema50 = ta.EMA(df, timeperiod=50)
    ema200 = ta.EMA(df, timeperiod=200)
    adx = ta.ADX(df, timeperiod=14)
    ema_sep = (ema50 - ema200) / ema200
    ret_30 = df["close"].pct_change(30)
    return (ema_sep > 0.06) & (adx > 25) & (ret_30 > 0.10)


def regime_range(df: pd.DataFrame) -> pd.Series:
    adx = ta.ADX(df, timeperiod=14)
    return adx < 25

The range-regime check is the opposite end of the spectrum — useful for gating mean-reversion strategies (see bollinger-reverter-4h).

Expected behavior

Apply this overlay to any signal-driven entry. The cost is fewer trades; the benefit is the trades you do take fire in the right environment.

StrategyWithout overlayWith overlay
Donchian breakdown BTC23 trades, 56.5% win, +12.85%, 3.69% DD6 trades, 100% win, +6.69%, 0% DD
(Same, second-half only)8 trades, 25% win, -4.32%0 trades, no PnL

The overlay traded the second column's win rate and drawdown for the first column's absolute return. Most production strategies should prefer the second column.

Tunables

ParameterConservativeAggressiveNotes
EMA separation threshold0.080.04Tighter = wait for deeper structural moves
ADX threshold3020Higher = stricter trend-strength requirement
Return lookback bars4020Window for "actual momentum" check
Return threshold0.150.06How much momentum needed

Start conservative (0.06 / 25 / -0.10). Loosen only if the gate eliminates so many trades that the strategy's edge can't compound.

What this is NOT

  • Not a signal in itself. The overlay only says "regime is right"; it doesn't tell you when to enter
  • Not magic. In an environment where the historical regime gate would never fire (e.g., a yearlong sideways grind), the strategy simply stays out. That's the feature
  • Not a replacement for stops or take-profit. Even regime-confirmed signals fail individually

When NOT to use a regime gate

  • Mean-reversion strategies (bollinger-reverter-4h) work IN range regimes — use regime_range (ADX < 25) instead of bear/bull strong gates
  • Funding-carry strategies that earn rebates rather than directional moves
  • Pair-arbitrage or basis-arb strategies where the edge is structural, not regime-conditional

Pairing patterns

Most directional strategies in this repo benefit from this overlay:

  • donchian-strong-regime — uses bear overlay (validated)
  • Any custom trend-follow strategy

The overlay file itself is regime-agnostic — it provides functions for both bear and bull, and a range complement.

Frequently asked questions

What does the Regime Overlay AI skill do?

Use when adding a regime filter to any directional strategy — regime gate, trend filter, directional confirmation, ADX gate, EMA-separation filter, trade-or-skip overlay. Provides three reusable gates (regime_strong_bear, regime_strong_bull, regime_range) that wrap entry signals with triple confirmation.

Why use Regime Overlay on TypingMind?

Because you install it once and use it with any model. Regime Overlay is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Regime Overlay in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/Superior-Trade/superior-skills/tree/main/skills/regime-overlay. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Regime Overlay?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Regime Overlay?

As many as you like. As long as a model supports skills, you can use Regime Overlay with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Regime Overlay AI skill free?

Yes. It is published on GitHub by Superior-Trade under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇