Linh's Anomaly Radar v2What this script does
It’s an event detector for price/volume anomalies that often precede or confirm moves.
It watches a bunch of patterns (Wyckoff tests, squeezes, failed breakouts, turnover bursts, etc.), applies robust z-scores, optional trend filters, cooldowns (to avoid spam), and then fires:
    A shape/label on the bar,
    A row in the mini panel (top-right),
    A ready-made alertcondition you can hook into.
How to add & set up (TradingView)
    Paste the script → Save → Add to chart on Daily first (works on any TF).
    Open Settings → Inputs:
        General
        • Use Robust Z (MAD): more outlier-resistant; keep on.
        • Z Lookback: 60 bars is ~3 months; bump to 120 for slower regimes.
        • Cooldown: min bars to wait before the same signal can fire again (default 5).
        • Use trend filter: if on, “bullish” signals only fire above SMA(tfLen), “bearish” below.
        Thresholds: fine-tune sensitivity (defaults are sane).
    To create alerts: Right-click chart → Add alert
        Condition: Linh’s Anomaly Radar v2 → choose a specific signal or Composite (Σ).
        Options: “Once per bar close” (recommended).
        Customize message if you want ticker/timeframe in your phone push.
The mini panel (top-right)
    Signal column: short code (see cheat sheet below).
    Fired column: a dot “•” means that on the latest bar this signal fired.
    Score (right column): total count of signals that fired this bar.
    Σ≥N shows your composite threshold (how many must fire to trigger the “Composite” alert).
Shapes & codes (what’s what)
Code	Name (category)	What it’s looking for	Why it matters
STL	Stealth Volume	z(volume)>5 & **	z(return)
EVR	Effort vs Result squeeze	z(vol)>3 & z(TR)<−0.5	Heavy effort, tiny spread → absorption
TGV	Tight+Heavy	(HL/ATR)<0.6 & z(vol)>3	Tight bar + heavy tape → pro activity
CLS	Accumulation cluster	≥3 of last 5 bars: up, vol↑, close near high	Classic accumulation footprint
GAP	Open drive failure	Big gap not filled (≥80%) & vol↑	One-sided open stalls → fade risk
BB↑	BB squeeze breakout	Squeeze (z(BBWidth)<−1.3) → close > upperBB & vol↑	Regime shift with confirmation
ER↑	Effort→Result inversion	Down day on vol then next bar > prior high	Demand overwhelms supply
OBV	OBV divergence	OBV slope up & **	z(ret20)
WER	Wide Effort, Opposite Result	z(vol)>3, close+1	Selling into strength / distribution
NS	No-Supply (Wyckoff)	Down bar, HL<0.6·ATR, vol << avg	Sellers absent into weakness
ND	No-Demand (Wyckoff)	Up bar, HL<0.6·ATR, vol << avg	Buyers absent into strength
VAC	Liquidity Vacuum	z(vol)<−1.5 & **	z(ret)
UTD	UTAD (failed breakout)	Breaks swing-high, closes back below, vol↑	Stop-run, reversal risk
SPR	Spring (failed breakdown)	Breaks swing-low, closes back above, vol↑	Bear trap, reversal risk
PIV	Pocket Pivot	Up bar; vol > max down-vol in lookback	Quiet base → sudden demand
NR7	Narrow Range 7 + Vol	HL is 7-bar low & z(vol)>2	Coiled spring with participation
52W	52-wk breakout quality	New 52-wk close high + squeeze + vol↑	High-quality breakouts
VvK	Vol-of-Vol kink	z(ATR20,200)>0.5 & z(ATR5,60)<0	Long-vol wakes up, short-vol compresses
TAC	Turnover acceleration	SMA3 vol / SMA20 vol > 1.8 & muted return	Participation surging before move
RBd	RSI Bullish div	Price LL, RSI HL, vol z>1	Exhaustion of sellers
RS↑	RSI Bearish div	Price HH, RSI LH, vol z>1	Exhaustion of buyers
Σ	Composite	Count of all fired signals ≥ threshold	High-conviction bar
Placement:
    Triangles up (below bar) → bullish-leaning events.
    Triangles down (above bar) → bearish-leaning events.
    Circles → neutral context (VAC, VvK, Composite).
Key inputs (quick reference)
General
    Use Robust Z (MAD): keep on for noisy tickers.
    Z Lookback (lenZ): 60 default; 120 if you want fewer alerts.
    Trend filter: when on, bullish signals require close > SMA(tfLen), bearish require <.
    Cooldown: prevents repeated firing of the same signal within N bars.
Phase-1 thresholds (core)
    Stealth: vol z > 5, |ret z| < 1.
    EVR: vol z > 3, TR z < −0.5.
    Tight+Heavy: (HL/ATR) < 0.6, vol z > 3.
    Cluster: window=5, min=3 strong bars.
    GapFail: gap/ATR ≥1.5, fill <80%, vol z > 2.
    BB Squeeze: z(BBWidth)<−1.3 then breakout with vol z > 2.
    Eff→Res Up: prev bar heavy down → current bar > prior high.
    OBV Div: OBV uptrend + |z(ret20)|<0.3.
Phase-2 thresholds (extras)
    WER: vol z > 3, close1.
    No-Supply/No-Demand: tight bar & very light volume vs SMA20.
    Vacuum: vol z < −1.5, |ret z|>1.5.
    UTAD/Spring: swing lookback N (default 20), vol z > 2.
    Pocket Pivot: lookback for prior down-vol max (default 10).
    NR7: 7-bar narrowest range + vol z > 2.
    52W Quality: new 52-wk high + squeeze + vol z > 2.
    VoV Kink: z(ATR20,200)>0.5 AND z(ATR5,60)<0.
    Turnover Accel: SMA3/SMA20 > 1.8 and |ret z|<1.
    RSI Divergences: compare to n bars back (default 14).
How to use it (playbooks)
A) Daily scan workflow
    Run on Daily for your VN watchlist.
    Turn Composite (Σ) alert on with Σ≥2 or ≥3 to reduce noise.
    When a bar fires Σ (or a fav combo like STL + BB↑), drop to 60-min to time entries.
B) Breakout quality check
    Look for 52W together with BB↑, TAC, and OBV.
    If WER/ND appear near highs → downgrade the breakout.
C) Spring/UTAD reversals
    If SPR fires near major support and RBd confirms → long bias with stop below spring low.
    If UTD + WER/RS↑ near resistance → short/fade with stop above UTAD high.
D) Accumulation basing
    During bases, you want CLS, OBV, TGV, STL, NR7.
    A pocket pivot (PIV) can be your early add; manage risk below base lows.
Tuning tips
    Too many signals? Raise stealthVolZ to 5.5–6, evrVolZ to 3.5, use Σ≥3.
    Fast movers? Lower bbwZthr to −1.0 (less strict squeeze), keep trend filter on.
    Illiquid tickers? Keep MAD z-scores on, increase lookbacks (e.g., lenZ=120).
Limitations & good habits
    First lenZ bars on a new symbol are less reliable (incomplete z-window).
    Some ideas (VWAP magnet, close auction spikes, ETF/foreign flows, options skew) need intraday/external feeds — not included here.
    Pine can’t “screen” across the whole market; set alerts or cycle your watchlist.
Quick troubleshooting
    Compilation errors: make sure you’re on Pine v6; don’t nest functions in if blocks; each var int must be declared on its own line.
    No shapes firing: check trend filter (maybe price is below SMA and you’re waiting for bullish signals), and verify thresholds aren’t too strict.
In den Scripts nach "股价站上60月线" suchen
Range Bar Gaps DetectorRange Bar Gaps Detector
Overview
The Range Bar Gaps Detector identifies price gaps across multiple range bar sizes (12, 24, 60, and 120) on any trading instrument, helping traders spot potential support/resistance zones or breakout opportunities. Designed for Pine Script v6, this indicator detects gaps on range bars and exports data for use in companion scripts like Range Bar Gaps Overlap, making it ideal for multi-timeframe gap analysis.
Key Features
Multi-Range Gap Detection: Identifies gaps on 12, 24, 60, and 120-range bars, capturing both bullish (gap up) and bearish (gap down) price movements.
Customizable Sensitivity: Includes a user-defined minimum deviation (default: 10% of 14-period SMA) for 12-range gaps to filter out noise.
7-Day Lookback: Automatically prunes gaps older than 7 days to focus on recent, relevant price levels.
Data Export: Serializes up to 10 gaps per range (tops, bottoms, start bars, highest/lowest prices, and age) for seamless integration with overlap analysis scripts.
Debugging Support: Plots gap counts and aggregation data in the Data Window for easy verification of detected gaps.
How It Works
The indicator aggregates price movements to simulate higher range bars (24, 60, 120) from a base range bar chart. It detects gaps when the price jumps significantly between bars, ensuring gaps meet the minimum deviation threshold for 12-range bars. Gaps are stored in arrays, serialized for external use, and pruned after 7 days to maintain efficiency.
Usage
Add to your range bar chart (e.g., 12-range) to detect gaps across multiple ranges.
Use alongside the Range Bar Gaps Overlap indicator to visualize gaps and their overlaps as boxes on the chart.
Check the Data Window to confirm gap counts and sizes for each range (12, 24, 60, 120).
Adjust the "Minimal Deviation (%) for 12-Range" input to control gap detection sensitivity.
Settings
Minimal Deviation (%) for 12-Range: Set the minimum gap size for 12-range bars (default: 10% of 14-period SMA).
Range Sizes: Fixed at 24, 60, and 120 for higher range bar aggregation.
Notes
Ensure the script is published under your TradingView username (e.g., GreenArrow2005) for use with companion scripts.
Best used on range bar charts to maintain consistent gap detection.
For advanced overlap analysis, pair with the Range Bar Gaps Overlap indicator to highlight zones where gaps from different ranges align.
Ideal For
Traders seeking to identify key price levels for support/resistance or breakout strategies.
Multi-timeframe analysts combining gap data across various range bar sizes.
Developers building custom indicators that leverage gap data for advanced charting.
Liquid Pulse                           Liquid Pulse by Dskyz (DAFE) Trading Systems 
Liquid Pulse is a trading algo built by Dskyz (DAFE) Trading Systems for futures markets like NQ1!, designed to snag high-probability trades with tight risk control. it fuses a confluence system—VWAP, MACD, ADX, volume, and liquidity sweeps—with a trade scoring setup, daily limits, and VIX pauses to dodge wild volatility. visuals include simple signals, VWAP bands, and a dashboard with stats.
 Core Components  for Liquid Pulse 
Volume Sensitivity (volumeSensitivity) controls how much volume spikes matter for entries. options: 'Low', 'Medium', 'High' default: 'High' (catches small spikes, good for active markets) tweak it: 'Low' for calm markets, 'High' for chaos.
MACD Speed (macdSpeed) sets the MACD’s pace for momentum. options: 'Fast', 'Medium', 'Slow' default: 'Medium' (solid balance) tweak it: 'Fast' for scalping, 'Slow' for swings.
Daily Trade Limit (dailyTradeLimit) caps trades per day to keep risk in check. range: 1 to 30 default: 20 tweak it: 5-10 for safety, 20-30 for action.
Number of Contracts (numContracts) sets position size. range: 1 to 20 default: 4 tweak it: up for big accounts, down for small.
VIX Pause Level (vixPauseLevel) stops trading if VIX gets too hot. range: 10 to 80 default: 39.0 tweak it: 30 to avoid volatility, 50 to ride it.
Min Confluence Conditions (minConditions) sets how many signals must align. range: 1 to 5 default: 2 tweak it: 3-4 for strict, 1-2 for more trades.
Min Trade Score (Longs/Shorts) (minTradeScoreLongs/minTradeScoreShorts) filters trade quality. longs range: 0 to 100 default: 73 shorts range: 0 to 100 default: 75 tweak it: 80-90 for quality, 60-70 for volume.
Liquidity Sweep Strength (sweepStrength) gauges breakouts. range: 0.1 to 1.0 default: 0.5 tweak it: 0.7-1.0 for strong moves, 0.3-0.5 for small.
ADX Trend Threshold (adxTrendThreshold) confirms trends. range: 10 to 100 default: 41 tweak it: 40-50 for trends, 30-35 for weak ones.
ADX Chop Threshold (adxChopThreshold) avoids chop. range: 5 to 50 default: 20 tweak it: 15-20 to dodge chop, 25-30 to loosen.
VWAP Timeframe (vwapTimeframe) sets VWAP period. options: '15', '30', '60', '240', 'D' default: '60' (1-hour) tweak it: 60 for day, 240 for swing, D for long.
Take Profit Ticks (Longs/Shorts) (takeProfitTicksLongs/takeProfitTicksShorts) sets profit targets. longs range: 5 to 100 default: 25.0 shorts range: 5 to 100 default: 20.0 tweak it: 30-50 for trends, 10-20 for chop.
Max Profit Ticks (maxProfitTicks) caps max gain. range: 10 to 200 default: 60.0 tweak it: 80-100 for big moves, 40-60 for tight.
Min Profit Ticks to Trail (minProfitTicksTrail) triggers trailing. range: 1 to 50 default: 7.0 tweak it: 10-15 for big gains, 5-7 for quick locks.
Trailing Stop Ticks (trailTicks) sets trail distance. range: 1 to 50 default: 5.0 tweak it: 8-10 for room, 3-5 for fast locks.
Trailing Offset Ticks (trailOffsetTicks) sets trail offset. range: 1 to 20 default: 2.0 tweak it: 1-2 for tight, 5-10 for loose.
ATR Period (atrPeriod) measures volatility. range: 5 to 50 default: 9 tweak it: 14-20 for smooth, 5-9 for reactive.
 Hardcoded Settings volLookback:  30 ('Low'), 20 ('Medium'), 11 ('High') volThreshold: 1.5 ('Low'), 1.8 ('Medium'), 2 ('High') swingLen: 5
Execution Logic Overview trades trigger when confluence conditions align, entering long or short with set position sizes. exits use dynamic take-profits, trailing stops after a profit threshold, hard stops via ATR, and a time stop after 100 bars.
 Features Multi-Signal Confluence:  needs VWAP, MACD, volume, sweeps, and ADX to line up. 
 Risk Control:  ATR-based stops (capped 15 ticks), take-profits (scaled by volatility), and trails. 
 Market Filters:  VIX pause, ADX trend/chop checks, volatility gates. Dashboard: shows scores, VIX, ADX, P/L, win %, streak.
Visuals Simple signals (green up triangles for longs, red down for shorts) and VWAP bands with glow. info table (bottom right) with MACD momentum. dashboard (top right) with stats.
 Chart and Backtest: 
NQ1! futures, 5-minute chart. works best in trending, volatile conditions. tweak inputs for other markets—test thoroughly.
 Backtesting:  NQ1! Frame: Jan 19, 2025, 09:00 — May 02, 2025, 16:00 Slippage: 3 Commission: $4.60
Fee Typical Range (per side, per contract)
CME Exchange $1.14 – $1.20
Clearing $0.10 – $0.30
NFA Regulatory $0.02
Firm/Broker Commis. $0.25 – $0.80 (retail prop)
TOTAL $1.60 – $2.30 per side
Round Turn: (enter+exit) = $3.20 – $4.60 per contract
Disclaimer this is for education only. past results don’t predict future wins. trading’s risky—only use money you can lose. backtest and validate before going live. (expect moderators to nitpick some random chart symbol rule—i’ll fix and repost if they pull it.)
About the Author Dskyz (DAFE) Trading Systems crafts killer trading algos. Liquid Pulse is pure research and grit, built for smart, bold trading. Use it with discipline. Use it with clarity. Trade smarter. I’ll keep dropping badass strategies ‘til i build a brand or someone signs me up.
2025 Created by Dskyz, powered by DAFE Trading Systems. Trade smart, trade bold.
Constance Brown RSI with Composite IndexConstance Brown RSI with Composite Index 
 Overview 
This indicator combines Constance Brown's RSI interpretation methodology with a Composite Index and ATR Distance to VWAP measurement to provide a comprehensive trading tool. It helps identify trends, momentum shifts, overbought/oversold conditions, and potential reversal points.
 Key Features 
 
 Color-coded RSI zones for immediate trend identification
 Composite Index for momentum analysis and divergence detection
 ATR Distance to VWAP for identifying extreme price deviations
 Automatic divergence detection for early reversal warnings
 Pre-configured alerts for key trading signals
 
 How to Use This Indicator 
 Trend Identification 
The RSI line changes color based on its position:
 
 Blue zone (RSI > 50): Bullish trend - look for buying opportunities
 Purple zone (RSI < 50): Bearish trend - look for selling opportunities
 Gray zone (RSI 40-60): Neutral/transitional market - prepare for potential breakout
 
The 40-50 area (light blue fill) acts as support during uptrends, while the 50-60 area (light purple fill) acts as resistance during downtrends.
// From the code:
 
upTrendZone = rsiValue > 50 and rsiValue <= 90
downTrendZone = rsiValue < 50 and rsiValue >= 10
neutralZone = rsiValue > 40 and rsiValue < 60
rsiColor = neutralZone ? neutralRSI : upTrendZone ? upTrendRSI : downTrendRSI
 
 Momentum Analysis 
The Composite Index (fuchsia line) provides momentum confirmation:
 
 Values above 50 indicate positive momentum
 Values below 40 indicate negative momentum
 Crossing above/below these thresholds signals potential momentum shifts
 
// From the code:
 
compositeIndexRaw = rsiChange / ta.stdev(rsiValue, rsiLength)
compositeIndex = ta.sma(compositeIndexRaw, compositeSmoothing)
compositeScaled = compositeIndex * 10 + 50  // Scaled to fit 0-100 range 
 Overbought/Oversold Detection 
The ATR Distance to VWAP table in the top-right corner shows how far price has moved from VWAP in terms of ATR units:
 
 Extreme positive values (orange/red): Potentially overbought
 Extreme negative values (purple/red): Potentially oversold
 Near zero (gray): Price near average value
 
// From the code:
 
priceDistance = (close - vwapValue) / ta.atr(atrPeriod)
// Color coding based on distance value 
 Divergence Trading 
The indicator automatically detects divergences between the Composite Index and price:
 
 Bullish divergence: Price makes lower low but Composite Index makes higher low
 Bearish divergence: Price makes higher high but Composite Index makes lower high
 
// From the code:
 
divergenceBullish = ta.lowest(compositeIndex, rsiLength) > ta.lowest(close, rsiLength)
divergenceBearish = ta.highest(compositeIndex, rsiLength) < ta.highest(close, rsiLength)
 
 Trading Strategies
Trend Following 
1. Identify the trend using RSI color:
    Blue = Uptrend, Purple = Downtrend
2. Wait for pullbacks to support/resistance zones:
    In uptrends: Buy when RSI pulls back to 40-50 zone and bounces
    In downtrends: Sell when RSI rallies to 50-60 zone and rejects
3. Confirm with Composite Index:
    Uptrends: Composite Index stays above 50 or quickly returns above it
    Downtrends: Composite Index stays below 50 or quickly returns below it
4. Manage risk using ATR Distance:
    Take profits when ATR Distance reaches extreme values
    Place stops beyond recent swing points
 Reversal Trading 
1. Look for divergences
    Bullish: Price makes lower low but Composite Index makes higher low
    Bearish: Price makes higher high but Composite Index makes lower high
2. Confirm with ATR Distance:
    Extreme readings suggest potential reversals
3. Wait for RSI zone transition:
    Bullish: RSI crosses above 40 (purple to neutral/blue)
    Bearish: RSI crosses below 60 (blue to neutral/purple)
4. Enter after confirmation:
    Use candlestick patterns for precise entry
    Place stops beyond the divergence point
 Four pre-configured alerts are available: 
 
 Momentum High: Composite Index above 50
 Momentum Low: Composite Index below 40
 Bullish Divergence: Composite Index higher low
 Bearish Divergence: Composite Index lower high
 
 Customization 
 Adjust these parameters to optimize for your trading style:
 RSI Length: Default 14, lower for more sensitivity, higher for fewer signals
 Composite Index Smoothing: Default 10, lower for quicker signals, higher for less noise
 ATR Period: Default 14, affects the ATR Distance to VWAP calculation
 
This indicator works well across various markets and timeframes, though the default settings are optimized for daily charts. Adjust parameters for shorter or longer timeframes as needed.
Happy trading!
RSI3M3+ v.1.8RSI3M3+ v.1.8 Indicator
This script is an advanced trading indicator based on Walter J. Bressert's cycle analysis methodology, combined with an RSI (Relative Strength Index) variation. Let me break it down and explain how it works.
Core Concepts
The RSI3M3+ indicator combines:
 
 A short-term RSI (3-period)
 A 3-period moving average to smooth the RSI
 Bressert's cycle analysis principles to identify optimal trading points
 RSI3M3+ Indicator VisualizationImage Walter J. Bressert's Cycle Analysis Concepts
 Walter Bressert was a pioneer in cycle analysis trading who believed markets move in cyclical patterns that can be measured and predicted. His key principles integrated into this indicator include:
 
 
 Trading Cycles: Markets move in cycles with measurable time spans from low to low
 Timing Bands: Projected periods when the next cyclical low or high is anticipated
 Oscillator Use: Using oscillators like RSI to confirm cycle position
 Entry/Exit Rules: Specific rules for trade entry and exit based on cycle position
 
 Key Parameters in the Script 
Basic RSI Parameters
 
 Required bars:  Minimum number of bars needed (default: 20)
 Overbought region:  RSI level considered overbought (default: 70)
 Oversold region:  RSI level considered oversold (default: 30)
 
 
Bressert-Specific Parameters 
 Cycle Detection Length:  Lookback period for cycle identification (default: 30)
 Minimum/Maximum Cycle Length:  Expected cycle duration in days (default: 15-30)
 Buy Line:  Lower threshold for buy signals (default: 40)
 Sell Line:  Upper threshold for sell signals (default: 60)
 How the Indicator Works 
 RSI3M3 Calculation: 
 
 Calculates a 3-period RSI (sRSI)
 Smooths it with a 3-period moving average (sMA)
 
Cycle Detection:
 
 Identifies bottoms: When the RSI is below the buy line (40) and starting to turn up
 Identifies tops: When the RSI is above the sell line (60) and starting to turn down
 Records these points to calculate cycle lengths
 
 Timing Bands: 
 
 Projects when the next cycle bottom or top should occur
 Creates visual bands on the chart showing these expected time windows
 
 Signal Generation: 
 
 Buy signals occur when the RSI turns up from below the oversold level (30)
 Sell signals occur when the RSI turns down from above the overbought level (70)
 Enhanced by Bressert's specific timing rules
 
Bressert's Five Trading Rules (Implemented in the Script)
 
 Cycle Timing:  The low must be 15-30 market days from the previous Trading Cycle bottom
 Prior Top Validation:  A Trading Cycle high must have occurred with the oscillator above 60
 Oscillator Behavior:  The oscillator must drop below 40 and turn up
 Entry Trigger:  Entry is triggered by a rise above the price high of the upturn day
 Protective Stop:  Place stop slightly below the Trading Cycle low (implemented as 99% of bottom price)
 
 
How to Use the Indicator
Reading the Chart
 Main Plot Area: 
 
 Green line: 3-period RSI
 Red line: 3-period moving average of the RSI
 Horizontal bands: Oversold (30) and Overbought (70) regions
 Dotted lines: Buy line (40) and Sell line (60)
 Yellow vertical bands: Projected timing windows for next cycle bottom
 
Signals:
 
 Green up arrows: Buy signals
 Red down arrows: Sell signals
 
 Trading Strategy 
For Buy Signals:
 
 Wait for the RSI to drop below the buy line (40)
 Look for an upturn in the RSI from below this level
 Enter the trade when price rises above the high of the upturn day
 Place a protective stop at 99% of the Trading Cycle low
 
 For Sell Signals: 
 
 Wait for the RSI to rise above the sell line (60)
 Look for a downturn in the RSI from above this level
 Consider exiting or taking profits when a sell signal appears
 Alternative exit: When price moves below the low of the downturn day
 
 Cycle Timing Enhancement: 
 
 Pay attention to the yellow timing bands
 Signals occurring within these bands have higher probability of success
 Signals outside these bands may be less reliable
 
 Practical Tips for Using RSI3M3+ 
Timeframe Selection:
 
 The indicator works best on daily charts for intermediate-term trading
 Can be used on weekly charts for longer-term position trading
 On intraday charts, adjust cycle lengths accordingly
 
 
Market Applicability:
 
 Works well in trending markets with clear cyclical behavior
 Less effective in choppy, non-trending markets
 Consider additional indicators for trend confirmation
 
Parameter Adjustment:
 
 Different markets may have different natural cycle lengths
 You may need to adjust the min/max cycle length parameters
 Higher volatility markets may need wider overbought/oversold levels
 
Trade Management:
 
 Enter trades when all Bressert's conditions are met
 Use the protective stop as defined (99% of cycle low)
 Consider taking partial profits at the projected cycle high timing
 
 
Advanced Techniques
Multiple Timeframe Analysis:
 
 Confirm signals with the same indicator on higher timeframes
 Enter in the direction of the larger cycle when smaller and larger cycles align
 
Divergence Detection:
 
 Look for price making new lows while RSI makes higher lows (bullish)
 Look for price making new highs while RSI makes lower highs (bearish)
 
Confluence with Price Action:
 
 Combine with support/resistance levels
 Use with candlestick patterns for confirmation
 Consider volume confirmation of cycle turns
 
This RSI3M3+ indicator combines the responsiveness of a short-term RSI with the predictive power of Bressert's cycle analysis, offering traders a sophisticated tool for identifying high-probability trading opportunities based on market cycles and momentum shifts.
THANK YOU FOR PREVIOUS CODER THAT EFFORT TO CREATE THE EARLIER VERSION THAT MAKE WALTER J BRESSERT CONCEPT IN TRADINGVIEW @ADutchTourist
JL - DWM OHLCThis indicator plots the following price levels on your chart automatically AND will not show up if you are using a timeframe bigger than 60 minutes, 1 day, or 1 week.    
Here are the price levels that are automatically plotted for you, and so you know the styling is different for Daily, Weekly, Monthly levels so you can easily distinguish between them:
- Prior Day:  High / Low / Close
- Current Day: Open 
- Prior Week:  High / Low / Close
- Current Week: Open 
- Prior Month:  High / Low / Close
- Current Month: Open 
These plots are timeframe dependent and will not plot on subsequently higher timeframes, here is how they work:
Daily Price Levels are only shown on timeframes that are smaller than 60 minutes.
Weekly Price Levels are only shown on timeframes smaller than 1 Day.
Monthly Price Levels are only shown on timeframes smaller than 1 Week.
This way, you can turn on the indicator and not have to think about turning off certain price levels if you switch to a larger / longer timeframe than what you typically use.   
For example, Daily OHLC price levels will quickly clutter the 60 minute chart, and likely you don't need to know the HLC of the Prior Day if you are looking at the 60 minute chart.  Therefor it may be helpful to automatically hide the Daily price level plots, and only show the Weekly and Monthly plots on the 60 minute timeframe.
I hope you find this indicator helpful, thanks for reading.
Simultaneous INSIDE Bar Break IndicatorSimultaneous Inside Bar Break Indicator (SIBBI) for The Strat Community
Overview:
The Simultaneous Inside Bar Break Indicator (SIBBI) is designed to help traders using The Strat methodology identify one of the most powerful breakout patterns: the Simultaneous Inside Bar Break across multiple symbols. This indicator detects when all four user-selected symbols form inside bars on the previous candle and then break those inside bars in the same direction (either bullish or bearish) on the current candle.
Inside bars represent consolidation periods where price action does not break the high or low of the previous candle. When a simultaneous break occurs across multiple symbols, this often signals a strong move in the market, making this a key actionable signal in The Strat trading strategy.
Key Features:
Multi-Symbol Analysis: You can track up to four different symbols simultaneously. By default, the indicator comes with SPY, QQQ, IWM, and DIA, but you can modify these to track any other assets or symbols.
Inside Bar Detection: The indicator checks whether all four symbols have inside bars on the previous candle. It only triggers when all symbols meet this condition, making it a highly specific and reliable signal.
Simultaneous Break Detection: Once all symbols have inside bars, the indicator waits for a breakout in the same direction across all four symbols. A simultaneous bullish break (prices breaking above the previous candle’s high) triggers a green label, while a simultaneous bearish break (prices breaking below the previous candle’s low) triggers a red label.
Dynamic Label Timeframe: The indicator dynamically adjusts the timeframe in the label based on the user’s selected timeframe. This allows traders to know precisely which timeframe the break is occurring on. If the user selects "Chart Timeframe," the indicator will evolve with the current chart's timeframe, making it more versatile.
Timeframe Flexibility: The indicator can be set to analyze any timeframe—15-minute, 30-minute, 60-minute, daily, weekly, and so on. It only works for the specific timeframe you set it to in the settings. If set to "Chart Timeframe," the label will adapt dynamically based on the timeframe you are currently viewing.
Customizable Labels: The user can choose the size of the labels (tiny, small, or normal), ensuring that the visual output is tailored to individual preferences and chart layouts.
Best Use Case:
The Simultaneous Inside Bar Break Indicator is particularly powerful when applied to multiple timeframes. Here’s how to use it for maximum impact:
Multi-Timeframe Setup: Set the indicator on various timeframes (e.g., 15-minute, 30-minute, 60-minute, and daily) across multiple charts. This allows you to monitor different timeframes and identify when lower timeframe breaks trigger potential moves on higher timeframes.
Anticipating Strong Moves: When a simultaneous inside bar break occurs on one timeframe (e.g., 30-minute), keep an eye on the higher timeframes (e.g., 60-minute or daily) to see if those timeframes also break. This stacking of inside bar breaks can signal powerful market moves.
Higher Conviction Signals: The indicator is designed to provide high-conviction signals. Since it requires all four symbols to break in the same direction simultaneously, it reduces false signals and focuses on higher probability setups, which is crucial for traders using The Strat to time their trades effectively.
How the Indicator Works:
Inside Bar Formation: The indicator first checks that all four selected symbols had inside bars in the previous bar (i.e., the current high and low are contained within the previous bar’s high and low).
Simultaneous Break Detection: After detecting inside bars, the indicator checks if all four symbols break out in the same direction—bullish (breaking above the previous bar’s high) or bearish (breaking below the previous bar’s low).
Label Display: When a simultaneous inside bar break occurs, a label is plotted on the chart—either green for a bullish break (below the candle) or red for a bearish break (above the candle). The label will display the timeframe you set in the settings (e.g., "IBSB 60" for a 60-minute break).
Chart Timeframe Option: If you prefer, you can set the indicator to evolve with the chart’s current timeframe. In this mode, the label will not show a specific timeframe but will still display the simultaneous inside bar break when it occurs.
Recommendations for Usage:
Focus on Multiple Timeframes: The Strat methodology is all about understanding the relationship between different timeframes. Use this indicator on multiple timeframes to get a better picture of potential moves.
Pair with Other Strat Techniques: This indicator is most powerful when combined with other Strat tools, such as broadening formations, timeframe continuity, and actionable signals (e.g., 2-2 reversals). The simultaneous inside bar break can help confirm or invalidate other signals.
Customize Symbols and Timeframes: Although the default symbols are SPY, QQQ, IWM, and DIA, feel free to replace them with symbols more relevant to your trading. This indicator works well across equities, indices, futures, and forex pairs.
How to Set It Up:
Select Symbols: Choose four symbols that you want to track. These can be index ETFs (like SPY and QQQ), individual stocks, or any other tradable instruments.
Set Timeframe: In the indicator’s settings, choose a specific timeframe (e.g., 15-minute, 30-minute, daily). The label will reflect the selected timeframe, making it clear which time-based break you are seeing.
Optional - Chart Timeframe Mode: If you want the indicator to adapt to the chart’s current timeframe, select the "Chart Timeframe" option in the settings. The indicator will plot the breaks without showing a specific timeframe in the label.
Customize Label Size: Depending on your chart layout and personal preference, you can adjust the size of the labels (tiny, small, or normal) in the settings.
Conclusion:
The Simultaneous Inside Bar Break Indicator is a powerful tool for traders using The Strat methodology, offering a highly specific and reliable signal that can indicate potential large market moves. By monitoring multiple symbols and timeframes, you can gain deeper insight into the market's behavior and act with greater confidence. This indicator is ideal for traders looking to catch high-conviction moves and align their trades with broader market continuity.
Note: The indicator works best when paired with multi-timeframe analysis, allowing you to see how breaks on lower timeframes might influence larger trends. For traders who prefer simplicity, setting it to the "Chart Timeframe" mode offers flexibility while maintaining the core benefits of this indicator. 
Financial Radar Chart by zdmreRadar chart is often used when you want to display data across several unique dimensions. Although there are exceptions, these dimensions are usually quantitative, and typically range from zero to a maximum value. Each dimension’s range is normalized to one another, so that when we draw our spider chart, the length of a line from zero to a dimension’s maximum value will be the similar for every dimension.
This Charts are useful for seeing which variables are scoring high or low within a dataset, making them ideal for displaying performance.
 How is the score formed? 
 Debt Paying Ability 
if Debt_to_Equity < %10 : 100
elif < 20% : 90
elif < 30% : 80
elif < 40% : 70
elif < 50% : 60
elif < 60% : 50
elif < 70% : 40
elif < 80% : 30
elif < 90% : 20
elif < 100% : 10
else: 0
 ROIC 
if Return_on_Invested_Capital > %50 : 100
elif > 40% : 90
elif > 30% : 80
elif > 20% : 70
elif > 10% : 50
elif > 5% : 20
else: 0
 ROE 
if Return_on_Equity > %50 : 100
elif > 40% : 90
elif > 30% : 80
elif > 20% : 70
elif > 10% : 50
elif > 5% : 20
else: 0
 Operating Ability 
if Operating_Margin > %50 : 100
elif > 30% : 90
elif > 20% : 80
elif > 15% : 60
elif > 10% : 40
elif > 0 : 20
else: 0
 EV/EBITDA 
if Enterprise_Value_to_EBITDA < 3 : 100
elif < 5 : 80
elif < 7 : 70
elif < 8 : 60
elif < 10 : 40
elif < 12 : 20
else: 0
 FREE CASH Ability 
if Price_to_Free_Cash_Flow < 5 : 100
elif < 7 : 90
elif < 10 : 80
elif < 16 : 60
elif < 18 : 50
elif < 20 : 40
elif < 22 : 30
elif < 30 : 20
elif < 40 : 15
elif < 50 : 10
elif < 60 : 5
else: 0
 GROWTH Ability 
if Revenue_One_Year_Growth > %20 : 100
elif > 16% : 90
elif > 14% : 80
elif > 12% : 70
elif > 10% : 50
elif > 7% : 40
elif > 4% : 30
elif > 2% : 20
elif > 0 : 10
else: 0
[blackcat] L1 Old Duck HeadLevel 1
Background
The old duck head is a classic form formed by a series of behaviors such as bankers opening positions, washing dishes, and pulling over the top of the duck head.
Function
A form of stock candles:
(1) Moving averages using 5, 10 and 60 parameters. When the 5-day and 10-day moving averages crossed the 60-day moving average, a duck neck was formed.
(2) The high point when the stock price fell back formed a duck head.
(3) When the stock price fell back soon, the 5-day and 10-day moving averages again turned up to form a duckbill.
(4) Duck nose refers to the hole formed when the 5-day moving average crosses the 10-day moving average and the two lines cross again.
Market significance:
(1) When the dealer starts to collect chips, the stock price rises slowly, and the 5-day and 10-day moving averages cross the 60-day moving average, forming a duck neck.
(2) When the stock price of the banker shakes the position and starts to pull back, the high point of the stock price forms the top of the duck's head.
(3) When the dealer builds a position again to collect chips, the stock price rises again, forming a duck bill.
Operation method:
(1) Buy when the 5-day and 10-day moving averages cross the 60-day moving average and form a duck neck.
(2) Buy on dips near the sesame point of trading volume near the duckbill.
(3) Intervene when the stock price crosses the top of the duck's head in heavy volume.
The top of the duck’s head should be a little far away from the 60-day moving average, otherwise it means that the dealer is not willing to open a position at this old duck’s head, and the bottom of the old duck’s head must be heavy. Small is better, nothing is the strongest! There must be a lot of sesame dots under the nostrils of the duck, otherwise it means that the dealer has poor control. There must be ventilation under the duck bill, the higher the ventilation, the better!
Remarks
Feedbacks are appreciated.
Edge of MomentumThe script was designed for the purpose of catching the rocket portion of a move (the edge of momentum).
 Long 
--When RSI closes over 60, take long order 1 tick above that bar. The closed bar above RSI 60 will be colored "green" or whatever color the user chooses. (RSI > 60)
--On a long position, exit will be a closed bar below the ema (low, 10)  .  The closed bar below the ema will be colored "yellow." (Price < ema)
--Note: On a long position there is no need to exit when a closed bar is colored "purple." RSI is just below 60 but above 40. Pullback or chop
 Short 
--When RSI closes below 40, take a short order 1 tick below that bar. The closed bar below RSI 40 will be colored "red." RSI<40)
--On a short position, exit will be a closed bar above the ema (low, 10). The closed bar above the ema will be colored "purple." (Price > ema)
--Note: On a short position there is no need to exit when a closed bar is colored "yellow."
Note: You may see a series of purple and yellow bars, that is simply chop. I define chop as RSI moving between 60 and 40. 
Trade should only be taken above green colored candle(long) and below red colored candle (short). No position should be taken off yellow or purple candle (chop)
Again this is designed to catch the momentum part of a move, and to help reduce some entries during chop. It is a simple systems that beginning traders can use and profit from. 
Note: I don't no shit about coding scripts I just learn from reading others. 
Enjoy. If you decide to use please drop me a line...suggestions/comments, etc. 
Best of luck in all you do. 
3 Duck's Trading System from Babypips.comThe 3 Duck's Trading System from Babypips.com 
The 3 Duck's Trading System is the most popular and active trading system thread on the the babypips.com forum. It is a system that is mainly for beginners because it teaches you discipline, learning to cope with price moving against your position and learning to stay in a trade and keep profits running. For the thread and more info on the  3 Duck's Trading System click here 
 How does it work? 
The system is a very simple enter/exit based on the 60 SMA of 3 different time frames: 4 hour, 1 hour and 5 minute.
 The Rules,  er, the Ducks! The Ducks must all be in a row for a trade to take place! 
 
 Duck 1 - To go long, price must be above the 60 SMA on the 4 hour chart.
 Duck 2 - To go long, price must be above the 60 SMA on the 1 hour chart.
 Duck 3 - To go long, price must cross above the 60 SMA on the 5 minute chart  and  the 60 SMA of the 5 minute chart must be below that of the 4 hour and 1 hour chart. (obviously the reverse for shorting)
 
 YOU MUST USE THIS  SYSTEM ONLY ON THE 5 MINUTE CHART. 
I say this because I have already charted all of the Ducks into the 5 minute chart so you don't have to flip back and forth. 
I have also added some inputs for profit targets, stop targets, trailing stops and times to trade for backtesting. 
If you have any questions or comments, please let me know! If you see I messed up on something, please let me know!
 Also a VERY special thanks to the babypips.com user Captain_Currency . He wrote this strategy 10 years ago (2007 was 10 years ago?!) and he is still active on the thread and posting results and offering help!
VWAP MA HLOC securities Jayy update fix This version replaces previous versions that stopped functioning as a result of a TradingView script update.
 This script complies with the current script syntax.
 for intraday securities default is 9:30 am to 4 pm Eastern Other session choices are provided in the format dialogue box.
 script plots VWAP, yesterday's high, low, open and close (HLOC), the day befores HLOC - if desired, today's open and todays high and low. 
 Also signals inside bars (high is less than or equal to the previous 
 bar's high and the low is greater than or equal to 
 the previous low) the : true inside bars have a maroon triangle below the bar as well as a ">" above the bar. 
 If subsequent bars are inside the last bar before the last true inside bar they also are marked with an ">" 
 Also plots the 20 ema for different time periods (as per Al Brooks),  If you trade the 5 min then you will
 likely be interested in the 20 ema for 15 mins and 60 mins
 the following is a list of the higher timeframe  20 emas
 1 minute 5, 15, 60 period 20 ema
 5 minute  15, 60 period 20 ema
 15 minute 60, 120 , 240 period 20 ema
 60 minute 120, 240 period 20 ema
 120 minute 240, D period 20 ema
 240 minute D period 20 ema
 Jayy
🔥 QUANT MOMENTUM SKORQUANT MOMENTUM SCORE – Description (EN)
Summary: This indicator fuses Price ROC, RSI, MACD, Trend Strength (ADX+EMA) and Volume into a single 0-100 “Momentum Score.” Guide bands (50/60/70/80) and ready-to-use alert conditions are included. 
How it works
Price Momentum (ROC): Rate of change normalized to 0-100.
RSI Momentum: RSI treated as a momentum proxy and mapped to 0-100.
MACD Momentum: MACD histogram normalized to capture acceleration.
Trend Strength: ADX is direction-aware (DI+ vs DI–) and blended with EMA state (above/below) to form a combined trend score.
Volume Momentum: Volume relative to its moving average (ratio-based).
Weighting: All five components are weighted, auto-normalized, and summed into the final 0-100 score.
Visuals & Alerts: Score line with 50/60/70/80 guides; threshold-cross alerts for High/Strong/Ultra-Strong regimes. 
Inputs, weights and thresholds are configurable; total weights are normalized automatically. 
How to use
Timeframes: Works on any timeframe—lower TFs react faster; higher TFs reduce noise.
Reading the score:
<50: Weak momentum
50-60: Transition
60-70: Moderate-Strong (potential acceleration)
≥70: Strong, ≥80: Ultra Strong
Practical tip: Use it as a filter, not a stand-alone signal. Combine score breakouts with market structure/trend context (e.g., pullback-then-re-acceleration) to improve selectivity.
Disclaimer: This is not financial advice; past performance does not guarantee future results.
Historical Matrix Analyzer [PhenLabs]📊Historical Matrix Analyzer  
 Version:  PineScriptv6
 📌Description 
The Historical Matrix Analyzer is an advanced probabilistic trading tool that transforms technical analysis into a data-driven decision support system. By creating a comprehensive 56-cell matrix that tracks every combination of RSI states and multi-indicator conditions, this indicator reveals which market patterns have historically led to profitable outcomes and which have not.
At its core, the indicator continuously monitors seven distinct RSI states (ranging from Extreme Oversold to Extreme Overbought) and eight unique indicator combinations (MACD direction, volume levels, and price momentum). For each of these 56 possible market states, the system calculates average forward returns, win rates, and occurrence counts based on your configurable lookback period. The result is a color-coded probability matrix that shows you exactly where you stand in the historical performance landscape.
The standout feature is the Current State Panel, which provides instant clarity on your active market conditions. This panel displays signal strength classifications (from Strong Bullish to Strong Bearish), the average return percentage for similar past occurrences, an estimated win rate using Bayesian smoothing to prevent small-sample distortions, and a confidence level indicator that warns you when insufficient data exists for reliable conclusions.
 🚀Points of Innovation 
 
 Multi-dimensional state classification combining 7 RSI levels with 8 indicator combinations for 56 unique trackable market conditions
 Bayesian win rate estimation with adjustable smoothing strength to provide stable probability estimates even with limited historical samples
 Real-time active cell highlighting with “NOW” marker that visually connects current market conditions to their historical performance data
 Configurable color intensity sensitivity allowing traders to adjust heat-map responsiveness from conservative to aggressive visual feedback
 Dual-panel display system separating the comprehensive statistics matrix from an easy-to-read current state summary panel
 Intelligent confidence scoring that automatically warns traders when occurrence counts fall below reliable thresholds
 
 🔧Core Components 
 
 RSI State Classification:  Segments RSI readings into 7 distinct zones (Extreme Oversold <20, Oversold 20-30, Weak 30-40, Neutral 40-60, Strong 60-70, Overbought 70-80, Extreme Overbought >80) to capture momentum extremes and transitions
 Multi-Indicator Condition Tracking:  Simultaneously monitors MACD crossover status (bullish/bearish), volume relative to moving average (high/low), and price direction (rising/falling) creating 8 binary-encoded combinations
 Historical Data Storage Arrays:  Maintains rolling lookback windows storing RSI states, indicator states, prices, and bar indices for precise forward-return calculations
 Forward Performance Calculator:  Measures price changes over configurable forward bar periods (1-20 bars) from each historical state, accumulating total returns and win counts per matrix cell
 Bayesian Smoothing Engine:  Applies statistical prior assumptions (default 50% win rate) weighted by user-defined strength parameter to stabilize estimated win rates when sample sizes are small
 Dynamic Color Mapping System:  Converts average returns into color-coded heat map with intensity adjusted by sensitivity parameter and transparency modified by confidence levels
 
 🔥Key Features 
 
 56-Cell Probability Matrix:  Comprehensive grid displaying every possible combination of RSI state and indicator condition, with each cell showing average return percentage, estimated win rate, and occurrence count for complete statistical visibility
 Current State Info Panel:  Dedicated display showing your exact position in the matrix with signal strength emoji indicators, numerical statistics, and color-coded confidence warnings for immediate situational awareness
 Customizable Lookback Period:  Adjustable historical window from 50 to 500 bars allowing traders to focus on recent market behavior or capture longer-term pattern stability across different market cycles
 Configurable Forward Performance Window:  Select target holding periods from 1 to 20 bars ahead to align probability calculations with your trading timeframe, whether day trading or swing trading
 Visual Heat Mapping:  Color-coded cells transition from red (bearish historical performance) through gray (neutral) to green (bullish performance) with intensity reflecting statistical significance and occurrence frequency
 Intelligent Data Filtering:  Minimum occurrence threshold (1-10) removes unreliable patterns with insufficient historical samples, displaying gray warning colors for low-confidence cells
 Flexible Layout Options:  Independent positioning of statistics matrix and info panel to any screen corner, accommodating different chart layouts and personal preferences
 Tooltip Details:  Hover over any matrix cell to see full RSI label, complete indicator status description, precise average return, estimated win rate, and total occurrence count
 
 🎨Visualization 
 
 Statistics Matrix Table:  A 9-column by 8-row grid with RSI states labeling vertical axis and indicator combinations on horizontal axis, using compact abbreviations (XOverS, OverB, MACD↑, Vol↓, P↑) for space efficiency
 Active Cell Indicator:  The current market state cell displays “⦿ NOW ⦿” in yellow text with enhanced color saturation to immediately draw attention to relevant historical performance
 Signal Strength Visualization:  Info panel uses emoji indicators (🔥 Strong Bullish, ✅ Bullish, ↗️ Weak Bullish, ➖ Neutral, ↘️ Weak Bearish, ⛔ Bearish, ❄️ Strong Bearish, ⚠️ Insufficient Data) for rapid interpretation
 Histogram Plot:  Below the price chart, a green/red histogram displays the current cell’s average return percentage, providing a time-series view of how historical performance changes as market conditions evolve
 Color Intensity Scaling:  Cell background transparency and saturation dynamically adjust based on both the magnitude of average returns and the occurrence count, ensuring visual emphasis on reliable patterns
 Confidence Level Display:  Info panel bottom row shows “High Confidence” (green), “Medium Confidence” (orange), or “Low Confidence” (red) based on occurrence counts relative to minimum threshold multipliers
 
 📖Usage Guidelines 
 RSI Period 
 
 Default: 14
 Range: 1 to unlimited
 Description: Controls the lookback period for RSI momentum calculation. Standard 14-period provides widely-recognized overbought/oversold levels. Decrease for faster, more sensitive RSI reactions suitable for scalping. Increase (21, 28) for smoother, longer-term momentum assessment in swing trading. Changes affect how quickly the indicator moves between the 7 RSI state classifications.
 
 MACD Fast Length 
 
 Default: 12
 Range: 1 to unlimited
 Description: Sets the faster exponential moving average for MACD calculation. Standard 12-period setting works well for daily charts and captures short-term momentum shifts. Decreasing creates more responsive MACD crossovers but increases false signals. Increasing smooths out noise but delays signal generation, affecting the bullish/bearish indicator state classification.
 
 MACD Slow Length 
 
 Default: 26
 Range: 1 to unlimited
 Description: Defines the slower exponential moving average for MACD calculation. Traditional 26-period setting balances trend identification with responsiveness. Must be greater than Fast Length. Wider spread between fast and slow increases MACD sensitivity to trend changes, impacting the frequency of indicator state transitions in the matrix.
 
 MACD Signal Length 
 
 Default: 9
 Range: 1 to unlimited
 Description: Smoothing period for the MACD signal line that triggers bullish/bearish state changes. Standard 9-period provides reliable crossover signals. Shorter values create more frequent state changes and earlier signals but with more whipsaws. Longer values produce more confirmed, stable signals but with increased lag in detecting momentum shifts.
 
 Volume MA Period 
 
 Default: 20
 Range: 1 to unlimited
 Description: Lookback period for volume moving average used to classify volume as “high” or “low” in indicator state combinations. 20-period default captures typical monthly trading patterns. Shorter periods (10-15) make volume classification more reactive to recent spikes. Longer periods (30-50) require more sustained volume changes to trigger state classification shifts.
 
 Statistics Lookback Period 
 
 Default: 200
 Range: 50 to 500
 Description: Number of historical bars used to calculate matrix statistics. 200 bars provides substantial data for reliable patterns while remaining responsive to regime changes. Lower values (50-100) emphasize recent market behavior and adapt quickly but may produce volatile statistics. Higher values (300-500) capture long-term patterns with stable statistics but slower adaptation to changing market dynamics.
 
 Forward Performance Bars 
 
 Default: 5
 Range: 1 to 20
 Description: Number of bars ahead used to calculate forward returns from each historical state occurrence. 5-bar default suits intraday to short-term swing trading (5 hours on hourly charts, 1 week on daily charts). Lower values (1-3) target short-term momentum trades. Higher values (10-20) align with position trading and longer-term pattern exploitation.
 
 Color Intensity Sensitivity 
 
 Default: 2.0
 Range: 0.5 to 5.0, step 0.5
 Description: Amplifies or dampens the color intensity response to average return magnitudes in the matrix heat map. 2.0 default provides balanced visual emphasis. Lower values (0.5-1.0) create subtle coloring requiring larger returns for full saturation, useful for volatile instruments. Higher values (3.0-5.0) produce vivid colors from smaller returns, highlighting subtle edges in range-bound markets.
 
 Minimum Occurrences for Coloring 
 
 Default: 3
 Range: 1 to 10
 Description: Required minimum sample size before applying color-coded performance to matrix cells. Cells with fewer occurrences display gray “insufficient data” warning. 3-occurrence default filters out rare patterns. Lower threshold (1-2) shows more data but includes unreliable single-event statistics. Higher thresholds (5-10) ensure only well-established patterns receive visual emphasis.
 
 Table Position 
 
 Default: top_right
 Options: top_left, top_right, bottom_left, bottom_right
 Description: Screen location for the 56-cell statistics matrix table. Position to avoid overlapping critical price action or other indicators on your chart. Consider chart orientation and candlestick density when selecting optimal placement.
 
 Show Current State Panel 
 
 Default: true
 Options: true, false
 Description: Toggle visibility of the dedicated current state information panel. When enabled, displays signal strength, RSI value, indicator status, average return, estimated win rate, and confidence level for active market conditions. Disable to declutter charts when only the matrix table is needed.
 
 Info Panel Position 
 
 Default: bottom_left
 Options: top_left, top_right, bottom_left, bottom_right
 Description: Screen location for the current state information panel (when enabled). Position independently from statistics matrix to optimize chart real estate. Typically placed opposite the matrix table for balanced visual layout.
 
 Win Rate Smoothing Strength 
 
 Default: 5
 Range: 1 to 20
 Description: Controls Bayesian prior weighting for estimated win rate calculations. Acts as virtual sample size assuming 50% win rate baseline. Default 5 provides moderate smoothing preventing extreme win rate estimates from small samples. Lower values (1-3) reduce smoothing effect, allowing win rates to reflect raw data more directly. Higher values (10-20) increase conservatism, pulling win rate estimates toward 50% until substantial evidence accumulates.
 
 ✅Best Use Cases 
 
 Pattern-based discretionary trading where you want historical confirmation before entering setups that “look good” based on current technical alignment
 Swing trading with holding periods matching your forward performance bar setting, using high-confidence bullish cells as entry filters
 Risk assessment and position sizing, allocating larger size to trades originating from cells with strong positive average returns and high estimated win rates
 Market regime identification by observing which RSI states and indicator combinations are currently producing the most reliable historical patterns
 Backtesting validation by comparing your manual strategy signals against the historical performance of the corresponding matrix cells
 Educational tool for developing intuition about which technical condition combinations have actually worked versus those that feel right but lack historical evidence
 
 ⚠️Limitations 
 
 Historical patterns do not guarantee future performance, especially during unprecedented market events or regime changes not represented in the lookback period
 Small sample sizes (low occurrence counts) produce unreliable statistics despite Bayesian smoothing, requiring caution when acting on low-confidence cells
 Matrix statistics lag behind rapidly changing market conditions, as the lookback period must accumulate new state occurrences before updating performance data
 Forward return calculations use fixed bar periods that may not align with actual trade exit timing, support/resistance levels, or volatility-adjusted profit targets
 
 💡What Makes This Unique 
 
 Multi-Dimensional State Space:  Unlike single-indicator tools, simultaneously tracks 56 distinct market condition combinations providing granular pattern resolution unavailable in traditional technical analysis
 Bayesian Statistical Rigor:  Implements proper probabilistic smoothing to prevent overconfidence from limited data, a critical feature missing from most pattern recognition tools
 Real-Time Contextual Feedback:  The “NOW” marker and dedicated info panel instantly connect current market conditions to their historical performance profile, eliminating guesswork
 Transparent Occurrence Counts:  Displays sample sizes directly in each cell, allowing traders to judge statistical reliability themselves rather than hiding data quality issues
 Fully Customizable Analysis Window:  Complete control over lookback depth and forward return horizons lets traders align the tool precisely with their trading timeframe and strategy requirements
 
 🔬How It Works 
 1. State Classification and Encoding 
 
 Each bar’s RSI value is evaluated and assigned to one of 7 discrete states based on threshold levels (0: <20, 1: 20-30, 2: 30-40, 3: 40-60, 4: 60-70, 5: 70-80, 6: >80)
 Simultaneously, three binary conditions are evaluated: MACD line position relative to signal line, current volume relative to its moving average, and current close relative to previous close
 These three binary conditions are combined into a single indicator state integer (0-7) using binary encoding, creating 8 possible indicator combinations
 The RSI state and indicator state are stored together, defining one of 56 possible market condition cells in the matrix
 
 2. Historical Data Accumulation 
 
 As each bar completes, the current state classification, closing price, and bar index are stored in rolling arrays maintained at the size specified by the lookback period
 When the arrays reach capacity, the oldest data point is removed and the newest added, creating a sliding historical window
 This continuous process builds a comprehensive database of past market conditions and their subsequent price movements
 
 3. Forward Return Calculation and Statistics Update 
 
 On each bar, the indicator looks back through the stored historical data to find bars where sufficient forward bars exist to measure outcomes
 For each historical occurrence, the price change from that bar to the bar N periods ahead (where N is the forward performance bars setting) is calculated as a percentage return
 This percentage return is added to the cumulative return total for the specific matrix cell corresponding to that historical bar’s state classification
 Occurrence counts are incremented, and wins are tallied for positive returns, building comprehensive statistics for each of the 56 cells
 The Bayesian smoothing formula combines these raw statistics with prior assumptions (neutral 50% win rate) weighted by the smoothing strength parameter to produce estimated win rates that remain stable even with small samples
 
 💡Note: 
The Historical Matrix Analyzer is designed as a decision support tool, not a standalone trading system. Best results come from using it to validate discretionary trade ideas or filter systematic strategy signals. Always combine matrix insights with proper risk management, position sizing rules, and awareness of broader market context. The estimated win rate feature uses Bayesian statistics specifically to prevent false confidence from limited data, but no amount of smoothing can create reliable predictions from fundamentally insufficient sample sizes. Focus on high-confidence cells (green-colored confidence indicators) with occurrence counts well above your minimum threshold for the most actionable insights.
15-Min RSI Scalper [SwissAlgo]15-Min RSI Scalper  
 Tracks RSI Momentum Loss and Gain to Generate Signals 
-------------------------------------------------------
 WHAT THIS INDICATOR CALCULATES 
This indicator attempts to identify  RSI directional changes   (RSI momentum) using a step-by-step "ladder" method. It reads RSI(14) from the next higher timeframe relative to your chart. On a 15-minute chart, it uses 1-hour RSI. On a 5-minute chart, it uses 15-minute RSI, and so on.
 How the ladder logic works: 
The indicator doesn't track RSI all the time. It only starts tracking when RSI crosses into potentially extreme territory (these are called "events" in the code):
 
 For sell signals : when RSI crosses above a dynamic upper threshold (typically between 60-80, calculated as the 90th percentile of recent RSI)
 For buy signals : when RSI crosses below a dynamic lower threshold (typically between 20-40, calculated as the 10th percentile of recent RSI)
 
Once tracking begins, RSI movement is divided into 2-point steps (boxes). The indicator counts how many boxes RSI climbs or falls.
A signal generates only when:
 
 RSI reverses direction by at least 2 boxes (4 RSI points) from its extreme
 RSI holds that reversal for 3 consecutive confirmed bars
 
 Example:  Dynamic threshold is at 68. RSI crosses above 68 → tracking starts. RSI climbs to 76 (4 boxes up). Then it drops back to 72 and stays below that level for 3 bars → sell signal prints. The buy signal works the same way in reverse.
-------------------------------------------------------
 SIGNAL GENERATION METHODOLOGY 
 Sell Signal (Red Triangle) 
 
 RSI crosses above a dynamic start level (calculated as the 90th percentile of the last 1000 bars, constrained between 60-80)
 Indicator tracks upward progression in 2-point boxes
 RSI reverses and drops below a boundary 2 boxes below the highest box reached
 RSI remains below that boundary for 3 confirmed bars
 Red triangle plots above price
 
Reset condition: RSI returns below 50
 Buy Signal (Green Triangle) 
 
 RSI crosses below a dynamic start level (10th percentile of last 1000 bars, constrained between 20-40)
 Indicator tracks downward progression in 2-point boxes
 RSI reverses and rises above a boundary 2 boxes above the lowest box reached
 RSI remains above that boundary for 3 confirmed bars
 Green triangle plots below price
 
Reset condition: RSI returns above 50
-------------------------------------------------------
 TECHNICAL PARAMETERS 
All parameters are hardcoded:
 
 RSI Period: 14
 Box Size: 2 RSI points
 Reversal Threshold: 2 boxes (4 RSI points)
 Confirmation Period: 3 bars
 Reset Level: RSI 50
 Sell Start Range: 60-80 (dynamic)
 Buy Start Range: 20-40 (dynamic)
 Lookback for Percentile: 1000 bars
 
 Note:  Since the code is open source, users can modify these hardcoded values directly in the script to adjust sensitivity. For example, increasing the confirmation period from 3 to 5 bars will produce fewer but more conservative signals. Decreasing the box size from 2 to 1 will make the indicator more responsive to smaller RSI movements.
-------------------------------------------------------
 KEY FEATURES 
 Automatic Higher Timeframe RSI 
When applied to a 15-minute chart, the indicator automatically reads 1-hour RSI data. This is the next standard timeframe above 15 minutes in the indicator's logic.
 Dynamic Adaptive Start Levels 
Sell signals use the 90th percentile of RSI over the last 1000 bars, constrained between 60-80. Buy signals use the 10th percentile, constrained between 20-40. These thresholds recalculate on each bar based on recent data.
 Ladder Box System 
RSI movements are tracked in 2-point boxes. The indicator requires a 2-box reversal followed by 3 consecutive bars maintaining that reversal before generating a signal.
 Dual Signal Output 
Red down-triangles plot above price when the sell signal conditions are met. Green up-triangles plot below the price when buy signal conditions are met.
-------------------------------------------------------
 REPAINTING 
This indicator does not repaint. All calculations use "barstate.isconfirmed" to ensure signals appear only on closed bars. The request.security() call uses lookahead=barmerge.lookahead_off to prevent forward-looking bias.
-------------------------------------------------------
 INTENDED CHART TIMEFRAME 
This indicator is designed for use on 15-minute charts. The visual reminder table at the top of the chart indicates this requirement.
On a 15-minute chart:
 
 RSI data comes from the 1-hour timeframe
 Signals reflect 1-hour momentum shifts
 3-bar confirmation equals 45 minutes of price action
 
Using it on other timeframes will change the higher timeframe RSI source and may produce different behavior.
-------------------------------------------------------
 WHAT THIS INDICATOR DOES NOT DO 
 
 Does not predict future price movements
 Does not provide entry or exit advice
 Does not guarantee profitable trades
 Does not replace comprehensive technical analysis
 Does not account for fundamental factors, news events, or market structure
 Does not adapt to all market conditions equally
 
-------------------------------------------------------
 EDUCATIONAL USE 
This indicator demonstrates one approach to momentum reversal detection using:
 
 Multi-timeframe analysis
 Adaptive thresholds via percentile calculation
 Step-wise momentum tracking
 Multi-bar confirmation logic
 
It is designed as a technical study, not a trading system. Signals represent calculated conditions based on RSI behavior, not trade recommendations. Always do your own analysis before taking market positions.
-------------------------------------------------------
 RISK DISCLOSURE 
Trading involves substantial risk of loss. This indicator:
 
 Is for educational and informational purposes only
 Does not constitute financial, investment, or trading advice
 Should not be used as the sole basis for trading decisions
 Has not been tested across all market conditions
 May produce false signals, late signals, or no signals in certain conditions
 
Past performance of any indicator does not predict future results. Users must conduct their own analysis and risk assessment before making trading decisions. Always use proper risk management, including stop losses and position sizing appropriate to your account and risk tolerance.
 MIT LICENSE 
This code is open source and provided as-is without warranties of any kind. You may use, modify, and distribute it freely under the MIT License.
Momentum Shift Oscillator (MSO) [SharpStrat]Momentum Shift Oscillator (MSO)  
The Momentum Shift Oscillator (MSO) is a custom-built oscillator that combines the best parts of RSI, ROC, and MACD into one clean, powerful indicator. Its goal is to identify when momentum shifts are happening in the market, filtering out noise that a single momentum tool might miss.
 Why MSO? 
Most traders rely on just one momentum indicator like RSI, MACD, or ROC. Each has strengths, but also weaknesses:
 
 RSI → great for overbought/oversold, but often lags in strong trends.
 ROC (Rate of Change) → captures price velocity, but can be too noisy.
 MACD Histogram → shows trend strength shifts, but reacts slowly at times.
 
By blending all three (with adjustable weights), MSO gives a balanced view of momentum. It captures trend strength, velocity, and exhaustion in one oscillator.
 How MSO Works 
Inputs: 
 RSI, ROC, and MACD Histogram are calculated with user-defined lengths.
 Each is normalized (so they share the same scale of -100 to +100).
 You can set weights for RSI, ROC, and MACD to emphasize different components.
 
 The components are blended into a single oscillator value.
 Smoothing (SMA, EMA, or WMA) is applied.
 MSO plots as a smooth line, color-coded by slope (green rising, red falling).
 Overbought and oversold levels are plotted (default: +60 / -60).
 A zero line helps identify bullish vs bearish momentum shifts.
 
 How to trade with MSO 
 Zero line crossovers → crossing above zero suggests bullish momentum; crossing below zero suggests bearish momentum.
 Overbought and oversold zones → values above +60 may indicate exhaustion in bullish moves; values below -60 may signal exhaustion in bearish moves.
 Slope of the line → a rising line shows strengthening momentum, while a falling line signals fading momentum.
 Divergences → if price makes new highs or lows but MSO does not, it can point to a possible reversal.
 
 Why MSO is Unique 
 Combines trend + momentum + velocity into one view.
 Filters noise better than standalone RSI/MACD.
 Adapts to both trend-following and mean-reversion styles.
 Can be used across any timeframe for confirmation.
EvoTrend-X Indicator — Evolutionary Trend Learner ExperimentalEvoTrend-X Indicator — Evolutionary Trend Learner
NOTE: This is an experimental Pine Script v6 port of a Python prototype. Pine wasn’t the original research language, so there may be small quirks—your feedback and bug reports are very welcome. The model is non-repainting, MTF-safe (lookahead_off + gaps_on), and features an adaptive (fitness-based) candidate selector, confidence gating, and a volatility filter.
⸻
What it is
EvoTrend-X is adaptive trend indicator that learns which moving-average length best fits the current market. It maintains a small “population” of fast EMA candidates, rewards those that align with price momentum, and continuously selects the best performer. Signals are gated by a multi-factor Confidence score (fitness, strength vs. ATR, MTF agreement) and a volatility filter (ATR%). You get a clean Fast/Slow pair (for the currently best candidate), optional HTF filter, a fitness ribbon for transparency, and a themed info panel with a one-glance STATUS readout.
Core outputs
	•	Selected Fast/Slow EMAs (auto-chosen from candidates via fitness learning)
	•	Spread cross (Fast – Slow) → visual BUY/SELL markers + alert hooks
	•	Confidence % (0–100): Fitness ⊕ Distance vs. ATR ⊕ MTF agreement
	•	Gates: Trend regime (Kaufman ER), Volatility (ATR%), MTF filter (optional)
	•	Candidate Fitness Ribbon: shows which lengths the learner currently prefers
	•	Export plot: hidden series “EvoTrend-X Export (spread)” for downstream use
⸻
Why it’s different
	•	Evolutionary learning (on-chart): Each candidate EMA length gets rewarded if its slope matches price change and penalized otherwise, with a gentle decay so the model forgets stale regimes. The best fitness wins the right to define the displayed Fast/Slow pair.
	•	Confidence gate: Signals don’t light up unless multiple conditions concur: learned fitness, spread strength vs. volatility, and (optionally) higher-timeframe trend.
	•	Volatility awareness: ATR% filter blocks low-energy environments that cause death-by-a-thousand-whipsaws. Your “why no signal?” answer is always visible in the STATUS.
	•	Preset discipline, Custom freedom: Presets set reasonable baselines for FX, equities, and crypto; Custom exposes all knobs and honors your inputs one-to-one.
	•	Non-repainting rigor: All MTF calls use lookahead_off + gaps_on. Decisions use confirmed bars. No forward refs. No conditional ta.* pitfalls.
⸻
Presets (and what they do)
	•	FX 1H (Conservative): Medium candidates, slightly higher MinConf, modest ATR% floor. Good for macro sessions and cleaner swings.
	•	FX 15m (Active): Shorter candidates, looser MinConf, higher ATR% floor. Designed for intraday velocity and decisive sessions.
	•	Equities 1D: Longer candidates, gentler volatility floor. Suits index/large-cap trend waves.
	•	Crypto 1H: Mid-short candidates, higher ATR% floor for 24/7 chop, stronger MinConf to avoid noise.
	•	Custom: Your inputs are used directly (no override). Ideal for systematic tuning or bespoke assets.
⸻
How the learning works (at a glance)
	1.	Candidates: A small set of fast EMA lengths (e.g., 8/12/16/20/26/34). Slow = Fast × multiplier (default ×2.0).
	2.	Reward/decay: If price change and the candidate’s Fast slope agree (both up or both down), its fitness increases; otherwise decreases. A decay constant slowly forgets the distant past.
	3.	Selection: The candidate with highest fitness defines the displayed Fast/Slow pair.
	4.	Signal engine: Crosses of the spread (Fast − Slow) across zero mark potential regime shifts. A Confidence score and gates decide whether to surface them.
⸻
Controls & what they mean
Learning / Regime
	•	Slow length = Fast ×: scales the Slow EMA relative to each Fast candidate. Larger multiplier = smoother regime detection, fewer whipsaws.
	•	ER length / threshold: Kaufman Efficiency Ratio; above threshold = “Trending” background.
	•	Learning step, Decay: Larger step reacts faster to new behavior; decay sets how quickly the past is forgotten.
Confidence / Volatility gate
	•	Min Confidence (%): Minimum score to show signals (and fire alerts). Raising it filters noise; lowering it increases frequency.
	•	ATR length: The ATR window for both the ATR% filter and strength normalization. Shorter = faster, but choppier.
	•	Min ATR% (percent): ATR as a percentage of price. If ATR% < Min ATR% → status shows BLOCK: low vola.
MTF Trend Filter
	•	Use HTF filter / Timeframe / Fast & Slow: HTF Fast>Slow for longs, Fast threshold; exit when spread flips or Confidence decays below your comfort zone.
2) FX index/majors, 15m (active intraday)
	•	Preset: FX 15m (Active).
	•	Gate: MinConf 60–70; Min ATR% 0.15–0.30.
	•	Flow: Focus on session opens (LDN/NY). The ribbon should heat up on shorter candidates before valid crosses appear—good early warning.
3) SPY / Index futures, 1D (positioning)
	•	Preset: Equities 1D.
	•	Gate: MinConf 55–65; Min ATR% 0.05–0.12.
	•	Flow: Use spread crosses as regime flags; add timing from price structure. For adds, wait for ER to remain trending across several bars.
4) BTCUSD, 1H (24/7)
	•	Preset: Crypto 1H.
	•	Gate: MinConf 70–80; Min ATR% 0.20–0.35.
	•	Flow: Crypto chops—volatility filter is your friend. When ribbon and HTF OK agree, favor continuation entries; otherwise stand down.
⸻
Reading the Info Panel (and fixing “no signals”)
The panel is your self-diagnostic:
	•	HTF OK? False means the higher-timeframe EMAs disagree with your intended side.
	•	Regime: If “Chop”, ER < threshold. Consider raising the threshold or waiting.
	•	Confidence: Heat-colored; if below MinConf, the gate blocks signals.
	•	ATR% vs. Min ATR%: If ATR% < Min ATR%, status shows BLOCK: low vola.
	•	STATUS (composite):
	•	BLOCK: low vola → increase Min ATR% down (i.e., allow lower vol) or wait for expansion.
	•	BLOCK: HTF filter → disable HTF or align with the HTF tide.
	•	BLOCK: confidence → lower MinConf slightly or wait for stronger alignment.
	•	OK → you’ll see markers on valid crosses.
⸻
Alerts
Two static alert hooks:
	•	BUY cross — spread crosses up and all gates (ER, Vol, MTF, Confidence) are open.
	•	SELL cross — mirror of the above.
Create them once from “Add Alert” → choose the condition by name.
⸻
Exporting to other scripts
In your other Pine indicators/strategies, add an input.source and select EvoTrend-X → “EvoTrend-X Export (spread)”. Common uses:
	•	Build a rule: only trade when exported spread > 0 (trend filter).
	•	Combine with your oscillator: oscillator oversold and spread > 0 → buy bias.
⸻
Best practices
	•	Let it learn: Keep Learning step moderate (0.4–0.6) and Decay close to 1.0 (e.g., 0.99–0.997) for smooth regime memory.
	•	Respect volatility: Tune Min ATR% by asset and timeframe. FX 1H ≈ 0.10–0.20; crypto 1H ≈ 0.20–0.35; equities 1D ≈ 0.05–0.12.
	•	MTF discipline: HTF filter removes lots of “almost” trades. If you prefer aggressive entries, turn it off and rely more on Confidence.
	•	Confidence as throttle:
	•	40–60%: exploratory; expect more signals.
	•	60–75%: balanced; good daily driver.
	•	75–90%: selective; catch the clean stuff.
	•	90–100%: only A-setups; patient mode.
	•	Watch the ribbon: When shorter candidates heat up before a cross, momentum is forming. If long candidates dominate, you’re in a slower trend cycle.
⸻
Non-repainting & safety notes
	•	All request.security() calls use lookahead=barmerge.lookahead_off, gaps=barmerge.gaps_on.
	•	No forward references; decisions rely on confirmed bar data.
	•	EMA lengths are simple ints (no series-length errors).
	•	Confidence components are computed every bar (no conditional ta.* traps).
⸻
Limitations & tips
	•	Chop happens: ER helps, but sideways microstructure can still flicker—use Confidence + Vol filter as brakes.
	•	Presets ≠ oracle: They’re sensible baselines; always tune MinConf and Min ATR% to your venue and session.
	•	Theme “Auto”: Pine cannot read chart theme; “Auto” defaults to a Dark-friendly palette.
⸻
Publisher’s Screenshots Checklist 
1) FX swing — EURUSD 1H
	•	Preset: FX 1H (Conservative)
	•	Params: MinConf=70, ATR Len=14, Min ATR%=0.12, MTF ON (TF=4H, 20/50)
	•	Show: Clear BUY cross, STATUS=OK, green regime background; Fitness Ribbon visible.
  
2) FX intraday — GBPUSD 15m 
	•	Preset: FX 15m (Active)
	•	Params: MinConf=60, ATR Len=14, Min ATR%=0.20, MTF ON (TF=60m)
	•	Show: SELL cross near London session open. HTF lines enabled (translucent).
	•	Caption: “GBPUSD 15m • Active session sell with MTF alignment.”
  
3) Indices — SPY 1D 
	•	Preset: Equities 1D
	•	Params: MinConf=60, ATR Len=14, Min ATR%=0.08, MTF ON (TF=1W, 20/50)
	•	Show: Longer trend run after BUY cross; regime shading shows persistence.
	•	Caption: “SPY 1D • Trend run after BUY cross; weekly filter aligned.”
  
4) Crypto — BINANCE:BTCUSDT 1H
	•	Preset: Crypto 1H
	•	Params: MinConf=75, ATR Len=14, Min ATR%=0.25, MTF ON (TF=4H)
	•	Show: BUY cross + quick follow-through; Ribbon warming (reds/yellows → greens).
	•	Caption: “BTCUSDT 1H • Momentum break with high confidence and ribbon turning.”
 
Small Business Economic Conditions - Statistical Analysis ModelThe Small Business Economic Conditions Statistical Analysis Model (SBO-SAM) represents an econometric approach to measuring and analyzing the economic health of small business enterprises through multi-dimensional factor analysis and statistical methodologies. This indicator synthesizes eight fundamental economic components into a composite index that provides real-time assessment of small business operating conditions with statistical rigor. The model employs Z-score standardization, variance-weighted aggregation, higher-order moment analysis, and regime-switching detection to deliver comprehensive insights into small business economic conditions with statistical confidence intervals and multi-language accessibility.
1. Introduction and Theoretical Foundation
The development of quantitative models for assessing small business economic conditions has gained significant importance in contemporary financial analysis, particularly given the critical role small enterprises play in economic development and employment generation. Small businesses, typically defined as enterprises with fewer than 500 employees according to the U.S. Small Business Administration, constitute approximately 99.9% of all businesses in the United States and employ nearly half of the private workforce (U.S. Small Business Administration, 2024).
The theoretical framework underlying the SBO-SAM model draws extensively from established academic research in small business economics and quantitative finance. The foundational understanding of key drivers affecting small business performance builds upon the seminal work of Dunkelberg and Wade (2023) in their analysis of small business economic trends through the National Federation of Independent Business (NFIB) Small Business Economic Trends survey. Their research established the critical importance of optimism, hiring plans, capital expenditure intentions, and credit availability as primary determinants of small business performance.
The model incorporates insights from Federal Reserve Board research, particularly the Senior Loan Officer Opinion Survey (Federal Reserve Board, 2024), which demonstrates the critical importance of credit market conditions in small business operations. This research consistently shows that small businesses face disproportionate challenges during periods of credit tightening, as they typically lack access to capital markets and rely heavily on bank financing.
The statistical methodology employed in this model follows the econometric principles established by Hamilton (1989) in his work on regime-switching models and time series analysis. Hamilton's framework provides the theoretical foundation for identifying different economic regimes and understanding how economic relationships may vary across different market conditions. The variance-weighted aggregation technique draws from modern portfolio theory as developed by Markowitz (1952) and later refined by Sharpe (1964), applying these concepts to economic indicator construction rather than traditional asset allocation.
Additional theoretical support comes from the work of Engle and Granger (1987) on cointegration analysis, which provides the statistical framework for combining multiple time series while maintaining long-term equilibrium relationships. The model also incorporates insights from behavioral economics research by Kahneman and Tversky (1979) on prospect theory, recognizing that small business decision-making may exhibit systematic biases that affect economic outcomes.
2. Model Architecture and Component Structure
The SBO-SAM model employs eight orthogonalized economic factors that collectively capture the multifaceted nature of small business operating conditions. Each component is normalized using Z-score standardization with a rolling 252-day window, representing approximately one business year of trading data. This approach ensures statistical consistency across different market regimes and economic cycles, following the methodology established by Tsay (2010) in his treatment of financial time series analysis.
2.1 Small Cap Relative Performance Component
The first component measures the performance of the Russell 2000 index relative to the S&P 500, capturing the market-based assessment of small business equity valuations. This component reflects investor sentiment toward smaller enterprises and provides a forward-looking perspective on small business prospects. The theoretical justification for this component stems from the efficient market hypothesis as formulated by Fama (1970), which suggests that stock prices incorporate all available information about future prospects.
The calculation employs a 20-day rate of change with exponential smoothing to reduce noise while preserving signal integrity. The mathematical formulation is:
Small_Cap_Performance = (Russell_2000_t / S&P_500_t) / (Russell_2000_{t-20} / S&P_500_{t-20}) - 1
This relative performance measure eliminates market-wide effects and isolates the specific performance differential between small and large capitalization stocks, providing a pure measure of small business market sentiment.
2.2 Credit Market Conditions Component
Credit Market Conditions constitute the second component, incorporating commercial lending volumes and credit spread dynamics. This factor recognizes that small businesses are particularly sensitive to credit availability and borrowing costs, as established in numerous Federal Reserve studies (Bernanke and Gertler, 1995). Small businesses typically face higher borrowing costs and more stringent lending standards compared to larger enterprises, making credit conditions a critical determinant of their operating environment.
The model calculates credit spreads using high-yield bond ETFs relative to Treasury securities, providing a market-based measure of credit risk premiums that directly affect small business borrowing costs. The component also incorporates commercial and industrial loan growth data from the Federal Reserve's H.8 statistical release, which provides direct evidence of lending activity to businesses.
The mathematical specification combines these elements as:
Credit_Conditions = α₁ × (HYG_t / TLT_t) + α₂ × C&I_Loan_Growth_t
where HYG represents high-yield corporate bond ETF prices, TLT represents long-term Treasury ETF prices, and C&I_Loan_Growth represents the rate of change in commercial and industrial loans outstanding.
 2.3 Labor Market Dynamics Component
The Labor Market Dynamics component captures employment cost pressures and labor availability metrics through the relationship between job openings and unemployment claims. This factor acknowledges that labor market tightness significantly impacts small business operations, as these enterprises typically have less flexibility in wage negotiations and face greater challenges in attracting and retaining talent during periods of low unemployment.
The theoretical foundation for this component draws from search and matching theory as developed by Mortensen and Pissarides (1994), which explains how labor market frictions affect employment dynamics. Small businesses often face higher search costs and longer hiring processes, making them particularly sensitive to labor market conditions.
The component is calculated as:
Labor_Tightness = Job_Openings_t / (Unemployment_Claims_t × 52)
This ratio provides a measure of labor market tightness, with higher values indicating greater difficulty in finding workers and potential wage pressures.
 2.4 Consumer Demand Strength Component
Consumer Demand Strength represents the fourth component, combining consumer sentiment data with retail sales growth rates. Small businesses are disproportionately affected by consumer spending patterns, making this component crucial for assessing their operating environment. The theoretical justification comes from the permanent income hypothesis developed by Friedman (1957), which explains how consumer spending responds to both current conditions and future expectations.
The model weights consumer confidence and actual spending data to provide both forward-looking sentiment and contemporaneous demand indicators. The specification is:
Demand_Strength = β₁ × Consumer_Sentiment_t + β₂ × Retail_Sales_Growth_t
where β₁ and β₂ are determined through principal component analysis to maximize the explanatory power of the combined measure.
 2.5 Input Cost Pressures Component
Input Cost Pressures form the fifth component, utilizing producer price index data to capture inflationary pressures on small business operations. This component is inversely weighted, recognizing that rising input costs negatively impact small business profitability and operating conditions. Small businesses typically have limited pricing power and face challenges in passing through cost increases to customers, making them particularly vulnerable to input cost inflation.
The theoretical foundation draws from cost-push inflation theory as described by Gordon (1988), which explains how supply-side price pressures affect business operations. The model employs a 90-day rate of change to capture medium-term cost trends while filtering out short-term volatility:
Cost_Pressure = -1 × (PPI_t / PPI_{t-90} - 1)
The negative weighting reflects the inverse relationship between input costs and business conditions.
 2.6 Monetary Policy Impact Component
Monetary Policy Impact represents the sixth component, incorporating federal funds rates and yield curve dynamics. Small businesses are particularly sensitive to interest rate changes due to their higher reliance on variable-rate financing and limited access to capital markets. The theoretical foundation comes from monetary transmission mechanism theory as developed by Bernanke and Blinder (1992), which explains how monetary policy affects different segments of the economy.
The model calculates the absolute deviation of federal funds rates from a neutral 2% level, recognizing that both extremely low and high rates can create operational challenges for small enterprises. The yield curve component captures the shape of the term structure, which affects both borrowing costs and economic expectations:
Monetary_Impact = γ₁ × |Fed_Funds_Rate_t - 2.0| + γ₂ × (10Y_Yield_t - 2Y_Yield_t)
 2.7 Currency Valuation Effects Component
Currency Valuation Effects constitute the seventh component, measuring the impact of US Dollar strength on small business competitiveness. A stronger dollar can benefit businesses with significant import components while disadvantaging exporters. The model employs Dollar Index volatility as a proxy for currency-related uncertainty that affects small business planning and operations.
The theoretical foundation draws from international trade theory and the work of Krugman (1987) on exchange rate effects on different business segments. Small businesses often lack hedging capabilities, making them more vulnerable to currency fluctuations:
Currency_Impact = -1 × DXY_Volatility_t
 2.8 Regional Banking Health Component
The eighth and final component, Regional Banking Health, assesses the relative performance of regional banks compared to large financial institutions. Regional banks traditionally serve as primary lenders to small businesses, making their health a critical factor in small business credit availability and overall operating conditions.
This component draws from the literature on relationship banking as developed by Boot (2000), which demonstrates the importance of bank-borrower relationships, particularly for small enterprises. The calculation compares regional bank performance to large financial institutions:
Banking_Health = (Regional_Banks_Index_t / Large_Banks_Index_t) - 1
 3. Statistical Methodology and Advanced Analytics
The model employs statistical techniques to ensure robustness and reliability. Z-score normalization is applied to each component using rolling 252-day windows, providing standardized measures that remain consistent across different time periods and market conditions. This approach follows the methodology established by Engle and Granger (1987) in their cointegration analysis framework.
 3.1 Variance-Weighted Aggregation
The composite index calculation utilizes variance-weighted aggregation, where component weights are determined by the inverse of their historical variance. This approach, derived from modern portfolio theory, ensures that more stable components receive higher weights while reducing the impact of highly volatile factors. The mathematical formulation follows the principle that optimal weights are inversely proportional to variance, maximizing the signal-to-noise ratio of the composite indicator.
The weight for component i is calculated as:
w_i = (1/σᵢ²) / Σⱼ(1/σⱼ²)
where σᵢ² represents the variance of component i over the lookback period.
 3.2 Higher-Order Moment Analysis
Higher-order moment analysis extends beyond traditional mean and variance calculations to include skewness and kurtosis measurements. Skewness provides insight into the asymmetry of the sentiment distribution, while kurtosis measures the tail behavior and potential for extreme events. These metrics offer valuable information about the underlying distribution characteristics and potential regime changes.
Skewness is calculated as:
Skewness = E  / σ³
Kurtosis is calculated as:
Kurtosis = E  / σ⁴ - 3
where μ represents the mean and σ represents the standard deviation of the distribution.
 3.3 Regime-Switching Detection
The model incorporates regime-switching detection capabilities based on the Hamilton (1989) framework. This allows for identification of different economic regimes characterized by distinct statistical properties. The regime classification employs percentile-based thresholds:
- Regime 3 (Very High): Percentile rank > 80
- Regime 2 (High): Percentile rank 60-80
- Regime 1 (Moderate High): Percentile rank 50-60
- Regime 0 (Neutral): Percentile rank 40-50
- Regime -1 (Moderate Low): Percentile rank 30-40
- Regime -2 (Low): Percentile rank 20-30
- Regime -3 (Very Low): Percentile rank < 20
 3.4 Information Theory Applications
The model incorporates information theory concepts, specifically Shannon entropy measurement, to assess the information content of the sentiment distribution. Shannon entropy, as developed by Shannon (1948), provides a measure of the uncertainty or information content in a probability distribution:
H(X) = -Σᵢ p(xᵢ) log₂ p(xᵢ)
Higher entropy values indicate greater unpredictability and information content in the sentiment series.
 3.5 Long-Term Memory Analysis
The Hurst exponent calculation provides insight into the long-term memory characteristics of the sentiment series. Originally developed by Hurst (1951) for analyzing Nile River flow patterns, this measure has found extensive application in financial time series analysis. The Hurst exponent H is calculated using the rescaled range statistic:
H = log(R/S) / log(T)
where R/S represents the rescaled range and T represents the time period. Values of H > 0.5 indicate long-term positive autocorrelation (persistence), while H < 0.5 indicates mean-reverting behavior.
 3.6 Structural Break Detection
The model employs Chow test approximation for structural break detection, based on the methodology developed by Chow (1960). This technique identifies potential structural changes in the underlying relationships by comparing the stability of regression parameters across different time periods:
Chow_Statistic = (RSS_restricted - RSS_unrestricted) / RSS_unrestricted × (n-2k)/k
where RSS represents residual sum of squares, n represents sample size, and k represents the number of parameters.
 4. Implementation Parameters and Configuration
 4.1 Language Selection Parameters
The model provides comprehensive multi-language support across five languages: English, German (Deutsch), Spanish (Español), French (Français), and Japanese (日本語). This feature enhances accessibility for international users and ensures cultural appropriateness in terminology usage. The language selection affects all internal displays, statistical classifications, and alert messages while maintaining consistency in underlying calculations.
 4.2 Model Configuration Parameters
Calculation Method: Users can select from four aggregation methodologies:
- Equal-Weighted: All components receive identical weights
- Variance-Weighted: Components weighted inversely to their historical variance
- Principal Component: Weights determined through principal component analysis
- Dynamic: Adaptive weighting based on recent performance
Sector Specification: The model allows for sector-specific calibration:
- General: Broad-based small business assessment
- Retail: Emphasis on consumer demand and seasonal factors
- Manufacturing: Enhanced weighting of input costs and currency effects
- Services: Focus on labor market dynamics and consumer demand
- Construction: Emphasis on credit conditions and monetary policy
Lookback Period: Statistical analysis window ranging from 126 to 504 trading days, with 252 days (one business year) as the optimal default based on academic research.
Smoothing Period: Exponential moving average period from 1 to 21 days, with 5 days providing optimal noise reduction while preserving signal integrity.
 4.3 Statistical Threshold Parameters
Upper Statistical Boundary: Configurable threshold between 60-80 (default 70) representing the upper significance level for regime classification.
Lower Statistical Boundary: Configurable threshold between 20-40 (default 30) representing the lower significance level for regime classification.
Statistical Significance Level (α): Alpha level for statistical tests, configurable between 0.01-0.10 with 0.05 as the standard academic default.
 4.4 Display and Visualization Parameters
Color Theme Selection: Eight professional color schemes optimized for different user preferences and accessibility requirements:
- Gold: Traditional financial industry colors
- EdgeTools: Professional blue-gray scheme
- Behavioral: Psychology-based color mapping
- Quant: Value-based quantitative color scheme
- Ocean: Blue-green maritime theme
- Fire: Warm red-orange theme
- Matrix: Green-black technology theme
- Arctic: Cool blue-white theme
Dark Mode Optimization: Automatic color adjustment for dark chart backgrounds, ensuring optimal readability across different viewing conditions.
Line Width Configuration: Main index line thickness adjustable from 1-5 pixels for optimal visibility.
Background Intensity: Transparency control for statistical regime backgrounds, adjustable from 90-99% for subtle visual enhancement without distraction.
 4.5 Alert System Configuration
Alert Frequency Options: Three frequency settings to match different trading styles:
- Once Per Bar: Single alert per bar formation
- Once Per Bar Close: Alert only on confirmed bar close
- All: Continuous alerts for real-time monitoring
Statistical Extreme Alerts: Notifications when the index reaches 99% confidence levels (Z-score > 2.576 or < -2.576).
Regime Transition Alerts: Notifications when statistical boundaries are crossed, indicating potential regime changes.
 5. Practical Application and Interpretation Guidelines
 5.1 Index Interpretation Framework
The SBO-SAM index operates on a 0-100 scale with statistical normalization ensuring consistent interpretation across different time periods and market conditions. Values above 70 indicate statistically elevated small business conditions, suggesting favorable operating environment with potential for expansion and growth. Values below 30 indicate statistically reduced conditions, suggesting challenging operating environment with potential constraints on business activity.
The median reference line at 50 represents the long-term equilibrium level, with deviations providing insight into cyclical conditions relative to historical norms. The statistical confidence bands at 95% levels (approximately ±2 standard deviations) help identify when conditions reach statistically significant extremes.
 5.2 Regime Classification System
The model employs a seven-level regime classification system based on percentile rankings:
Very High Regime (P80+): Exceptional small business conditions, typically associated with strong economic growth, easy credit availability, and favorable regulatory environment. Historical analysis suggests these periods often precede economic peaks and may warrant caution regarding sustainability.
High Regime (P60-80): Above-average conditions supporting business expansion and investment. These periods typically feature moderate growth, stable credit conditions, and positive consumer sentiment.
Moderate High Regime (P50-60): Slightly above-normal conditions with mixed signals. Careful monitoring of individual components helps identify emerging trends.
Neutral Regime (P40-50): Balanced conditions near long-term equilibrium. These periods often represent transition phases between different economic cycles.
Moderate Low Regime (P30-40): Slightly below-normal conditions with emerging headwinds. Early warning signals may appear in credit conditions or consumer demand.
Low Regime (P20-30): Below-average conditions suggesting challenging operating environment. Businesses may face constraints on growth and expansion.
Very Low Regime (P0-20): Severely constrained conditions, typically associated with economic recessions or financial crises. These periods often present opportunities for contrarian positioning.
 5.3 Component Analysis and Diagnostics
Individual component analysis provides valuable diagnostic information about the underlying drivers of overall conditions. Divergences between components can signal emerging trends or structural changes in the economy.
Credit-Labor Divergence: When credit conditions improve while labor markets tighten, this may indicate early-stage economic acceleration with potential wage pressures.
Demand-Cost Divergence: Strong consumer demand coupled with rising input costs suggests inflationary pressures that may constrain small business margins.
Market-Fundamental Divergence: Disconnection between small-cap equity performance and fundamental conditions may indicate market inefficiencies or changing investor sentiment.
 5.4 Temporal Analysis and Trend Identification
The model provides multiple temporal perspectives through momentum analysis, rate of change calculations, and trend decomposition. The 20-day momentum indicator helps identify short-term directional changes, while the Hodrick-Prescott filter approximation separates cyclical components from long-term trends.
Acceleration analysis through second-order momentum calculations provides early warning signals for potential trend reversals. Positive acceleration during declining conditions may indicate approaching inflection points, while negative acceleration during improving conditions may suggest momentum loss.
 5.5 Statistical Confidence and Uncertainty Quantification
The model provides comprehensive uncertainty quantification through confidence intervals, volatility measures, and regime stability analysis. The 95% confidence bands help users understand the statistical significance of current readings and identify when conditions reach historically extreme levels.
Volatility analysis provides insight into the stability of current conditions, with higher volatility indicating greater uncertainty and potential for rapid changes. The regime stability measure, calculated as the inverse of volatility, helps assess the sustainability of current conditions.
 6. Risk Management and Limitations
 6.1 Model Limitations and Assumptions
The SBO-SAM model operates under several important assumptions that users must understand for proper interpretation. The model assumes that historical relationships between economic variables remain stable over time, though the regime-switching framework helps accommodate some structural changes. The 252-day lookback period provides reasonable statistical power while maintaining sensitivity to changing conditions, but may not capture longer-term structural shifts.
The model's reliance on publicly available economic data introduces inherent lags in some components, particularly those based on government statistics. Users should consider these timing differences when interpreting real-time conditions. Additionally, the model's focus on quantitative factors may not fully capture qualitative factors such as regulatory changes, geopolitical events, or technological disruptions that could significantly impact small business conditions.
The model's timeframe restrictions ensure statistical validity by preventing application to intraday periods where the underlying economic relationships may be distorted by market microstructure effects, trading noise, and temporal misalignment with the fundamental data sources. Users must utilize daily or longer timeframes to ensure the model's statistical foundations remain valid and interpretable.
 6.2 Data Quality and Reliability Considerations
The model's accuracy depends heavily on the quality and availability of underlying economic data. Market-based components such as equity indices and bond prices provide real-time information but may be subject to short-term volatility unrelated to fundamental conditions. Economic statistics provide more stable fundamental information but may be subject to revisions and reporting delays.
Users should be aware that extreme market conditions may temporarily distort some components, particularly those based on financial market data. The model's statistical normalization helps mitigate these effects, but users should exercise additional caution during periods of market stress or unusual volatility.
 6.3 Interpretation Caveats and Best Practices
The SBO-SAM model provides statistical analysis and should not be interpreted as investment advice or predictive forecasting. The model's output represents an assessment of current conditions based on historical relationships and may not accurately predict future outcomes. Users should combine the model's insights with other analytical tools and fundamental analysis for comprehensive decision-making.
The model's regime classifications are based on historical percentile rankings and may not fully capture the unique characteristics of current economic conditions. Users should consider the broader economic context and potential structural changes when interpreting regime classifications.
 7. Academic References and Bibliography
Bernanke, B. S., & Blinder, A. S. (1992). The Federal Funds Rate and the Channels of Monetary Transmission. American Economic Review, 82(4), 901-921.
Bernanke, B. S., & Gertler, M. (1995). Inside the Black Box: The Credit Channel of Monetary Policy Transmission. Journal of Economic Perspectives, 9(4), 27-48.
Boot, A. W. A. (2000). Relationship Banking: What Do We Know? Journal of Financial Intermediation, 9(1), 7-25.
Chow, G. C. (1960). Tests of Equality Between Sets of Coefficients in Two Linear Regressions. Econometrica, 28(3), 591-605.
Dunkelberg, W. C., & Wade, H. (2023). NFIB Small Business Economic Trends. National Federation of Independent Business Research Foundation, Washington, D.C.
Engle, R. F., & Granger, C. W. J. (1987). Co-integration and Error Correction: Representation, Estimation, and Testing. Econometrica, 55(2), 251-276.
Fama, E. F. (1970). Efficient Capital Markets: A Review of Theory and Empirical Work. Journal of Finance, 25(2), 383-417.
Federal Reserve Board. (2024). Senior Loan Officer Opinion Survey on Bank Lending Practices. Board of Governors of the Federal Reserve System, Washington, D.C.
Friedman, M. (1957). A Theory of the Consumption Function. Princeton University Press, Princeton, NJ.
Gordon, R. J. (1988). The Role of Wages in the Inflation Process. American Economic Review, 78(2), 276-283.
Hamilton, J. D. (1989). A New Approach to the Economic Analysis of Nonstationary Time Series and the Business Cycle. Econometrica, 57(2), 357-384.
Hurst, H. E. (1951). Long-term Storage Capacity of Reservoirs. Transactions of the American Society of Civil Engineers, 116(1), 770-799.
Kahneman, D., & Tversky, A. (1979). Prospect Theory: An Analysis of Decision under Risk. Econometrica, 47(2), 263-291.
Krugman, P. (1987). Pricing to Market When the Exchange Rate Changes. In S. W. Arndt & J. D. Richardson (Eds.), Real-Financial Linkages among Open Economies (pp. 49-70). MIT Press, Cambridge, MA.
Markowitz, H. (1952). Portfolio Selection. Journal of Finance, 7(1), 77-91.
Mortensen, D. T., & Pissarides, C. A. (1994). Job Creation and Job Destruction in the Theory of Unemployment. Review of Economic Studies, 61(3), 397-415.
Shannon, C. E. (1948). A Mathematical Theory of Communication. Bell System Technical Journal, 27(3), 379-423.
Sharpe, W. F. (1964). Capital Asset Prices: A Theory of Market Equilibrium under Conditions of Risk. Journal of Finance, 19(3), 425-442.
Tsay, R. S. (2010). Analysis of Financial Time Series (3rd ed.). John Wiley & Sons, Hoboken, NJ.
U.S. Small Business Administration. (2024). Small Business Profile. Office of Advocacy, Washington, D.C.
 8. Technical Implementation Notes
The SBO-SAM model is implemented in Pine Script version 6 for the TradingView platform, ensuring compatibility with modern charting and analysis tools. The implementation follows best practices for financial indicator development, including proper error handling, data validation, and performance optimization.
The model includes comprehensive timeframe validation to ensure statistical accuracy and reliability. The indicator operates exclusively on daily (1D) timeframes or higher, including weekly (1W), monthly (1M), and longer periods. This restriction ensures that the statistical analysis maintains appropriate temporal resolution for the underlying economic data sources, which are primarily reported on daily or longer intervals.
When users attempt to apply the model to intraday timeframes (such as 1-minute, 5-minute, 15-minute, 30-minute, 1-hour, 2-hour, 4-hour, 6-hour, 8-hour, or 12-hour charts), the system displays a comprehensive error message in the user's selected language and prevents execution. This safeguard protects users from potentially misleading results that could occur when applying daily-based economic analysis to shorter timeframes where the underlying data relationships may not hold.
The model's statistical calculations are performed using vectorized operations where possible to ensure computational efficiency. The multi-language support system employs Unicode character encoding to ensure proper display of international characters across different platforms and devices.
The alert system utilizes TradingView's native alert functionality, providing users with flexible notification options including email, SMS, and webhook integrations. The alert messages include comprehensive statistical information to support informed decision-making.
The model's visualization system employs professional color schemes designed for optimal readability across different chart backgrounds and display devices. The system includes dynamic color transitions based on momentum and volatility, professional glow effects for enhanced line visibility, and transparency controls that allow users to customize the visual intensity to match their preferences and analytical requirements. The clean confidence band implementation provides clear statistical boundaries without visual distractions, maintaining focus on the analytical content.
Cardwell RSI by TQ📌 Cardwell RSI – Enhanced Relative Strength Index 
This indicator is based on  Andrew Cardwell’s RSI methodology , extending the classic RSI with tools to better identify  bullish/bearish ranges  and trend dynamics.
 In uptrends, RSI tends to hold between 40–80 (Cardwell bullish range).
In downtrends, RSI tends to stay between 20–60 (Cardwell bearish range). 
 Key Features :
 
  Standard RSI with configurable length & source
  Fast (9) & Slow (45) RSI Moving Averages (toggleable)
  Cardwell Core Levels (80 / 60 / 40 / 20) – enabled by default
  Base Bands (70 / 50 / 30) in dotted style
  Optional custom levels (up to 3)
  Alerts for MA crosses and level crosses
  Data Window metrics: RSI vs Fast/Slow MA differences
 
 How to Use :
 
  Monitor RSI behavior inside Cardwell’s bullish (40–80) and bearish (20–60) ranges
  Watch RSI crossovers with Fast (9) and Slow (45) MAs to confirm momentum or trend shifts
  Use levels and alerts as confluence with your trading strategy
 
 Default Settings :
 
  RSI Length: 14
  MA Type: WMA
  Fast MA: 9 (hidden by default)
  Slow MA: 45 (hidden by default)
  Cardwell Levels (80/60/40/20): ON
  Base Bands (70/50/30): ON
ST-Stochastic DashboardST-Stochastic Dashboard: User Manual & Functionality
1. Introduction
The ST-Stochastic Dashboard is a comprehensive tool designed for traders who utilize the Stochastic Oscillator. It combines two key features into a single indicator:
A standard, fully customizable Stochastic Oscillator plotted directly on your chart.
A powerful Multi-Timeframe (MTF) Dashboard that shows the status of the Stochastic %K value across three different timeframes of your choice.
This allows you to analyze momentum on your current timeframe while simultaneously monitoring for confluence or divergence on higher or lower timeframes, all without leaving your chart.
Disclaimer: In accordance with TradingView's House Rules, this document describes the technical functionality of the indicator. It is not financial advice. The indicator provides data based on user-defined parameters; all trading decisions are the sole responsibility of the user. Past performance is not indicative of future results.
2. How It Works (Functionality)
The indicator is divided into two main components:
A. The Main Stochastic Indicator (Chart Pane)
This is the visual representation of the Stochastic Oscillator for the chart's current timeframe.
%K Line (Blue): This is the main line of the oscillator. It shows the current closing price in relation to the high-low range over a user-defined period. A high value means the price is closing near the top of its recent range; a low value means it's closing near the bottom.
%D Line (Black): This is the signal line, which is a moving average of the %K line. It is used to smooth out the %K line and generate trading signals.
Overbought Zone (Red Area): By default, this zone is above the 75 level. When the Stochastic lines are in this area, it indicates that the asset may be "overbought," meaning the price is trading near the peak of its recent price range.
Oversold Zone (Blue Area): By default, this zone is below the 25 level. When the Stochastic lines are in this area, it indicates that the asset may be "oversold," meaning the price is trading near the bottom of its recent price range.
Crossover Signals:
Buy Signal (Blue Up Triangle): A blue triangle appears below the candles when the %K line crosses above the Oversold line (e.g., from 24 to 26). This suggests a potential shift from bearish to bullish momentum.
Sell Signal (Red Down Triangle): A red triangle appears above the candles when the %K line crosses below the Overbought line (e.g., from 76 to 74). This suggests a potential shift from bullish to bearish momentum.
B. The Multi-Timeframe Dashboard (Table on Chart)
This is the informational table that appears on your chart. Its purpose is to give you a quick, at-a-glance summary of the Stochastic's condition on other timeframes.
Function: The script uses TradingView's request.security() function to pull the %K value from three other timeframes that you specify in the settings.
Efficiency: The table is designed to update only on the last (most recent) bar (barstate.islast) to ensure the script runs efficiently and does not slow down your chart.
Columns:
Timeframe: Displays the timeframe you have selected (e.g., '5', '15', '60').
Stoch %K: Shows the current numerical value of the %K line for that specific timeframe, rounded to two decimal places.
Status: Interprets the %K value and displays a clear status:
OVERBOUGHT (Red Background): The %K value is above the "Upper Line" setting.
OVERSOLD (Blue Background): The %K value is below the "Lower Line" setting.
NEUTRAL (Black/Dark Background): The %K value is between the Overbought and Oversold levels.
3. Settings / Parameters in Detail
You can access these settings by clicking the "Settings" (cogwheel) icon on the indicator name.
Stochastic Settings
This group controls the behavior and appearance of the main Stochastic indicator plotted in the pane.
Stochastic Period (length)
Description: This is the lookback period used to calculate the Stochastic Oscillator. It defines the number of past bars to consider for the high-low range.
Default: 9
%K Smoothing (smoothK)
Description: This is the moving average period used to smooth the raw Stochastic value, creating the %K line. A higher value results in a smoother, less sensitive line.
Default: 3
%D Smoothing (smoothD)
Description: This is the moving average period applied to the %K line to create the %D (signal) line. A higher value creates a smoother signal line that lags further behind the %K line.
Default: 6
Lower Line (Oversold) (ul)
Description: This sets the threshold for the oversold condition. When the %K line is below this value, the dashboard will show "OVERSOLD". It is also the level the %K line must cross above to trigger a Buy Signal triangle.
Default: 25
Upper Line (Overbought) (ll)
Description: This sets the threshold for the overbought condition. When the %K line is above this value, the dashboard will show "OVERBOUGHT". It is also the level the %K line must cross below to trigger a Sell Signal triangle.
Default: 75
Dashboard Settings
This group controls the data and appearance of the multi-timeframe table.
Timeframe 1 (tf1)
Description: The first timeframe to be displayed in the dashboard.
Default: 5 (5 minutes)
Timeframe 2 (tf2)
Description: The second timeframe to be displayed in the dashboard.
Default: 15 (15 minutes)
Timeframe 3 (tf3)
Description: The third timeframe to be displayed in the dashboard.
Default: 60 (1 hour)
Dashboard Position (table_pos)
Description: Allows you to select where the dashboard table will appear on your chart.
Options: top_right, top_left, bottom_right, bottom_left
Default: bottom_right
4. How to Use & Interpret
Configuration: Adjust the Stochastic Settings to match your trading strategy. The default values (9, 3, 6) are common, but feel free to experiment. Set the Dashboard Settings to the timeframes that are most relevant to your analysis (e.g., your entry timeframe, a medium-term timeframe, and a long-term trend timeframe).
Analysis with the Dashboard: The primary strength of this tool is confluence. Look for situations where multiple timeframes align. For example:
If the dashboard shows OVERSOLD on the 15-minute, 60-minute, and your current 5-minute chart, a subsequent Buy Signal on your 5-minute chart may carry more weight.
Conversely, if your 5-minute chart shows OVERSOLD but the 60-minute chart is strongly OVERBOUGHT, it could indicate that you are looking at a minor pullback in a larger downtrend.
Interpreting States:
Overbought is not an automatic "sell" signal. It simply means momentum has been strong to the upside, and the price is near its recent peak. It could signal a potential reversal, but the price can also remain overbought for extended periods in a strong uptrend.
Oversold is not an automatic "buy" signal. It means momentum has been strong to the downside. While it can signal a potential bounce, prices can remain oversold for a long time in a strong downtrend.
Use the signals and dashboard states as a source of information to complement your overall trading strategy, which should include other forms of analysis such as price action, support/resistance levels, or other indicators.
MirPapa_Library_ICTLibrary   "MirPapa_Library_ICT" 
 GetHTFoffsetToLTFoffset(_offset, _chartTf, _htfTf) 
  GetHTFoffsetToLTFoffset
@description Adjust an HTF offset to an LTF offset by calculating the ratio of timeframes.
  Parameters:
     _offset (int) : int         The HTF bar offset (0 means current HTF bar).
     _chartTf (string) : string     The current chart’s timeframe (e.g., "5", "15", "1D").
     _htfTf (string) : string       The High Time Frame string (e.g., "60", "1D").
@return int                The corresponding LTF bar index. Returns 0 if the result is negative.
 IsConditionState(_type, _isBull, _level, _open, _close, _open1, _close1, _low1, _low2, _low3, _low4, _high1, _high2, _high3, _high4) 
  IsConditionState
@description Evaluate a condition state based on type for COB, FVG, or FOB.
Overloaded: first signature handles COB, second handles FVG/FOB.
  Parameters:
     _type (string) : string        Condition type ("cob", "fvg", "fob").
     _isBull (bool) : bool        Direction flag: true for bullish, false for bearish.
     _level (int) : int          Swing level (only used for COB).
     _open (float) : float         Current bar open price (only for COB).
     _close (float) : float        Current bar close price (only for COB).
     _open1 (float) : float        Previous bar open price (only for COB).
     _close1 (float) : float       Previous bar close price (only for COB).
     _low1 (float) : float         Low 1 bar ago (only for COB).
     _low2 (float) : float         Low 2 bars ago (only for COB).
     _low3 (float) : float         Low 3 bars ago (only for COB).
     _low4 (float) : float         Low 4 bars ago (only for COB).
     _high1 (float) : float        High 1 bar ago (only for COB).
     _high2 (float) : float        High 2 bars ago (only for COB).
     _high3 (float) : float        High 3 bars ago (only for COB).
     _high4 (float) : float        High 4 bars ago (only for COB).
@return bool               True if the specified condition is met, false otherwise.
 IsConditionState(_type, _isBull, _pricePrev, _priceNow) 
  IsConditionState
@description Evaluate FVG or FOB condition based on price movement.
  Parameters:
     _type (string) : string        Condition type ("fvg", "fob").
     _isBull (bool) : bool        Direction flag: true for bullish, false for bearish.
     _pricePrev (float) : float    Previous price (for FVG/FOB).
     _priceNow (float) : float     Current price (for FVG/FOB).
@return bool               True if the specified condition is met, false otherwise.
 IsSwingHighLow(_isBull, _level, _open, _close, _open1, _close1, _low1, _low2, _low3, _low4, _high1, _high2, _high3, _high4) 
  IsSwingHighLow
@description Public wrapper for isSwingHighLow.
  Parameters:
     _isBull (bool) : bool       Direction flag: true for bullish, false for bearish.
     _level (int) : int         Swing level (1 or 2).
     _open (float) : float        Current bar open price.
     _close (float) : float       Current bar close price.
     _open1 (float) : float       Previous bar open price.
     _close1 (float) : float      Previous bar close price.
     _low1 (float) : float        Low 1 bar ago.
     _low2 (float) : float        Low 2 bars ago.
     _low3 (float) : float        Low 3 bars ago.
     _low4 (float) : float        Low 4 bars ago.
     _high1 (float) : float       High 1 bar ago.
     _high2 (float) : float       High 2 bars ago.
     _high3 (float) : float       High 3 bars ago.
     _high4 (float) : float       High 4 bars ago.
@return bool              True if swing condition is met, false otherwise.
 AddBox(_left, _right, _top, _bot, _xloc, _colorBG, _colorBD) 
  AddBox
@description Draw a rectangular box on the chart with specified coordinates and colors.
  Parameters:
     _left (int) : int         Left bar index for the box.
     _right (int) : int        Right bar index for the box.
     _top (float) : float        Top price coordinate for the box.
     _bot (float) : float        Bottom price coordinate for the box.
     _xloc (string) : string      X-axis location type (e.g., xloc.bar_index).
     _colorBG (color) : color    Background color for the box.
     _colorBD (color) : color    Border color for the box.
@return box              Returns the created box object.
 Addline(_x, _y, _xloc, _color, _width) 
  Addline
@description Draw a vertical or horizontal line at specified coordinates.
  Parameters:
     _x (int) : int           X-coordinate for start (bar index).
     _y (int) : float         Y-coordinate for start (price).
     _xloc (string) : string     X-axis location type (e.g., xloc.bar_index).
     _color (color) : color     Line color.
     _width (int) : int       Line width.
@return line            Returns the created line object.
 Addline(_x, _y, _xloc, _color, _width) 
  Parameters:
     _x (int) 
     _y (float) 
     _xloc (string) 
     _color (color) 
     _width (int) 
 Addline(_x1, _y1, _x2, _y2, _xloc, _color, _width) 
  Parameters:
     _x1 (int) 
     _y1 (int) 
     _x2 (int) 
     _y2 (int) 
     _xloc (string) 
     _color (color) 
     _width (int) 
 Addline(_x1, _y1, _x2, _y2, _xloc, _color, _width) 
  Parameters:
     _x1 (int) 
     _y1 (int) 
     _x2 (int) 
     _y2 (float) 
     _xloc (string) 
     _color (color) 
     _width (int) 
 Addline(_x1, _y1, _x2, _y2, _xloc, _color, _width) 
  Parameters:
     _x1 (int) 
     _y1 (float) 
     _x2 (int) 
     _y2 (int) 
     _xloc (string) 
     _color (color) 
     _width (int) 
 Addline(_x1, _y1, _x2, _y2, _xloc, _color, _width) 
  Parameters:
     _x1 (int) 
     _y1 (float) 
     _x2 (int) 
     _y2 (float) 
     _xloc (string) 
     _color (color) 
     _width (int) 
 AddlineMid(_type, _left, _right, _top, _bot, _xloc, _color, _width) 
  AddlineMid
@description Draw a midline between top and bottom for FVG or FOB types.
  Parameters:
     _type (string) : string      Type identifier: "fvg" or "fob".
     _left (int) : int         Left bar index for midline start.
     _right (int) : int        Right bar index for midline end.
     _top (float) : float        Top price of the region.
     _bot (float) : float        Bottom price of the region.
     _xloc (string) : string      X-axis location type (e.g., xloc.bar_index).
     _color (color) : color      Line color.
     _width (int) : int        Line width.
@return line or na       Returns the created line or na if type is not recognized.
 GetHtfFromLabel(_label) 
  GetHtfFromLabel
@description Convert a Korean HTF label into a Pine Script timeframe string via handler library.
  Parameters:
     _label (string) : string    The Korean label (e.g., "5분", "1시간").
@return string          Returns the corresponding Pine Script timeframe (e.g., "5", "60").
 IsChartTFcomparisonHTF(_chartTf, _htfTf) 
  IsChartTFcomparisonHTF
@description Determine whether a given HTF is greater than or equal to the current chart timeframe.
  Parameters:
     _chartTf (string) : string  Current chart timeframe (e.g., "5", "15", "1D").
     _htfTf (string) : string    HTF timeframe (e.g., "60", "1D").
@return bool            True if HTF ≥ chartTF, false otherwise.
 CreateBoxData(_type, _isBull, _useLine, _top, _bot, _xloc, _colorBG, _colorBD, _offset, _htfTf, htfBarIdx, _basePoint) 
  CreateBoxData
@description Create and draw a box and optional midline for given type and parameters. Returns success flag and BoxData.
  Parameters:
     _type (string) : string       Type identifier: "fvg", "fob", "cob", or "sweep".
     _isBull (bool) : bool       Direction flag: true for bullish, false for bearish.
     _useLine (bool) : bool      Whether to draw a midline inside the box.
     _top (float) : float         Top price of the box region.
     _bot (float) : float         Bottom price of the box region.
     _xloc (string) : string       X-axis location type (e.g., xloc.bar_index).
     _colorBG (color) : color     Background color for the box.
     _colorBD (color) : color     Border color for the box.
     _offset (int) : int        HTF bar offset (0 means current HTF bar).
     _htfTf (string) : string      HTF timeframe string (e.g., "60", "1D").
     htfBarIdx (int) : int      HTF bar_index (passed from HTF request).
     _basePoint (float) : float   Base point for breakout checks.
@return tuple(bool, BoxData)  Returns a boolean indicating success and the created BoxData struct.
 ProcessBoxDatas(_datas, _useMidLine, _closeCount, _colorClose) 
  ProcessBoxDatas
@description Process an array of BoxData structs: extend, record volume, update stage, and finalize boxes.
  Parameters:
     _datas (array) : array  Array of BoxData objects to process.
     _useMidLine (bool) : bool       Whether to update the midline endpoint.
     _closeCount (int) : int        Number of touches required to close the box.
     _colorClose (color) : color      Color to apply when a box closes.
@return void                  No return value; updates are in-place.
 BoxData 
  Fields:
     _isActive (series bool) 
     _isBull (series bool) 
     _box (series box) 
     _line (series line) 
     _basePoint (series float) 
     _boxTop (series float) 
     _boxBot (series float) 
     _stage (series int) 
     _isStay (series bool) 
     _volBuy (series float) 
     _volSell (series float) 
     _result (series string) 
 LineData 
  Fields:
     _isActive (series bool) 
     _isBull (series bool) 
     _line (series line) 
     _basePoint (series float) 
     _stage (series int) 
     _isStay (series bool) 
     _result (series string)
MirPapa_Handler_HTFLibrary   "MirPapa_Handler_HTF" 
High Time Frame Handler Library:
Provides utilities for working with High Time Frame (HTF) and chart (LTF) conversions and data retrieval.
 IsChartTFcomparisonHTF(_chartTf, _htfTf) 
  IsChartTFcomparisonHTF
@description
Determine whether the given High Time Frame (HTF) is greater than or equal to the current chart timeframe.
  Parameters:
     _chartTf (string) : The current chart’s timeframe string (examples: "5", "15", "1D").
     _htfTf (string) : The High Time Frame string to compare (examples: "60", "1D").
@return
Returns true if HTF minutes ≥ chart minutes, false otherwise or na if conversion fails.
 GetHTFrevised(_tf, _case) 
  GetHTFrevised
@description
Retrieve a specific bar value from a Higher Time Frame (HTF) series.
Supports current and historical OHLC values, based on a case identifier.
  Parameters:
     _tf (string) : The target HTF string (examples: "60", "1D").
     _case (string) : A case string determining which OHLC value and bar offset to request:
"b"   → HTF bar_index
"o"   → HTF open
"h"   → HTF high
"l"   → HTF low
"c"   → HTF close
"o1"  → HTF open one bar ago
"h1"  → HTF high one bar ago
"l1"  → HTF low one bar ago
"c1"  → HTF close one bar ago
… up to "o5", "h5", "l5", "c5" for five bars ago.
@return
Returns the requested HTF value or na if _case does not match any condition.
 GetHTFfromLabel(_label) 
  GetHTFfromLabel
@description
Convert a Korean HTF label into a Pine Script-recognizable timeframe string.
Examples:
"5분"  → "5"
"1시간" → "60"
"일봉"  → "1D"
"주봉"  → "1W"
"월봉"  → "1M"
"연봉"  → "12M"
  Parameters:
     _label (string) : The Korean HTF label string (examples: "5분", "1시간", "일봉").
@return
Returns the Pine Script timeframe string corresponding to the label, or "1W" if no match is found.
 GetHTFoffsetToLTFoffset(_offset, _chartTf, _htfTf) 
  GetHTFoffsetToLTFoffset
@description
Adjust an HTF bar index and offset so that it aligns with the current chart’s bar index.
Useful for retrieving historical HTF data on an LTF chart.
  Parameters:
     _offset (int) : The HTF bar offset (0 means current HTF bar, 1 means one bar ago, etc.).
     _chartTf (string) : The current chart’s timeframe string (examples: "5", "15", "1D").
     _htfTf (string) : The High Time Frame string to align (examples: "60", "1D").
@return
Returns the corresponding LTF bar index after applying HTF offset. If result is negative, returns 0.
Ergodic Market Divergence (EMD)Ergodic Market Divergence (EMD) 
Bridging Statistical Physics and Market Dynamics Through Ensemble Analysis
 The Revolutionary Concept:  When Physics Meets Trading
After months of research into ergodic theory—a fundamental principle in statistical mechanics—I've developed a trading system that identifies when markets transition between predictable and unpredictable states. This indicator doesn't just follow price; it analyzes whether current market behavior will persist or revert, giving traders a scientific edge in timing entries and exits.
 The Core Innovation:  Ergodic Theory Applied to Markets
What Makes Markets Ergodic or Non-Ergodic?
In statistical physics, ergodicity determines whether a system's future resembles its past. Applied to trading:
 Ergodic Markets (Mean-Reverting) 
- Time averages equal ensemble averages
- Historical patterns repeat reliably
- Price oscillates around equilibrium
- Traditional indicators work well
 Non-Ergodic Markets (Trending) 
- Path dependency dominates
- History doesn't predict future
- Price creates new equilibrium levels
- Momentum strategies excel
 The Mathematical Framework 
 The Ergodic Score combines three critical divergences: 
 Ergodic Score  = (Price Divergence × Market Stress + Return Divergence × 1000 + Volatility Divergence × 50) / 3
 Where: 
 Price Divergence:  How far current price deviates from market consensus
 Return Divergence:  Momentum differential between instrument and market
 Volatility Divergence:  Volatility regime misalignment
 Market Stress:  Adaptive multiplier based on current conditions
 The Ensemble Analysis Revolution 
 Beyond Single-Instrument Analysis 
Traditional indicators analyze one chart in isolation. EMD monitors multiple correlated markets simultaneously (SPY, QQQ, IWM, DIA) to detect systemic regime changes. This ensemble approach:
 Reveals Hidden Divergences:  Individual stocks may diverge from market consensus before major moves
 Filters False Signals:  Requires broader market confirmation
 Identifies Regime Shifts:  Detects when entire market structure changes
 Provides Context:  Shows if moves are isolated or systemic
 Dynamic Threshold Adaptation 
 Unlike fixed-threshold systems, EMD's boundaries evolve with market conditions: 
 Base Threshold  = SMA(Ergodic Score, Lookback × 3)
 Adaptive Component  = StDev(Ergodic Score, Lookback × 2) × Sensitivity
 Final Threshold  = Smoothed(Base + Adaptive)
This creates context-aware signals that remain effective across different market environments.
 The Confidence Engine:  Know Your Signal Quality
 Multi-Factor Confidence Scoring 
 Every signal receives a confidence score based on: 
 Signal Clarity (0-35%):  How decisively the ergodic threshold is crossed
 Momentum Strength (0-25%):  Rate of ergodic change
 Volatility Alignment (0-20%):  Whether volatility supports the signal
 Market Quality (0-20%):  Price convergence and path dependency factors
 Real-Time Confidence Updates 
 The Live Confidence metric continuously updates, showing: 
- Current opportunity quality
- Market state clarity
- Historical performance influence
- Signal recency boost
- Visual Intelligence System
 Adaptive Ergodic Field Bands 
 Dynamic bands that expand and contract based on market state: 
 Primary Color:  Ergodic state (mean-reverting)
 Danger Color:  Non-ergodic state (trending)
 Band Width:  Expected price movement range
 Squeeze Indicators:  Volatility compression warnings
 Quantum Wave Ribbons 
 Triple EMA system (8, 21, 55) revealing market flow: 
 Compressed Ribbons:  Consolidation imminent
 Expanding Ribbons:  Directional move developing
 Color Coding:  Matches current ergodic state
 Phase Transition Signals 
 Clear entry/exit markers at regime changes: 
 Bull Signals:  Ergodic restoration (mean reversion opportunity)
 Bear Signals:  Ergodic break (trend following opportunity)
 Confidence Labels:  Percentage showing signal quality
 Visual Intensity:  Stronger signals = deeper colors
 Professional Dashboard Suite 
 Main Analytics Panel (Top Right) 
 Market State Monitor 
- Current regime (Ergodic/Non-Ergodic)
- Ergodic score with threshold
- Path dependency strength
- Quantum coherence percentage
 Divergence Metrics 
- Price divergence with severity
- Volatility regime classification
- Strategy mode recommendation
- Signal strength indicator
 Live Intelligence 
- Real-time confidence score
- Color-coded risk levels
- Dynamic strategy suggestions
 Performance Tracking (Left Panel) 
 Signal Analytics 
- Total historical signals
- Win rate with W/L breakdown
- Current streak tracking
- Closed trade counter
 Regime Analysis 
- Current market behavior
- Bars since last signal
- Recommended actions
- Average confidence trends
 Strategy Command Center (Bottom Right) 
 Adaptive Recommendations 
- Active strategy mode
- Primary approach (mean reversion/momentum)
- Suggested indicators ("weapons")
- Entry/exit methodology
- Risk management guidance
- Comprehensive Input Guide
 Core Algorithm Parameters 
 Analysis Period (10-100 bars) 
 Scalping (10-15):  Ultra-responsive, more signals, higher noise
 Day Trading (20-30):  Balanced sensitivity and stability
 Swing Trading (40-100):  Smooth signals, major moves only Default: 20 - optimal for most timeframes
 Divergence Threshold (0.5-5.0) 
 Hair Trigger (0.5-1.0):  Catches every wiggle, many false signals
 Balanced (1.5-2.5):  Good signal-to-noise ratio
 Conservative (3.0-5.0):  Only extreme divergences Default: 1.5 - best risk/reward balance
 Path Memory (20-200 bars) 
 Short Memory (20-50):  Recent behavior focus, quick adaptation
 Medium Memory (50-100):  Balanced historical context
 Long Memory (100-200):  Emphasizes established patterns Default: 50 - captures sufficient history without lag
 Signal Spacing (5-50 bars) 
 Aggressive (5-10):  Allows rapid-fire signals
 Normal (15-25):  Prevents clustering, maintains flow
 Conservative (30-50):  Major setups only Default: 15 - optimal trade frequency
 Ensemble Configuration 
 Select markets for consensus analysis: 
 SPY:  Broad market sentiment
 QQQ:  Technology leadership
 IWM:  Small-cap risk appetite
 DIA:  Blue-chip stability
 More instruments  = stronger consensus but potentially diluted signals
 Visual Customization 
 Color Themes (6 professional options): 
 Quantum:  Cyan/Pink - Modern trading aesthetic
 Matrix:  Green/Red - Classic terminal look
 Heat:  Blue/Red - Temperature metaphor
 Neon:  Cyan/Magenta - High contrast
 Ocean:  Turquoise/Coral - Calming palette
 Sunset:  Red-orange/Teal - Warm gradients
 Display Controls: 
- Toggle each visual component
- Adjust transparency levels
- Scale dashboard text
- Show/hide confidence scores
- Trading Strategies by Market State
- Ergodic State Strategy (Primary Color Bands)
 Market Characteristics 
- Price oscillates predictably
- Support/resistance hold
- Volume patterns repeat
- Mean reversion dominates
 Optimal Approach 
 Entry:  Fade moves at band extremes
 Target:  Middle band (equilibrium)
 Stop:  Just beyond outer bands
 Size:  Full confidence-based position
 Recommended Tools 
- RSI for oversold/overbought
- Bollinger Bands for extremes
- Volume profile for levels
- Non-Ergodic State Strategy (Danger Color Bands)
 Market Characteristics 
- Price trends persistently
- Levels break decisively
- Volume confirms direction
- Momentum accelerates
 Optimal Approach 
 Entry:  Breakout from bands
 Target:  Trail with expanding bands
 Stop:  Inside opposite band
 Size:  Scale in with trend
 Recommended Tools 
- Moving average alignment
- ADX for trend strength
- MACD for momentum
- Advanced Features Explained
 Quantum Coherence Metric 
 Measures phase alignment between individual and ensemble behavior: 
 80-100%:  Perfect sync - strong mean reversion setup
 50-80%:  Moderate alignment - mixed signals
 0-50%:  Decoherence - trending behavior likely
 Path Dependency Analysis 
 Quantifies how much history influences current price: 
 Low (<30%):  Technical patterns reliable
 Medium (30-50%):  Mixed influences
 High (>50%):  Fundamental shift occurring
 Volatility Regime Classification 
 Contextualizes current volatility: 
 Normal:  Standard strategies apply
 Elevated:  Widen stops, reduce size
 Extreme:  Defensive mode required
 Signal Strength Indicator 
 Real-time opportunity quality: 
- Distance from threshold
- Momentum acceleration
- Cross-validation factors
 Risk Management Framework 
 Position Sizing by Confidence 
 90%+ confidence  = 100% position size
 70-90% confidence  = 75% position size  
 50-70% confidence  = 50% position size
<50% confidence = 25% or skip
 Dynamic Stop Placement 
 Ergodic State:  ATR × 1.0 from entry
 Non-Ergodic State:  ATR × 2.0 from entry
 Volatility Adjustment:  Multiply by current regime
 Multi-Timeframe Alignment 
- Check higher timeframe regime
- Confirm ensemble consensus
- Verify volume participation
- Align with major levels
 What Makes EMD Unique 
 Original Contributions 
 First Ergodic Theory Trading Application:  Transforms abstract physics into practical signals
 Ensemble Market Analysis:  Revolutionary multi-market divergence system
 Adaptive Confidence Engine:  Institutional-grade signal quality metrics
 Quantum Coherence:  Novel market alignment measurement
 Smart Signal Management:  Prevents clustering while maintaining responsiveness
 Technical Innovations 
 Dynamic Threshold Adaptation:  Self-adjusting sensitivity
 Path Memory Integration:  Historical dependency weighting
 Stress-Adjusted Scoring:  Market condition normalization
 Real-Time Performance Tracking:  Built-in strategy analytics
 Optimization Guidelines 
 By Timeframe 
 Scalping (1-5 min) 
 Period:  10-15
 Threshold:  0.5-1.0
 Memory:  20-30
 Spacing:  5-10
 Day Trading (5-60 min) 
 Period:  20-30
 Threshold:  1.5-2.5
 Memory:  40-60
 Spacing:  15-20
 Swing Trading (1H-1D) 
 Period:  40-60
 Threshold:  2.0-3.0
 Memory:  80-120
 Spacing:  25-35
 Position Trading (1D-1W) 
 Period:  60-100
 Threshold:  3.0-5.0
 Memory:  100-200
 Spacing:  40-50
 By Market Condition 
 Trending Markets 
- Increase threshold
- Extend memory
- Focus on breaks
 Ranging Markets 
- Decrease threshold
- Shorten memory
- Focus on restores
 Volatile Markets 
- Increase spacing
- Raise confidence requirement
- Reduce position size
- Integration with Other Analysis
- Complementary Indicators
 For Ergodic States 
- RSI divergences
- Bollinger Band squeezes
- Volume profile nodes
- Support/resistance levels
 For Non-Ergodic States 
- Moving average ribbons
- Trend strength indicators
- Momentum oscillators
- Breakout patterns
- Fundamental Alignment
- Check economic calendar
- Monitor sector rotation
- Consider market themes
- Evaluate risk sentiment
 Troubleshooting Guide 
 Too Many Signals: 
- Increase threshold
- Extend signal spacing
- Raise confidence minimum
 Missing Opportunities 
- Decrease threshold
- Reduce signal spacing
- Check ensemble settings
 Poor Win Rate 
- Verify timeframe alignment
- Confirm volume participation
- Review risk management
 Disclaimer 
This indicator is for educational and informational purposes only. It does not constitute financial advice. Trading involves substantial risk of loss and is not suitable for all investors. Past performance does not guarantee future results.
The ergodic framework provides unique market insights but cannot predict future price movements with certainty. Always use proper risk management, conduct your own analysis, and never risk more than you can afford to lose.
This tool should complement, not replace, comprehensive trading strategies and sound judgment. Markets remain inherently unpredictable despite advanced analysis techniques.
Transform market chaos into trading clarity with Ergodic Market Divergence.
Created with passion for the TradingView community
Trade with insight. Trade with anticipation.
—  Dskyz , for DAFE Trading Systems






















