OPEN-SOURCE SCRIPT
Auric Regime Classifier [JOAT]

Auric Regime Classifier [JOAT]
Introduction
Auric Regime Classifier (ARC) is an open-source, multi-factor market regime detection engine that classifies every confirmed bar into one of five distinct market states: Strong Bull, Weak Bull, Ranging, Weak Bear, or Strong Bear — with a special Compression override that fires when volatility is contracting. The engine uses five independent data sources — adaptive ATR volatility ratio, Bollinger Band squeeze detection, SMEMA trend slope, ADX directional index, and RSI momentum bias — fused through a weighted scoring system into a single net score that drives the regime classification.
The problem ARC solves is that most traders apply a fixed strategy regardless of whether the market is trending strongly, drifting weakly, compressing before a breakout, or chopping without direction. Each of those conditions demands a completely different approach. Applying a trend-following system in a ranging market produces losses. Trading with tight stops in a compression phase produces whipsaws. ARC gives you a clear, real-time label for the current market phase so you can match your approach to the conditions rather than fighting them.

Core Concepts
1. SMEMA Adaptive Baseline
The indicator uses SMEMA (Simple Moving Average of Exponential Moving Average) as its core trend baseline — a proprietary double-smoothing construct used throughout the JackOfAllTrades indicator suite. SMEMA applies a standard EMA first to capture responsiveness, then a SMA over the same period to suppress noise. The result is a baseline that reacts faster than a raw SMA but is smoother than a raw EMA:
Pine Script®
Two SMEMA lines run in parallel: a slow line over the full period (default 20) and a fast line at half the period. Their slope comparison over three bars determines the trend direction score. When the slow SMEMA slopes upward for three consecutive bars, two bull points are awarded. When it slopes downward, two bear points are awarded.
2. Adaptive ATR Volatility Ratio
ATR over the input period (default 14) is compared against a long-run SMA of ATR (default 50 bars) to produce a volatility expansion/contraction ratio:
Pine Script®
A ratio above 1.1 in the direction of the existing trend awards a bonus point — recognizing that trend moves are more reliable when accompanied by above-average volatility. This prevents the engine from scoring weak, low-volume drifts as strongly as genuine impulsive moves.
3. Bollinger Band Squeeze Detection
The indicator measures Bollinger Band bandwidth (upper minus lower) and compares it against its own 100-bar SMA. When bandwidth falls below the configurable threshold fraction (default 0.75) of its smoothed average, the market is classified as Compressing. Compression overrides all other regime classifications — a compressing market has no valid directional edge regardless of what the other signals say:
Pine Script®
A Squeeze Release signal fires when compression ends (isSqz transitions from true to false), marking the potential start of an expansion move.
4. ADX Directional Index
ADX (Average Directional Index) and the +DI/-DI directional lines are calculated using Pine Script v6's built-in ta.dmi() function. ADX above the threshold (default 25) confirms that the market is in a genuine trending regime rather than a sideways range. The directional bias of +DI vs -DI adds two bull or bear points to the regime score:
Pine Script®
5. Regime Scoring Engine
All five components feed a dual-sided scoring system. Bull and bear points are accumulated independently, and the net score (bull minus bear, range -6 to +6) determines the regime code:
Pine Script®
Strong Bull requires a net score of +4 or higher (all four components aligned). Weak Bull requires +1 to +3. Ranging sits at 0. The mirror applies for bearish regimes.
6. Trend Strength Score (0-100)
Beyond the categorical regime label, ARC produces a continuous trend strength score that measures conviction within the current regime. It combines a distance score (how far price is from the SMEMA baseline in ATR units, capped at 50 points) with a momentum score (RSI deviation from 50 in the trend direction, capped at 50 points). A score of 70+ indicates a strong, high-conviction regime. Below 40 indicates a weak or transitional state.
Features
Input Parameters
Core Engine:
Directional Index:
Volatility Band:
Trend Engine:
Visuals / Dashboard / Alerts:
How to Use This Indicator
Step 1: Read the Regime
The dashboard regime field and the background tint tell you exactly where the market stands. This single label is the most actionable piece of information — it drives which strategy is appropriate.
Step 2: Match Your Approach to the Regime
Step 3: Use Trend Strength for Conviction
Within any directional regime, the strength score tells you how far into that regime the market has moved. A Strong Bull reading with a strength score of 85 is a very different trade environment from one with a strength score of 42. Use the score to scale position size or filter lower-conviction entries.
Step 4: Set Alerts on Regime Transitions
The regime-change alert fires the moment a new regime is confirmed on bar close. Enable the Strong Bull and Strong Bear alertconditions specifically to catch the high-conviction regime entrances.
Indicator Limitations
Originality Statement
ARC is original in its synthesis approach and the use of SMEMA as the core trend baseline. This indicator is published because:
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice or a recommendation to buy or sell any financial instrument. Trading involves substantial risk of loss. Market regime classifications are based entirely on historical data and past behavior. A market classified as Strong Bull can and will reverse at any time. The Compression state does not guarantee a subsequent breakout, and the direction of any eventual breakout cannot be predicted from compression alone. Always apply proper risk management. The author is not responsible for any trading losses resulting from the use of this indicator.
-Made with passion by jackofalltrades
Introduction
Auric Regime Classifier (ARC) is an open-source, multi-factor market regime detection engine that classifies every confirmed bar into one of five distinct market states: Strong Bull, Weak Bull, Ranging, Weak Bear, or Strong Bear — with a special Compression override that fires when volatility is contracting. The engine uses five independent data sources — adaptive ATR volatility ratio, Bollinger Band squeeze detection, SMEMA trend slope, ADX directional index, and RSI momentum bias — fused through a weighted scoring system into a single net score that drives the regime classification.
The problem ARC solves is that most traders apply a fixed strategy regardless of whether the market is trending strongly, drifting weakly, compressing before a breakout, or chopping without direction. Each of those conditions demands a completely different approach. Applying a trend-following system in a ranging market produces losses. Trading with tight stops in a compression phase produces whipsaws. ARC gives you a clear, real-time label for the current market phase so you can match your approach to the conditions rather than fighting them.
Core Concepts
1. SMEMA Adaptive Baseline
The indicator uses SMEMA (Simple Moving Average of Exponential Moving Average) as its core trend baseline — a proprietary double-smoothing construct used throughout the JackOfAllTrades indicator suite. SMEMA applies a standard EMA first to capture responsiveness, then a SMA over the same period to suppress noise. The result is a baseline that reacts faster than a raw SMA but is smoother than a raw EMA:
smema(float src, int len) =>
ta.sma(ta.ema(src, len), len)
Two SMEMA lines run in parallel: a slow line over the full period (default 20) and a fast line at half the period. Their slope comparison over three bars determines the trend direction score. When the slow SMEMA slopes upward for three consecutive bars, two bull points are awarded. When it slopes downward, two bear points are awarded.
2. Adaptive ATR Volatility Ratio
ATR over the input period (default 14) is compared against a long-run SMA of ATR (default 50 bars) to produce a volatility expansion/contraction ratio:
float volRatio = safeDiv(atrRaw, atrBase, 1.0)
A ratio above 1.1 in the direction of the existing trend awards a bonus point — recognizing that trend moves are more reliable when accompanied by above-average volatility. This prevents the engine from scoring weak, low-volume drifts as strongly as genuine impulsive moves.
3. Bollinger Band Squeeze Detection
The indicator measures Bollinger Band bandwidth (upper minus lower) and compares it against its own 100-bar SMA. When bandwidth falls below the configurable threshold fraction (default 0.75) of its smoothed average, the market is classified as Compressing. Compression overrides all other regime classifications — a compressing market has no valid directional edge regardless of what the other signals say:
bool isSqz = bbBW < bbBWAvg * sqzPct
A Squeeze Release signal fires when compression ends (isSqz transitions from true to false), marking the potential start of an expansion move.
4. ADX Directional Index
ADX (Average Directional Index) and the +DI/-DI directional lines are calculated using Pine Script v6's built-in ta.dmi() function. ADX above the threshold (default 25) confirms that the market is in a genuine trending regime rather than a sideways range. The directional bias of +DI vs -DI adds two bull or bear points to the regime score:
[diPlus, diMinus, adxVal] = ta.dmi(adxLen, adxLen)
bool isBullDir = diPlus > diMinus
bool isBearDir = diMinus > diPlus
5. Regime Scoring Engine
All five components feed a dual-sided scoring system. Bull and bear points are accumulated independently, and the net score (bull minus bear, range -6 to +6) determines the regime code:
int bullPts = (trendUp ? 2 : 0) + (isBullDir ? 2 : 0) +
(rsiBull ? 1 : 0) + ((volRatio > 1.1 and trendUp) ? 1 : 0)
int netScore = bullPts - bearPts
int regCode = isSqz ? 0 : netScore >= 4 ? 2 : netScore >= 1 ? 1 :
netScore <= -4 ? -2 : netScore <= -1 ? -1 : 0
Strong Bull requires a net score of +4 or higher (all four components aligned). Weak Bull requires +1 to +3. Ranging sits at 0. The mirror applies for bearish regimes.
6. Trend Strength Score (0-100)
Beyond the categorical regime label, ARC produces a continuous trend strength score that measures conviction within the current regime. It combines a distance score (how far price is from the SMEMA baseline in ATR units, capped at 50 points) with a momentum score (RSI deviation from 50 in the trend direction, capped at 50 points). A score of 70+ indicates a strong, high-conviction regime. Below 40 indicates a weak or transitional state.
Features
- Five-State Regime Classification: Every bar labeled Strong Bull, Weak Bull, Ranging, Weak Bear, or Strong Bear with a Compression override — no ambiguity
- SMEMA Ribbon: Fast and slow SMEMA lines with a gradient fill between them, colored by the current regime state for instant visual context
- Regime Background Tint: Subtle, semi-transparent background coloring that shifts with the regime — green family for bull states, red family for bear, yellow for compression
- Candle Coloring: Bar colors inherit the regime color at reduced opacity, giving every candle immediate regime context without obscuring price action
- Squeeze Markers: Circle markers on the SMEMA baseline during compression, with a diamond signal at the moment of squeeze release
- Trend Strength Score: A 0-100 numeric score with a Strong/Moderate/Weak label updated each bar, shown in the dashboard
- Regime Change Alerts: Alert fires on every confirmed regime state transition with either plain text or structured JSON for webhook delivery
- 12-Row Dashboard (Top Right): Displays current regime, trend strength score, ADX value and trending/ranging status, +DI/-DI directional reading, volatility ratio, Bollinger Band state, RSI, timeframe, and version
- Watermark: JackOfAllTrades signature rendered at chart center-bottom
Input Parameters
Core Engine:
- ATR Length: Period for raw ATR calculation (default: 14)
- ATR Smoothing Period: Baseline ATR lookback for volatility ratio (default: 50)
Directional Index:
- ADX / DI Length: Period for +DI, -DI, and ADX (default: 14)
- Trend Threshold: ADX level above which the market is considered trending (default: 25)
Volatility Band:
- BB Length: Bollinger Band period (default: 20)
- BB Multiplier: Standard deviation multiplier (default: 2.0)
- Squeeze Threshold: Bandwidth fraction of its 100-bar SMA below which compression is declared (default: 0.75)
Trend Engine:
- SMEMA Length: Period for the double-smoothed baseline (default: 20)
- RSI Length: Momentum confirmation period (default: 14)
Visuals / Dashboard / Alerts:
- Theme: Auto, Dark, or Light — auto-detects chart background
- Regime Background Tint: Toggle the subtle background color
- Show SMEMA Baseline: Toggle the ribbon plots
- Show Squeeze Markers: Toggle the circle and diamond markers
- Show Dashboard: Toggle the 12-row information panel
- Show Watermark: Toggle the JackOfAllTrades signature
- Webhook JSON Format: Switch alert messages between plain text and JSON
- Color Palette: All six regime colors are individually customizable
How to Use This Indicator
Step 1: Read the Regime
The dashboard regime field and the background tint tell you exactly where the market stands. This single label is the most actionable piece of information — it drives which strategy is appropriate.
Step 2: Match Your Approach to the Regime
- Strong Bull / Strong Bear: All four scoring components are aligned. High-conviction directional trades, trend-following entries on pullbacks to the SMEMA ribbon
- Weak Bull / Weak Bear: Only one or two components agree. Lighter position sizing, wider stops, prepare for a possible regime shift
- Ranging: Net score near zero — avoid directional trades, consider mean-reversion or wait for breakout
- Compression: All directional analysis is suspended. Reduce exposure, prepare for a breakout in either direction, and watch the squeeze release signal for timing
Step 3: Use Trend Strength for Conviction
Within any directional regime, the strength score tells you how far into that regime the market has moved. A Strong Bull reading with a strength score of 85 is a very different trade environment from one with a strength score of 42. Use the score to scale position size or filter lower-conviction entries.
Step 4: Set Alerts on Regime Transitions
The regime-change alert fires the moment a new regime is confirmed on bar close. Enable the Strong Bull and Strong Bear alertconditions specifically to catch the high-conviction regime entrances.
Indicator Limitations
- All five components are backward-looking. The regime label describes what has happened over the lookback windows — not what will happen. A Strong Bull classification can reverse on the very next bar
- The warmup period (equal to the longest lookback, at least 50 bars) means the indicator produces no signals on the first several bars of any chart, including after switching timeframes
- Compression detection uses a 100-bar SMA of bandwidth, which is a long-run reference. On very short or illiquid charts with few bars, the bandwidth average may not be reliable
- The five-state classification uses fixed score thresholds (+4 for Strong, +1 for Weak). These thresholds are not auto-calibrated to the instrument. In range-bound markets where ADX rarely exceeds 20, the Strong Bull/Bear states may rarely appear
- RSI and ADX both work with default periods. No single set of periods is optimal across all assets and timeframes. Users may need to adjust periods when applying to highly volatile assets or longer timeframes
Originality Statement
ARC is original in its synthesis approach and the use of SMEMA as the core trend baseline. This indicator is published because:
- The SMEMA construct (SMA of EMA) is a proprietary double-smoothing formula used consistently across the JackOfAllTrades suite — it provides a smoother baseline than raw EMA while retaining more responsiveness than raw SMA, and it is not a standard available in typical indicator libraries
- The dual-sided bull/bear point system scores each directional component independently before computing a net score. This is distinct from composite oscillators that blend components into a single signed value — the dual-side approach preserves information about how many bear components are active even when the net score is positive
- The Compression override takes precedence over all directional scores, explicitly suspending regime analysis during volatility contractions. Most regime indicators simply produce lower directional readings in compression without explicitly declaring the compression state
- The trend strength score combines an ATR-normalized price distance with an RSI momentum deviation to produce a conviction metric that is distinct from the categorical regime label
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice or a recommendation to buy or sell any financial instrument. Trading involves substantial risk of loss. Market regime classifications are based entirely on historical data and past behavior. A market classified as Strong Bull can and will reverse at any time. The Compression state does not guarantee a subsequent breakout, and the direction of any eventual breakout cannot be predicted from compression alone. Always apply proper risk management. The author is not responsible for any trading losses resulting from the use of this indicator.
-Made with passion by jackofalltrades
สคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันฟังก์ชันการทำงานของมันได้ ขอชื่นชมผู้เขียน! แม้ว่าคุณจะใช้งานได้ฟรี แต่โปรดจำไว้ว่าการเผยแพร่โค้ดซ้ำจะต้องเป็นไปตาม กฎระเบียบการใช้งาน ของเรา
The AI Trading Ecosystem, Built to win trades 📈
Get Full Access 👇
jackofalltrades.vip 🌐
t.me/jackofalltradesvip 🃏
Get Full Access 👇
jackofalltrades.vip 🌐
t.me/jackofalltradesvip 🃏
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน
สคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันฟังก์ชันการทำงานของมันได้ ขอชื่นชมผู้เขียน! แม้ว่าคุณจะใช้งานได้ฟรี แต่โปรดจำไว้ว่าการเผยแพร่โค้ดซ้ำจะต้องเป็นไปตาม กฎระเบียบการใช้งาน ของเรา
The AI Trading Ecosystem, Built to win trades 📈
Get Full Access 👇
jackofalltrades.vip 🌐
t.me/jackofalltradesvip 🃏
Get Full Access 👇
jackofalltrades.vip 🌐
t.me/jackofalltradesvip 🃏
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน