惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Y
Y Combinator Blog
V
V2EX
Jina AI
Jina AI
爱范儿
爱范儿
M
MIT News - Artificial intelligence
量子位
L
LangChain Blog
Google DeepMind News
Google DeepMind News
酷 壳 – CoolShell
酷 壳 – CoolShell
罗磊的独立博客
腾讯CDC
MongoDB | Blog
MongoDB | Blog
P
Proofpoint News Feed
宝玉的分享
宝玉的分享
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Last Week in AI
Last Week in AI
H
Hackread – Cybersecurity News, Data Breaches, AI and More
F
Fortinet All Blogs
The GitHub Blog
The GitHub Blog
Engineering at Meta
Engineering at Meta
博客园 - 聂微东
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Vercel News
Vercel News
T
The Blog of Author Tim Ferriss

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
How to Add Market Regime Filtering to Any Crypto Trading ...
Gunnar Thord · 2026-05-02 · via DEV Community

How to Add Market Regime Filtering to Any Crypto Trading Strategy

Every backtest looks great until you run it live through a choppy market. The strategy that returned 40% in a trending quarter suddenly bleeds 15-30% of those gains when the regime shifts to sideways price action. This is the single most common failure mode in algorithmic crypto trading, and the fix is surprisingly simple.

The Problem: Strategies Are Regime-Dependent

Most trading strategies — momentum, mean-reversion, breakout, crossover — are implicitly designed for a specific market condition. A trend-following system prints money during sustained bull or bear moves. But when the market enters a chop regime, that same system generates false signal after false signal, each one taking a small bite out of your capital.

The math is unforgiving. If your strategy gains 25% during a trending phase and then loses 18% during the subsequent chop, your net return is barely 2.5%. Multiply that across several regime transitions per year and you understand why most live strategies underperform their backtests.

The root cause is not the strategy itself. It is the absence of a regime filter — a pre-trade check that asks: "Is this the right environment for my strategy to operate in?"

What Regime Filtering Actually Means

Regime filtering is a gate that sits before your entry logic. Before your strategy evaluates any signal, it checks the current market regime classification:

  • Bull: Sustained uptrend with confirming signals across momentum, funding, and macro indicators.
  • Bear: Sustained downtrend with risk-off positioning and negative momentum.
  • Chop: No clear directional bias. Price oscillates within a range. Most signals are noise.

The filter logic is straightforward. During a bull regime, allow long entries. During a bear regime, allow shorts or hedges. During chop, skip all entries and hold cash. This single gate eliminates the majority of false signals that cause drawdowns in regime transitions.

You do not need to build a regime detector from scratch. That requires aggregating dozens of on-chain, derivatives, and macro signals, weighting them correctly, and validating against historical regime transitions. Instead, you can call an API.

The Regime API Call

The Regime API provides a real-time market regime classification based on 10+ signals including funding rates, open interest shifts, order book imbalance, macro indicators (DXY, VIX), and on-chain flows.

Free endpoint (no authentication required):

GET https://getregime.com/api/v1/market/regime

Enter fullscreen mode Exit fullscreen mode

Example response:

{
  "regime": "BULL",
  "confidence": 0.74,
  "signals": {
    "momentum": "bullish",
    "funding": "neutral",
    "openInterest": "rising",
    "macro": "risk-on",
    "fearGreed": 62,
    "dxyTrend": "weakening"
  },
  "timestamp": "2026-04-20T14:30:00Z"
}

Enter fullscreen mode Exit fullscreen mode

The regime field gives you the classification. The confidence field (0 to 1) tells you how strong the signal is. The signals object breaks down the individual components so you can see what is driving the classification.

For Pro users, the intelligence brief endpoint provides a full synthesis including crowd positioning, divergences, and risk assessment:

GET https://getregime.com/api/v1/intelligence/brief
Authorization: Bearer YOUR_API_KEY

Enter fullscreen mode Exit fullscreen mode

Implementation in Three Languages

Python

The most common setup for quant strategies. Add this check before any entry decision:

import requests

def get_regime():
    r = requests.get("https://getregime.com/api/v1/market/regime")
    return r.json()

def should_enter_long():
    regime = get_regime()
    if regime["regime"] == "CHOP":
        return False
    if regime["regime"] == "BEAR":
        return False
    if regime["confidence"] < 0.4:
        return False  # low conviction — stay flat
    return True

# In your strategy loop:
if signal_detected and should_enter_long():
    execute_trade()

Enter fullscreen mode Exit fullscreen mode

JavaScript / Node.js

For bot builders and dashboard integrations:

async function getRegime() {
  const res = await fetch("https://getregime.com/api/v1/market/regime");
  return res.json();
}

async function shouldTrade(direction) {
  const { regime, confidence } = await getRegime();

  if (regime === "CHOP") return false;
  if (regime === "BEAR" && direction === "long") return false;
  if (regime === "BULL" && direction === "short") return false;
  if (confidence < 0.4) return false;

  return true;
}

// In your bot logic:
if (await shouldTrade("long")) {
  placeLongOrder();
}

Enter fullscreen mode Exit fullscreen mode

Using the npm SDK

If you prefer a typed client with built-in retries:

import { Regime } from "getregime";

const client = new Regime(); // free tier, no key needed

const { regime, confidence } = await client.market.regime();

if (regime === "BULL" && confidence > 0.6) {
  // proceed with long entry
}

Enter fullscreen mode Exit fullscreen mode

Install with npm install getregime. Full SDK docs at getregime.com/quickstart.

Strategy Rules: A Simple Decision Matrix

Here is a concrete rule set you can adapt to any strategy:

Regime Confidence Action
BULL > 60% Take long entries normally
BULL 40-60% Reduce position size by 50%
BEAR > 60% Only short or hedge existing longs
BEAR 40-60% Reduce short size by 50%
CHOP Any Skip all entries, hold cash
Any < 40% Reduce position size by 50% or sit out

The confidence threshold matters. A BULL regime with 45% confidence is not the same as one with 80% confidence. The former might be an early or fading trend — worth participating in, but with reduced size. The latter is a high-conviction environment where your trend-following strategy should perform well.

Real Results: What the Data Shows

We have tracked 148+ regime transitions since the system went live. The data is publicly available at getregime.com/track-record with timestamped snapshots proving accuracy.

Key findings from the dataset:

  • Regime shifts typically lead price by 24-48 hours. The classification picks up on funding rate shifts, order book changes, and macro moves before they manifest as price action.
  • Strategies using regime filtering avoided an average of 60-70% of false signals during chop periods compared to unfiltered versions.
  • The CHOP classification, specifically, is the highest-value signal. Knowing when not to trade is worth more than knowing when to trade.

The regime detector aggregates data from Binance, Hyperliquid, CoinGecko, DeFiLlama, and FRED (Federal Reserve Economic Data). It is not a single-indicator system. It cross-references derivatives positioning, on-chain flows, and traditional macro to produce a composite classification.

Get Started in 30 Seconds

The regime endpoint is free and requires no authentication. Test it right now:

curl https://getregime.com/api/v1/market/regime

Enter fullscreen mode Exit fullscreen mode

That single call gives you the current market classification. Integrate it into your strategy as a pre-trade gate, and you have regime filtering running in production.

For the full interactive playground, API documentation, and code examples in additional languages, visit getregime.com/quickstart.

The best trade is often no trade at all. Let the regime tell you when to sit on your hands.


Try Regime Intelligence

Regime is a real-time crypto market regime detection API. One endpoint tells you if the market is bull, bear, or chop — so your bot only trades when conditions match your strategy.

Free API access → | See pricing → | API docs →