G-Oscillator Strength v.1Hello this is my new indicator. Purpose of this indicator is to find the strength of the trend.
This indicator was developed by RSI(14) and Stochastic(50)
 How to used 
Red = RSI(14) & Sto(50) < 40   
Lightblue = RSI(14) >= 50 and Sto(40) < 50  
Darkblue = RSI(14) & Sto(40) >= 50  
Green = Sto(40) >= 80  
Yellow =  RSI(14) < 50 and Sto(40) >= 50
 Buy&Sell 
Buy signal for this indicator is Lightblue to Darkblue 
Sell signal is Green to Darkblue or Darkblue to Yellow
 
Cari skrip untuk "北证50+股票+新浪财经"
Advanced Psychological Levels with Dynamic Spacing═══════════════════════════════════════
 ADVANCED PSYCHOLOGICAL LEVELS WITH DYNAMIC SPACING 
═══════════════════════════════════════
A comprehensive psychological price level indicator that automatically identifies and displays round number levels across multiple timeframes. Features dynamic ATR-based spacing, smart crypto detection, distance tracking, and customizable alert system.
───────────────────────────────────────
 WHAT THIS INDICATOR DOES 
───────────────────────────────────────
This indicator automatically draws psychological price levels (round numbers) that often act as support and resistance:
- Dynamic ATR-Based Spacing - Adapts level spacing to market volatility
- Multiple Level Types - Major (250 pip), Standard (100 pip), Mid, and Intraday levels
- Smart Asset Detection - Automatically adjusts for Forex, Crypto, Indices, and CFDs
- Crypto Price Adaptation - Intelligent level spacing based on cryptocurrency price magnitude
- Distance Information Table - Real-time percentage distance to nearest levels
- Combined Level Labels - Clear identification when multiple level types coincide
- Performance Optimized - Configurable visible range and label limits
- Comprehensive Alerts - Notifications when price crosses any level type
───────────────────────────────────────
 HOW IT WORKS 
───────────────────────────────────────
 PSYCHOLOGICAL LEVELS CONCEPT: 
Psychological levels are round numbers where traders tend to place orders, creating natural support and resistance zones. These include:
- Forex: 1.0000, 1.0100, 1.0050 (pips)
- Crypto: $100, $1,000, $10,000 (whole numbers)
- Indices: 10,000, 10,500, 11,000 (points)
Why They Matter:
- Traders naturally gravitate to round numbers
- Stop losses cluster at these levels
- Take profit orders concentrate here
- Institutional algorithmic trading often targets these levels
 DYNAMIC ATR-BASED SPACING: 
Traditional Method:
- Fixed spacing regardless of volatility
- May be too tight in volatile markets
- May be too wide in quiet markets
Dynamic Method (Recommended):
- Uses ATR (Average True Range) to measure volatility
- Automatically adjusts level spacing
- Tighter levels in low volatility
- Wider levels in high volatility
Calculation:
1. Calculate ATR over specified period (default: 14)
2. Multiply by ATR multiplier (default: 2.0)
3. Round to nearest psychological level
4. Generate levels at dynamic intervals
Benefits:
- Adapts to market conditions
- More relevant levels in all volatility regimes
- Reduces clutter in trending markets
- Provides more detail in ranging markets
 LEVEL TYPES: 
Major Levels (250 pip/point):
- Highest significance
- Primary support/resistance zones
- Color: Red (default)
- Style: Solid lines
- Spacing: 2.5x standard step
Standard Levels (100 pip/point):
- Secondary importance
- Common psychological barriers
- Color: Blue (default)
- Style: Dashed lines
- Spacing: Standard step
Mid Levels (50% between major):
- Optional intermediate levels
- Halfway between major levels
- Color: Gray (default)
- Style: Dotted lines
- Usage: Additional confluence points
Intraday Levels (sub-100 pip):
- For intraday traders
- Fine-grained precision
- Color: Yellow (default)
- Style: Dotted lines
- Only shown on intraday timeframes
 SMART ASSET DETECTION: 
Forex Pairs:
- Detects major currency pairs automatically
- Uses pip-based calculations
- Standard: 100 pips (0.0100)
- Major: 250 pips (0.0250)
- Intraday: 20, 50, 80 pip subdivisions
Cryptocurrencies:
- Automatic price magnitude detection
- Adaptive spacing based on price:
  * Under $0.10: Levels at $0.01, $0.05
  * $0.10-$1: Levels at $0.10, $0.50
  * $1-$10: Levels at $1, $5
  * $10-$100: Levels at $10, $50
  * $100-$1,000: Levels at $100, $500
  * $1,000-$10,000: Levels at $1,000, $5,000
  * Over $10,000: Levels at $5,000, $10,000
Indices & CFDs:
- Fixed point-based system
- Major: 500 point intervals (with 250 sub-levels)
- Standard: 100 point intervals
- Suitable for stock indices like SPX, NASDAQ
 COMBINED LEVEL LABELS: 
When multiple level types coincide at the same price:
- Single line drawn (highest priority color)
- Combined label shows all types
- Priority: Major > Standard > Mid > Intraday
Example Label Formats:
- "1.1000 Major" - Major level only
- "1.1000 Std + Major" - Both standard and major
- "50000 Intra + Mid + Std" - Three levels coincide
Benefits:
- Cleaner chart appearance
- Clear identification of confluence
- Reduced visual clutter
- Easy to spot high-importance levels
 DISTANCE INFORMATION TABLE: 
Real-time tracking of nearest levels:
Table Contents:
- Nearest major level above (price and % distance)
- Nearest standard level above (price and % distance)
- Nearest standard level below (price and % distance)
Display:
- Top right corner (configurable)
- Color-coded by level type
- Real-time percentage calculations
- Helpful for position management
Usage:
- Identify proximity to key levels
- Set realistic profit targets
- Gauge potential move magnitude
- Monitor approaching resistance/support
ALERT SYSTEM:
Comprehensive crossing alerts:
Alert Types:
- Major Level Crosses
- Standard Level Crosses
- Intraday Level Crosses
Alert Modes:
- First Cross Only: Alert once when level is crossed
- All Crosses: Alert every time level is crossed
Alert Information:
- Level type crossed
- Specific price level
- Direction (above/below)
- One alert per bar to prevent spam
Configuration:
- Enable/disable by level type
- Choose alert frequency
- Customize for your trading style
───────────────────────────────────────
 HOW TO USE 
───────────────────────────────────────
 INITIAL SETUP: 
General Settings:
1. Enable "Use Dynamic ATR-Based Spacing" (recommended)
2. Set ATR Period (14 is standard)
3. Adjust ATR Multiplier (2.0 is balanced)
Visibility Settings:
1. Set Visible Range % (10% recommended for clarity)
2. Adjust Label Offset for readability
3. Configure performance limits if needed
Level Selection:
1. Enable/disable level types based on trading style
2. Adjust line counts for each type
3. Choose line styles and colors for visibility
 TRADING STRATEGIES: 
Breakout Trading:
1. Wait for price to approach major or standard level
2. Monitor for consolidation near level
3. Enter on confirmed break above/beyond level
4. Stop loss just beyond the broken level
5. Target: Next major or standard level
Rejection Trading:
1. Identify major psychological level
2. Wait for price to test the level
3. Look for rejection signals (wicks, bearish/bullish candles)
4. Enter in direction of rejection
5. Stop beyond the level
6. Target: Previous level or mid-level
Range Trading:
1. Identify range between two major levels
2. Buy at lower psychological level
3. Sell at upper psychological level
4. Use standard and mid-levels for position management
5. Exit if major level breaks with volume
Confluence Trading:
1. Look for combined levels (Std + Major)
2. These represent high-probability zones
3. Use as primary support/resistance
4. Increase position size at confluence
5. Expect stronger reactions at these levels
Session-Based Trading:
1. Note opening level at session start (Asian/London/NY)
2. Trade breakouts of major levels during high-volume sessions
3. London/NY sessions: More likely to break levels
4. Asian session: More likely to respect levels (range trading)
 RISK MANAGEMENT WITH PSYCHOLOGICAL LEVELS: 
Stop Loss Placement:
- Place stops just beyond psychological levels
- Add buffer (5-10 pips for forex)
- Avoid exact round numbers (stop hunting risk)
- Use previous major level as maximum stop
Take Profit Strategy:
- First target: Next standard level (partial profit)
- Second target: Next major level (remaining position)
- Trail stops to breakeven at first target
- Use distance table to calculate risk/reward
Position Sizing:
- Larger positions at major levels (higher probability)
- Smaller positions at intraday levels (lower probability)
- Scale in at standard levels between major levels
- Reduce size when multiple levels are close together
 TIMEFRAME CONSIDERATIONS: 
Higher Timeframes (4H, Daily, Weekly):
- Focus on Major and Standard levels only
- Disable Intraday and Mid levels
- Wider level spacing expected
- Use for swing trading and position trading
Lower Timeframes (5m, 15m, 1H):
- Enable all level types
- Use Intraday levels for precision
- Tighter level spacing acceptable
- Good for day trading and scalping
Multi-Timeframe Approach:
- Identify major levels on Daily/4H charts
- Refine entries using 15m/1H intraday levels
- Trade in direction of higher timeframe bias
- Use lower timeframe levels for position management
───────────────────────────────────────
 CONFIGURATION GUIDE 
───────────────────────────────────────
GENERAL SETTINGS:
Dynamic ATR-Based Spacing:
- Enabled: Recommended for most markets
- Disabled: Fixed psychological levels
- ATR Period: 14 (standard), 10 (responsive), 20 (smooth)
- ATR Multiplier: 1.0-5.0 (2.0 is balanced)
VISIBILITY SETTINGS:
Visible Range %:
- 5%: Very tight range, minimal clutter
- 10%: Balanced view (recommended)
- 20%: Wide range, more context
- 50%: Maximum range, all levels visible
Label Offset:
- 10-20 bars: Close to current price
- 30-50 bars: Moderate distance
- 50-100 bars: Far from price action
Performance Limits:
- Max Historical Bars: Reduce if indicator loads slowly
- Max Labels: Reduce for cleaner chart (20-30 recommended)
LEVEL CUSTOMIZATION:
Line Count:
- Lower (1-3): Cleaner chart, fewer levels
- Medium (4-6): Balanced view
- Higher (7-10): More context, busier chart
Line Styles:
- Solid: High importance, easy to see
- Dashed: Medium importance, clear but subtle
- Dotted: Low importance, minimal visual weight
Colors:
- Use contrasting colors for different level types
- Red/Blue/Yellow default works well
- Adjust based on chart background and personal preference
DISTANCE TABLE:
Position:
- Top Right: Doesn't interfere with price action
- Top Left: Good for right-side price scale
- Bottom positions: Less common but available
Colors:
- Default (white text, dark background) works for most charts
- Match your chart theme for consistency
- Ensure text is readable against background
ALERT CONFIGURATION:
Alert by Level Type:
- Major: Most important, fewer false signals
- Standard: Balance of frequency and importance
- Intraday: Many signals, best for active traders
Alert Frequency:
- First Cross Only: Cleaner, less noise (recommended for swing trading)
- All Crosses: Every touch, good for scalping
Alert Setup in TradingView:
1. Configure desired alert types in indicator settings
2. Right-click chart → Add Alert
3. Select this indicator
4. Choose "Any alert() function call"
5. Set delivery method (mobile, email, webhook)
───────────────────────────────────────
 ASSET-SPECIFIC TIPS 
───────────────────────────────────────
FOREX (EUR/USD, GBP/USD, etc.):
- Major levels at x.x000, x.x500
- Standard levels at x.xx00
- Intraday levels at 20/50/80 pips
- Most effective during London/NY sessions
- Watch for "figure" levels (1.0000, 1.1000)
CRYPTOCURRENCIES (BTC, ETH, etc.):
- Enable dynamic spacing for volatile markets
- Levels adjust automatically based on price
- Watch major $1,000 increments for BTC
- $100 levels important for ETH
- Smaller caps: Use standard levels
- High volatility: Increase ATR multiplier to 3.0
STOCK INDICES (SPX, NASDAQ, etc.):
- 100-point levels most important
- 500-point levels for major S/R
- 50-point mid-levels for refinement
- Watch end-of-day for level reactions
- Futures often lead spot on level breaks
GOLD/COMMODITIES:
- Major levels at $50 increments ($1,900, $1,950)
- Standard levels at $10 increments
- Very reactive to psychological levels
- Watch for false breaks during low volume
- Best reactions during active trading hours
───────────────────────────────────────
 BEST PRACTICES 
───────────────────────────────────────
Chart Setup:
- Use clean price action charts
- Avoid too many indicators
- Ensure psychological levels are clearly visible
- Match colors to your chart theme
Level Selection:
- Start with Major and Standard levels only
- Add Mid and Intraday as needed
- Less is more - avoid chart clutter
- Adjust based on timeframe
Combining with Other Tools:
- Volume profile for confluence
- Trendlines intersecting psychological levels
- Moving averages near round numbers
- Fibonacci levels coinciding with psychological levels
Common Mistakes to Avoid:
- Trading every level touch (be selective)
- Ignoring volume confirmation
- Setting stops exactly at levels (stop hunting)
- Forgetting to adjust for different assets
- Over-relying on levels without price action confirmation
Performance Optimization:
- Reduce visible range for faster loading
- Lower max historical bars on lower timeframes
- Limit labels to 30-50 for clarity
- Disable unused level types
───────────────────────────────────────
 EDUCATIONAL DISCLAIMER 
───────────────────────────────────────
This indicator identifies psychological price levels based on round numbers that tend to act as support and resistance. The methodology includes:
- Round number detection algorithms
- ATR-based dynamic spacing calculations
- Asset-specific level determination
- Distance percentage calculations
Psychological levels are a recognized concept in technical analysis, studied by traders and institutions. However, they do not guarantee price reactions and should be used as part of a comprehensive trading strategy including proper risk management, volume analysis, and price action confirmation.
───────────────────────────────────────
 USAGE DISCLAIMER 
───────────────────────────────────────
This tool is for educational and analytical purposes. Psychological levels can act as support or resistance but price reactions are not guaranteed. Dynamic spacing may generate different levels in different market conditions. Always conduct independent analysis, use proper risk management, and never risk capital you cannot afford to lose. Past performance does not indicate future results.
───────────────────────────────────────
 CREDITS & ATTRIBUTION 
───────────────────────────────────────
Original Concept: Sonar Lab
Opening Range Breakout with Multi-Timeframe Liquidity]═══════════════════════════════════════
 OPENING RANGE BREAKOUT WITH MULTI-TIMEFRAME LIQUIDITY 
═══════════════════════════════════════
A professional Opening Range Breakout (ORB) indicator enhanced with multi-timeframe liquidity detection, trading session visualization, volume analysis, and trend confirmation tools. Designed for intraday trading with comprehensive alert system.
───────────────────────────────────────
 WHAT THIS INDICATOR DOES 
───────────────────────────────────────
This indicator combines multiple trading concepts:
- Opening Range Breakout (ORB) - Customizable time period detection with automatic high/low identification
- Multi-Timeframe Liquidity - HTF (Higher Timeframe) and LTF (Lower Timeframe) key level detection
- Trading Sessions - Tokyo, London, New York, and Sydney session visualization
- Volume Analysis - Volume spike detection and strength measurement
- Multi-Timeframe Confirmation - Trend bias from higher timeframes
- EMA Integration - Trend filter and dynamic support/resistance
- Smart Alerts - Quality-filtered breakout notifications
───────────────────────────────────────
 HOW IT WORKS 
───────────────────────────────────────
 OPENING RANGE BREAKOUT (ORB): 
Concept:
The Opening Range is a period at the start of a trading session where price establishes an initial high and low. Breakouts beyond this range often indicate the direction of the day's trend.
Detection Method:
- Default: 15-minute opening range (configurable)
- Custom Range: Set specific session times with timezone support
- Automatically identifies ORH (Opening Range High) and ORL (Opening Range Low)
- Tracks ORB mid-point for reference
Range Establishment:
1. Session starts (or custom time begins)
2. Tracks highest high and lowest low during the period
3. Range confirmed at end of opening period
4. Levels extend throughout the session
Breakout Detection:
- Bullish Breakout: Close above ORH
- Bearish Breakout: Close below ORL
- Mid-point acts as bias indicator
Visual Display:
- Shaded box during range formation
- Horizontal lines for ORH, ORL, and mid-point
- Labels showing level values
- Color-coded fills based on selected method
Fill Color Methods:
1. Session Comparison:
   - Green: Current OR mid > Previous OR mid
   - Red: Current OR mid < Previous OR mid
   - Gray: Equal or first session
   - Shows day-over-day momentum
2. Breakout Direction (Recommended):
   - Green: Price currently above ORH (bullish breakout)
   - Red: Price currently below ORL (bearish breakout)
   - Gray: Price inside range (no breakout)
   - Real-time breakout status
MULTI-TIMEFRAME LIQUIDITY:
Two-Tier System for comprehensive level identification:
HTF (Higher Timeframe) Key Liquidity:
- Default: 4H timeframe (configurable to Daily, Weekly)
- Identifies major institutional levels
- Uses pivot detection with adjustable parameters
- Suitable for swing highs/lows where large orders rest
LTF (Lower Timeframe) Key Liquidity:
- Default: 1H timeframe (configurable)
- Provides precision entry/exit levels
- Finer granularity for intraday trading
- Captures minor swing points
Calculation Method:
- Pivot high/low detection algorithm
- Configurable left bars (lookback) and right bars (confirmation)
- Timeframe multiplier for accurate multi-timeframe detection
- Automatic level extension
Mitigation System:
- Tracks when levels are swept (broken)
- Configurable mitigation type: Wick or Close-based
- Option to remove or show mitigated levels
- Display limit prevents chart clutter
Asset-Specific Optimization:
The indicator includes quick reference settings for different assets:
- Major Forex (EUR/USD, GBP/USD): Default settings optimal
- Crypto (BTC/ETH): Left=12, Right=4, Display=7
- Gold: HTF=1D, Left=20
 TRADING SESSIONS: 
Four Major Sessions with Full Customization:
Tokyo Session:
- Default: 04:00-13:00 UTC+4
- Asian trading hours
- Often sets daily range
London Session:
- Default: 11:00-20:00 UTC+4
- Highest liquidity period
- Major institutional activity
New York Session:
- Default: 16:00-01:00 UTC+4
- US market hours
- High-impact news events
Sydney Session:
- Default: 01:00-10:00 UTC+4
- Earliest Asian activity
- Lower volatility
Session Features:
- Shaded background boxes
- Session name labels
- Optional open/close lines
- Session high/low tracking with colored lines
- Each session has independent color settings
- Fully customizable times and timezones
VOLUME ANALYSIS:
Volume-Based Trade Confirmation:
Volume MA:
- Configurable period (default: 20)
- Establishes average volume baseline
- Used for spike detection
Volume Spike Detection:
- Identifies when volume exceeds MA * multiplier
- Default: 1.5x average volume
- Confirms breakout strength
Volume Strength Measurement:
- Calculates current volume as percentage of average
- Shows relative volume intensity
- Used in alert quality filtering
High Volume Bars:
- Identifies bars above 50th percentile
- Additional confirmation layer
- Indicates institutional participation
MULTI-TIMEFRAME CONFIRMATION:
Trend Bias from Higher Timeframes:
HTF 1 (Trend):
- Default: 1H timeframe
- Uses EMA to determine intermediate trend
- Compares current timeframe EMA to HTF EMA
HTF 2 (Bias):
- Default: 4H timeframe
- Uses 50 EMA for longer-term bias
- Confirms overall market direction
Bias Classifications:
- Bullish Bias: HTF close > HTF 50 EMA AND Current EMA > HTF1 EMA
- Bearish Bias: HTF close < HTF 50 EMA AND Current EMA < HTF1 EMA
- Neutral Bias: Mixed signals between timeframes
EMA Stack Analysis:
- Compares EMA alignment across timeframes
- +1: Bullish stack (lower TF EMA > higher TF EMA)
- -1: Bearish stack (lower TF EMA < higher TF EMA)
- 0: Neutral/crossed
Usage:
- Filters false breakouts
- Confirms trend direction
- Improves trade quality
 EMA INTEGRATION: 
Dynamic EMA for Trend Reference:
Features:
- Configurable period (default: 20)
- Customizable color and width
- Acts as dynamic support/resistance
- Trend filter for ORB trades
Application:
- Above EMA: Favor long breakouts
- Below EMA: Favor short breakouts
- EMA cross: Potential trend change
- Distance from EMA: Momentum gauge
SMART ALERT SYSTEM:
Quality-Filtered Breakout Notifications:
Alert Types:
1. Standard ORB Breakout
2. High Quality ORB Breakout
Quality Criteria:
- Volume Confirmation: Volume > 1.2x average
- MTF Confirmation: Bias aligned with breakout direction
Standard Alert:
- Basic breakout detection
- Price crosses ORH or ORL
- Icon: 🚀 (bullish) or 🔻 (bearish)
High Quality Alert:
- Both volume AND MTF confirmed
- Stronger probability setup
- Icon: 🚀⭐ (bullish) or 🔻⭐ (bearish)
Alert Information Includes:
- Alert quality rating
- Breakout level and current price
- Volume strength percentage (if enabled)
- MTF bias status (if enabled)
- Recommended action
One Alert Per Bar:
- Prevents alert spam
- Uses flag system to track sent alerts
- Resets on new ORB session
───────────────────────────────────────
 HOW TO USE 
───────────────────────────────────────
 OPENING RANGE SETUP: 
Basic Configuration:
1. Select time period for opening range (default: 15 minutes)
2. Choose fill color method (Breakout Direction recommended)
3. Enable historical data display if needed
Custom Range (Advanced):
1. Enable Custom Range toggle
2. Set specific session time (e.g., 0930-0945)
3. Select appropriate timezone
4. Useful for specific market opens (NYSE, LSE, etc.)
 LIQUIDITY LEVELS SETUP: 
Quick Configuration by Asset:
- Forex: Use default settings (Left=15, Right=5)
- Crypto: Set Left=12, Right=4, Display=7
- Gold: Set HTF=1D, Left=20
HTF Liquidity:
- Purpose: Major support/resistance levels
- Recommended: 4H for day trading, 1D for swing trading
- Use as profit targets or reversal zones
LTF Liquidity:
- Purpose: Entry/exit refinement
- Recommended: 1H for day trading, 4H for swing trading
- Use for position management
Mitigation Settings:
- Wick-based: More sensitive (default)
- Close-based: More conservative
- Remove or Show mitigated levels based on preference
TRADING SESSIONS SETUP:
Enable/Disable Sessions:
- Master toggle for all sessions
- Individual session controls
- Show/hide session names
Session High/Low Lines:
- Enable to see session extremes
- Each session has custom colors
- Useful for range trading
Customization:
- Adjust session times for your broker
- Set timezone to match your location
- Customize colors for visibility
 VOLUME ANALYSIS SETUP: 
Enable Volume Analysis:
1. Toggle on Volume Analysis
2. Set MA length (20 recommended)
3. Adjust spike multiplier (1.5 typical)
Usage:
- Confirm breakouts with volume
- Identify climactic moves
- Filter false signals
MULTI-TIMEFRAME SETUP:
HTF Selection:
- HTF 1 (Trend): 1H for day trading, 4H for swing
- HTF 2 (Bias): 4H for day trading, 1D for swing
Interpretation:
- Trade only with bias alignment
- Neutral bias: Be cautious
- Bias changes: Potential reversals
EMA SETUP:
Configuration:
- Period: 20 for responsive, 50 for smoother
- Color: Choose contrasting color
- Width: 1-2 for visibility
Usage:
- Filter trades: Long above, Short below
- Dynamic support/resistance reference
- Trend confirmation
ALERT SETUP:
TradingView Alert Creation:
1. Enable alerts in indicator settings
2. Enable ORB Breakout Alerts
3. Right-click chart → Add Alert
4. Select this indicator
5. Choose "Any alert() function call"
6. Configure delivery method (mobile, email, webhook)
Alert Filtering:
- All alerts include quality rating
- High Quality alerts = Volume + MTF confirmed
- Standard alerts = Basic breakout only
───────────────────────────────────────
 TRADING STRATEGIES 
───────────────────────────────────────
CLASSIC ORB STRATEGY:
Setup:
1. Wait for opening range to complete
2. Price breaks and closes above ORH or below ORL
3. Volume > average (if enabled)
4. MTF bias aligned (if enabled)
Entry:
- Bullish: Buy on break above ORH
- Bearish: Sell on break below ORL
- Consider retest entries for better risk/reward
Stop Loss:
- Bullish: Below ORL or range mid-point
- Bearish: Above ORH or range mid-point
- Adjust based on volatility
Targets:
- Initial: Range width extension (ORH + range width)
- Secondary: HTF liquidity levels
- Final: Session high/low or major support/resistance
ORB + LIQUIDITY CONFLUENCE:
Enhanced Setup:
1. Opening range established
2. HTF liquidity level near or beyond ORH/ORL
3. Breakout occurs with volume
4. Price targets the liquidity level
Entry:
- Enter on ORB breakout
- Target the HTF liquidity level
- Use LTF liquidity for position management
Management:
- Partial profits at ORB + range width
- Move stop to breakeven at LTF liquidity
- Final exit at HTF liquidity sweep
ORB REJECTION STRATEGY (Counter-Trend):
Setup:
1. Price breaks above ORH or below ORL
2. Weak volume (below average)
3. MTF bias opposite to breakout
4. Price closes back inside range
Entry:
- Failed bullish break: Short below ORH
- Failed bearish break: Long above ORL
Stop Loss:
- Beyond the failed breakout level
- Or beyond session extreme
Target:
- Opposite end of opening range
- Range mid-point for partial profit
SESSION-BASED ORB TRADING:
Tokyo Session:
- Typically narrower ranges
- Good for range trading
- Wait for London open breakout
London Session:
- Highest volume and volatility
- Strong ORB setups
- Major liquidity sweeps common
New York Session:
- Strong trending moves
- News-driven volatility
- Good for momentum trades
Sydney Session:
- Quieter conditions
- Suitable for range strategies
- Sets up Tokyo session
EMA-FILTERED ORB:
Rules:
- Only take bullish breaks if price > EMA
- Only take bearish breaks if price < EMA
- Ignore counter-trend breaks
Benefits:
- Reduces false signals
- Aligns with larger trend
- Improves win rate
───────────────────────────────────────
CONFIGURATION GUIDE
───────────────────────────────────────
OPENING RANGE SETTINGS:
Time Period:
- 15 min: Standard for most markets
- 30 min: Wider range, fewer breakouts
- 60 min: For slower markets or swing trades
Custom Range:
- Use for specific market opens
- NYSE: 0930-1000 EST
- LSE: 0800-0830 GMT
- Set timezone to match exchange
Historical Display:
- Enable: See all previous session data
- Disable: Cleaner chart, current session only
LIQUIDITY SETTINGS:
Left Bars (5-30):
- Lower: More frequent, sensitive levels
- Higher: Fewer, more significant levels
- Recommended: 15 for most markets
Right Bars (1-25):
- Confirmation period
- Higher: More reliable, less frequent
- Recommended: 5 for balance
Display Limit (1-20):
- Number of active levels shown
- Higher: More context, busier chart
- Recommended: 7 for clarity
Extension Options:
- Short: Levels visible near formation
- Current: Extended to current bar (recommended)
- Max: Extended indefinitely
VOLUME SETTINGS:
MA Length (5-50):
- Shorter: More responsive to spikes
- Longer: Smoother baseline
- Recommended: 20 for balance
Spike Multiplier (1.0-3.0):
- Lower: More sensitive spike detection
- Higher: Only extreme spikes
- Recommended: 1.5 for day trading
MULTI-TIMEFRAME SETTINGS:
HTF 1 (Trend):
- 5m chart: Use 15m or 1H
- 15m chart: Use 1H or 4H
- 1H chart: Use 4H or 1D
HTF 2 (Bias):
- One level higher than HTF 1
- Provides longer-term context
- Don't use same as HTF 1
EMA SETTINGS:
Length:
- 20: Responsive, more signals
- 50: Smoother, stronger filter
- 200: Long-term trend only
Style:
- Choose contrasting color
- Width 1-2 for visibility
- Match your trading style
───────────────────────────────────────
BEST PRACTICES
───────────────────────────────────────
Chart Timeframe Selection:
- ORB Trading: Use 5m or 15m charts
- Session Review: Use 1H or 4H charts
- Swing Trading: Use 1H or 4H charts
Quality Over Quantity:
- Wait for high-quality alerts (volume + MTF)
- Avoid trading every breakout
- Focus on confluence setups
Risk Management:
- Position size based on range width
- Wider ranges = smaller positions
- Use stop losses always
- Take partial profits at targets
Market Conditions:
- Best results in trending markets
- Reduce position size in choppy conditions
- Consider session overlaps for volatility
- Avoid trading near major news if inexperienced
Continuous Improvement:
- Track win rate by session
- Note which confluence factors work best
- Adjust settings based on market volatility
- Review performance weekly
───────────────────────────────────────
PERFORMANCE OPTIMIZATION
───────────────────────────────────────
This indicator is optimized with:
- max_bars_back declarations for efficient processing
- Conditional calculations based on enabled features
- Proper memory management for drawing objects
- Minimal recalculation on each bar
Best Practices:
- Disable unused features (sessions, MTF, volume)
- Limit historical display to reduce rendering
- Use appropriate timeframe for your strategy
- Clear old drawing objects periodically
───────────────────────────────────────
EDUCATIONAL DISCLAIMER
───────────────────────────────────────
This indicator combines established trading concepts:
- Opening Range Breakout theory (price action)
- Liquidity level detection (pivot analysis)
- Session-based trading (time-of-day patterns)
- Volume analysis (confirmation technique)
- Multi-timeframe analysis (trend alignment)
All calculations use standard technical analysis methods:
- Pivot high/low detection algorithms
- Moving averages for trend and volume
- Session time filtering
- Timeframe security functions
The indicator identifies potential trading setups but does not predict future price movements. Success requires proper application within a complete trading strategy including risk management, position sizing, and market context.
───────────────────────────────────────
USAGE DISCLAIMER
───────────────────────────────────────
This tool is for educational and analytical purposes. Opening Range Breakout trading involves substantial risk. The alert system and quality filters are designed to identify potential setups but do not guarantee profitability. Always conduct independent analysis, use proper risk management, and never risk capital you cannot afford to lose. Past performance does not indicate future results. Trading intraday breakouts requires experience and discipline.
───────────────────────────────────────
CREDITS & ATTRIBUTION
───────────────────────────────────────
ORIGINAL SOURCE:
This indicator builds upon concepts from LuxAlgo's-ORB
Quantum Rotational Field MappingQuantum Rotational Field Mapping (QRFM):  
Phase Coherence Detection Through Complex-Plane Oscillator Analysis
 Quantum Rotational Field Mapping  applies complex-plane mathematics and phase-space analysis to oscillator ensembles, identifying high-probability trend ignition points by measuring when multiple independent oscillators achieve phase coherence. Unlike traditional multi-oscillator approaches that simply stack indicators or use boolean AND/OR logic, this system converts each oscillator into a rotating phasor (vector) in the complex plane and calculates the  Coherence Index (CI) —a mathematical measure of how tightly aligned the ensemble has become—then generates signals only when alignment, phase direction, and pairwise entanglement all converge.
The indicator combines three mathematical frameworks:  phasor representation  using analytic signal theory to extract phase and amplitude from each oscillator,  coherence measurement  using vector summation in the complex plane to quantify group alignment, and  entanglement analysis  that calculates pairwise phase agreement across all oscillator combinations. This creates a multi-dimensional confirmation system that distinguishes between random oscillator noise and genuine regime transitions.
 What Makes This Original 
 Complex-Plane Phasor Framework 
This indicator implements classical signal processing mathematics adapted for market oscillators. Each oscillator—whether RSI, MACD, Stochastic, CCI, Williams %R, MFI, ROC, or TSI—is first normalized to a common   scale, then converted into a complex-plane representation using an  in-phase (I)  and  quadrature (Q)  component. The in-phase component is the oscillator value itself, while the quadrature component is calculated as the first difference (derivative proxy), creating a velocity-aware representation.
 From these components, the system extracts: 
 Phase (φ) : Calculated as φ = atan2(Q, I), representing the oscillator's position in its cycle (mapped to -180° to +180°)
 Amplitude (A) : Calculated as A = √(I² + Q²), representing the oscillator's strength or conviction
This mathematical approach is fundamentally different from simply reading oscillator values. A phasor captures both  where  an oscillator is in its cycle (phase angle) and  how strongly  it's expressing that position (amplitude). Two oscillators can have the same value but be in opposite phases of their cycles—traditional analysis would see them as identical, while QRFM sees them as 180° out of phase (contradictory).
 Coherence Index Calculation 
The core innovation is the  Coherence Index (CI) , borrowed from physics and signal processing. When you have N oscillators, each with phase φₙ, you can represent each as a unit vector in the complex plane: e^(iφₙ) = cos(φₙ) + i·sin(φₙ).
 The CI measures what happens when you sum all these vectors: 
 Resultant Vector : R = Σ e^(iφₙ) = Σ cos(φₙ) + i·Σ sin(φₙ)
 Coherence Index : CI = |R| / N
Where |R| is the magnitude of the resultant vector and N is the number of active oscillators.
The CI ranges from 0 to 1:
 CI = 1.0 : Perfect coherence—all oscillators have identical phase angles, vectors point in the same direction, creating maximum constructive interference
 CI = 0.0 : Complete decoherence—oscillators are randomly distributed around the circle, vectors cancel out through destructive interference
 0 < CI < 1 : Partial alignment—some clustering with some scatter
This is not a simple average or correlation. The CI captures  phase synchronization  across the entire ensemble simultaneously. When oscillators phase-lock (align their cycles), the CI spikes regardless of their individual values. This makes it sensitive to regime transitions that traditional indicators miss.
 Dominant Phase and Direction Detection 
Beyond measuring alignment strength, the system calculates the  dominant phase  of the ensemble—the direction the resultant vector points:
 Dominant Phase : φ_dom = atan2(Σ sin(φₙ), Σ cos(φₙ))
This gives the "average direction" of all oscillator phases, mapped to -180° to +180°:
 +90° to -90°  (right half-plane): Bullish phase dominance
 +90° to +180° or -90° to -180°  (left half-plane): Bearish phase dominance
The combination of CI magnitude (coherence strength) and dominant phase angle (directional bias) creates a two-dimensional signal space. High CI alone is insufficient—you need high CI  plus  dominant phase pointing in a tradeable direction. This dual requirement is what separates QRFM from simple oscillator averaging.
 Entanglement Matrix and Pairwise Coherence 
While the CI measures global alignment, the  entanglement matrix  measures local pairwise relationships. For every pair of oscillators (i, j), the system calculates:
 E(i,j) = |cos(φᵢ - φⱼ)| 
This represents the phase agreement between oscillators i and j:
 E = 1.0 : Oscillators are in-phase (0° or 360° apart)
 E = 0.0 : Oscillators are in quadrature (90° apart, orthogonal)
 E between 0 and 1 : Varying degrees of alignment
The system counts how many oscillator pairs exceed a user-defined entanglement threshold (e.g., 0.7). This  entangled pairs count  serves as a confirmation filter: signals require not just high global CI, but also a minimum number of strong pairwise agreements. This prevents false ignitions where CI is high but driven by only two oscillators while the rest remain scattered.
The entanglement matrix creates an N×N symmetric matrix that can be visualized as a web—when many cells are bright (high E values), the ensemble is highly interconnected. When cells are dark, oscillators are moving independently.
 Phase-Lock Tolerance Mechanism 
A complementary confirmation layer is the  phase-lock detector . This calculates the maximum phase spread across all oscillators:
For all pairs (i,j), compute angular distance: Δφ = |φᵢ - φⱼ|, wrapping at 180°
 Max Spread  = maximum Δφ across all pairs
If max spread < user threshold (e.g., 35°), the ensemble is considered  phase-locked —all oscillators are within a narrow angular band.
This differs from entanglement: entanglement measures pairwise cosine similarity (magnitude of alignment), while phase-lock measures maximum angular deviation (tightness of clustering). Both must be satisfied for the highest-conviction signals.
 Multi-Layer Visual Architecture 
QRFM includes six visual components that represent the same underlying mathematics from different perspectives:
 Circular Orbit Plot : A polar coordinate grid showing each oscillator as a vector from origin to perimeter. Angle = phase, radius = amplitude. This is a real-time snapshot of the complex plane. When vectors converge (point in similar directions), coherence is high. When scattered randomly, coherence is low. Users can  see  phase alignment forming before CI numerically confirms it.
 Phase-Time Heat Map : A 2D matrix with rows = oscillators and columns = time bins. Each cell is colored by the oscillator's phase at that time (using a gradient where color hue maps to angle). Horizontal color bands indicate sustained phase alignment over time. Vertical color bands show moments when all oscillators shared the same phase (ignition points). This provides historical pattern recognition.
 Entanglement Web Matrix : An N×N grid showing E(i,j) for all pairs. Cells are colored by entanglement strength—bright yellow/gold for high E, dark gray for low E. This reveals  which  oscillators are driving coherence and which are lagging. For example, if RSI and MACD show high E but Stochastic shows low E with everything, Stochastic is the outlier.
 Quantum Field Cloud : A background color overlay on the price chart. Color (green = bullish, red = bearish) is determined by dominant phase. Opacity is determined by CI—high CI creates dense, opaque cloud; low CI creates faint, nearly invisible cloud. This gives an atmospheric "feel" for regime strength without looking at numbers.
 Phase Spiral : A smoothed plot of dominant phase over recent history, displayed as a curve that wraps around price. When the spiral is tight and rotating steadily, the ensemble is in coherent rotation (trending). When the spiral is loose or erratic, coherence is breaking down.
 Dashboard : A table showing real-time metrics: CI (as percentage), dominant phase (in degrees with directional arrow), field strength (CI × average amplitude), entangled pairs count, phase-lock status (locked/unlocked), quantum state classification ("Ignition", "Coherent", "Collapse", "Chaos"), and collapse risk (recent CI change normalized to 0-100%).
Each component is independently toggleable, allowing users to customize their workspace. The orbit plot is the most essential—it provides intuitive, visual feedback on phase alignment that no numerical dashboard can match.
 Core Components and How They Work Together 
 1. Oscillator Normalization Engine 
The foundation is creating a common measurement scale. QRFM supports eight oscillators:
 RSI : Normalized from   to   using overbought/oversold levels (70, 30) as anchors
 MACD Histogram : Normalized by dividing by rolling standard deviation, then clamped to  
 Stochastic %K : Normalized from   using (80, 20) anchors
 CCI : Divided by 200 (typical extreme level), clamped to  
 Williams %R : Normalized from   using (-20, -80) anchors
 MFI : Normalized from   using (80, 20) anchors
 ROC : Divided by 10, clamped to  
 TSI : Divided by 50, clamped to  
Each oscillator can be individually enabled/disabled. Only active oscillators contribute to phase calculations. The normalization removes scale differences—a reading of +0.8 means "strongly bullish" regardless of whether it came from RSI or TSI.
 2. Analytic Signal Construction 
For each active oscillator at each bar, the system constructs the analytic signal:
 In-Phase (I) : The normalized oscillator value itself
 Quadrature (Q) : The bar-to-bar change in the normalized value (first derivative approximation)
This creates a 2D representation: (I, Q). The phase is extracted as:
φ = atan2(Q, I) × (180 / π)
This maps the oscillator to a point on the unit circle. An oscillator at the same value but rising (positive Q) will have a different phase than one that is falling (negative Q). This velocity-awareness is critical—it distinguishes between "at resistance and stalling" versus "at resistance and breaking through."
The amplitude is extracted as:
A = √(I² + Q²)
This represents the distance from origin in the (I, Q) plane. High amplitude means the oscillator is far from neutral (strong conviction). Low amplitude means it's near zero (weak/transitional state).
3. Coherence Calculation Pipeline
For each bar (or every Nth bar if phase sample rate > 1 for performance):
 Step 1 : Extract phase φₙ for each of the N active oscillators
 Step 2 : Compute complex exponentials: Zₙ = e^(i·φₙ·π/180) = cos(φₙ·π/180) + i·sin(φₙ·π/180)
 Step 3 : Sum the complex exponentials: R = Σ Zₙ = (Σ cos φₙ) + i·(Σ sin φₙ)
 Step 4 : Calculate magnitude: |R| = √ 
 Step 5 : Normalize by count: CI_raw = |R| / N
 Step 6 : Smooth the CI: CI = SMA(CI_raw, smoothing_window)
The smoothing step (default 2 bars) removes single-bar noise spikes while preserving structural coherence changes. Users can adjust this to control reactivity versus stability.
The dominant phase is calculated as:
φ_dom = atan2(Σ sin φₙ, Σ cos φₙ) × (180 / π)
This is the angle of the resultant vector R in the complex plane.
 4. Entanglement Matrix Construction 
For all unique pairs of oscillators (i, j) where i < j:
 Step 1 : Get phases φᵢ and φⱼ
 Step 2 : Compute phase difference: Δφ = φᵢ - φⱼ (in radians)
 Step 3 : Calculate entanglement: E(i,j) = |cos(Δφ)|
 Step 4 : Store in symmetric matrix: matrix  = matrix  = E(i,j)
The matrix is then scanned: count how many E(i,j) values exceed the user-defined threshold (default 0.7). This count is the  entangled pairs  metric.
For visualization, the matrix is rendered as an N×N table where cell brightness maps to E(i,j) intensity.
 5. Phase-Lock Detection 
 Step 1 : For all unique pairs (i, j), compute angular distance: Δφ = |φᵢ - φⱼ|
 Step 2 : Wrap angles: if Δφ > 180°, set Δφ = 360° - Δφ
 Step 3 : Find maximum: max_spread = max(Δφ) across all pairs
 Step 4 : Compare to tolerance: phase_locked = (max_spread < tolerance)
If phase_locked is true, all oscillators are within the specified angular cone (e.g., 35°). This is a boolean confirmation filter.
 6. Signal Generation Logic 
Signals are generated through multi-layer confirmation:
 Long Ignition Signal :
CI crosses above ignition threshold (e.g., 0.80)
 AND  dominant phase is in bullish range (-90° < φ_dom < +90°)
 AND  phase_locked = true
 AND  entangled_pairs >= minimum threshold (e.g., 4)
 Short Ignition Signal :
CI crosses above ignition threshold
 AND  dominant phase is in bearish range (φ_dom < -90° OR φ_dom > +90°)
 AND  phase_locked = true
 AND  entangled_pairs >= minimum threshold
 Collapse Signal :
CI at bar   minus CI at current bar > collapse threshold (e.g., 0.55)
 AND  CI at bar   was above 0.6 (must collapse from coherent state, not from already-low state)
These are strict conditions. A high CI alone does not generate a signal—dominant phase must align with direction, oscillators must be phase-locked, and sufficient pairwise entanglement must exist. This multi-factor gating dramatically reduces false signals compared to single-condition triggers.
 Calculation Methodology 
 Phase 1: Oscillator Computation and Normalization 
On each bar, the system calculates the raw values for all enabled oscillators using standard Pine Script functions:
RSI: ta.rsi(close, length)
MACD: ta.macd() returning histogram component
Stochastic: ta.stoch() smoothed with ta.sma()
CCI: ta.cci(close, length)
Williams %R: ta.wpr(length)
MFI: ta.mfi(hlc3, length)
ROC: ta.roc(close, length)
TSI: ta.tsi(close, short, long)
Each raw value is then passed through a normalization function:
normalize(value, overbought_level, oversold_level) = 2 × (value - oversold) / (overbought - oversold) - 1
This maps the oscillator's typical range to  , where -1 represents extreme bearish, 0 represents neutral, and +1 represents extreme bullish.
For oscillators without fixed ranges (MACD, ROC, TSI), statistical normalization is used: divide by a rolling standard deviation or fixed divisor, then clamp to  .
 Phase 2: Phasor Extraction 
For each normalized oscillator value val:
I = val (in-phase component)
Q = val - val  (quadrature component, first difference)
Phase calculation:
phi_rad = atan2(Q, I)
phi_deg = phi_rad × (180 / π)
Amplitude calculation:
A = √(I² + Q²)
These values are stored in arrays: osc_phases  and osc_amps  for each oscillator n.
 Phase 3: Complex Summation and Coherence 
Initialize accumulators:
sum_cos = 0
sum_sin = 0
For each oscillator n = 0 to N-1:
phi_rad = osc_phases  × (π / 180)
sum_cos += cos(phi_rad)
sum_sin += sin(phi_rad)
Resultant magnitude:
resultant_mag = √(sum_cos² + sum_sin²)
Coherence Index (raw):
CI_raw = resultant_mag / N
Smoothed CI:
CI = SMA(CI_raw, smoothing_window)
Dominant phase:
phi_dom_rad = atan2(sum_sin, sum_cos)
phi_dom_deg = phi_dom_rad × (180 / π)
Phase 4: Entanglement Matrix Population
For i = 0 to N-2:
For j = i+1 to N-1:
phi_i = osc_phases  × (π / 180)
phi_j = osc_phases  × (π / 180)
delta_phi = phi_i - phi_j
E = |cos(delta_phi)|
matrix_index_ij = i × N + j
matrix_index_ji = j × N + i
entangle_matrix  = E
entangle_matrix  = E
if E >= threshold:
  entangled_pairs += 1
The matrix uses flat array storage with index mapping: index(row, col) = row × N + col.
 Phase 5: Phase-Lock Check 
max_spread = 0
For i = 0 to N-2:
For j = i+1 to N-1:
delta = |osc_phases  - osc_phases |
if delta > 180:
delta = 360 - delta
max_spread = max(max_spread, delta)
phase_locked = (max_spread < tolerance)
 Phase 6: Signal Evaluation 
 Ignition Long :
ignition_long = (CI crosses above threshold) AND
(phi_dom > -90 AND phi_dom < 90) AND
phase_locked AND
(entangled_pairs >= minimum)
 Ignition Short :
ignition_short = (CI crosses above threshold) AND
(phi_dom < -90 OR phi_dom > 90) AND
phase_locked AND
(entangled_pairs >= minimum)
 Collapse :
CI_prev = CI 
collapse = (CI_prev - CI > collapse_threshold) AND (CI_prev > 0.6)
All signals are evaluated on bar close. The crossover and crossunder functions ensure signals fire only once when conditions transition from false to true.
 Phase 7: Field Strength and Visualization Metrics 
 Average Amplitude :
avg_amp = (Σ osc_amps ) / N
 Field Strength :
field_strength = CI × avg_amp
 Collapse Risk  (for dashboard):
collapse_risk = (CI  - CI) / max(CI , 0.1)
collapse_risk_pct = clamp(collapse_risk × 100, 0, 100)
 Quantum State Classification :
if (CI > threshold AND phase_locked):
state = "Ignition"
else if (CI > 0.6):
state = "Coherent"
else if (collapse):
state = "Collapse"
else:
state = "Chaos"
 Phase 8: Visual Rendering 
 Orbit Plot : For each oscillator, convert polar (phase, amplitude) to Cartesian (x, y) for grid placement:
radius = amplitude × grid_center × 0.8
x = radius × cos(phase × π/180)
y = radius × sin(phase × π/180)
col = center + x (mapped to grid coordinates)
row = center - y
 Heat Map : For each oscillator row and time column, retrieve historical phase value at lookback = (columns - col) × sample_rate, then map phase to color using a hue gradient.
 Entanglement Web : Render matrix  as table cell with background color opacity = E(i,j).
 Field Cloud : Background color = (phi_dom > -90 AND phi_dom < 90) ? green : red, with opacity = mix(min_opacity, max_opacity, CI).
All visual components render only on the last bar (barstate.islast) to minimize computational overhead.
 How to Use This Indicator 
 Step 1 : Apply QRFM to your chart. It works on all timeframes and asset classes, though 15-minute to 4-hour timeframes provide the best balance of responsiveness and noise reduction.
 Step 2 : Enable the dashboard (default: top right) and the circular orbit plot (default: middle left). These are your primary visual feedback tools.
 Step 3 : Optionally enable the heat map, entanglement web, and field cloud based on your preference. New users may find all visuals overwhelming; start with dashboard + orbit plot.
 Step 4 : Observe for 50-100 bars to let the indicator establish baseline coherence patterns. Markets have different "normal" CI ranges—some instruments naturally run higher or lower coherence.
 Understanding the Circular Orbit Plot 
The orbit plot is a polar grid showing oscillator vectors in real-time:
 Center point : Neutral (zero phase and amplitude)
 Each vector : A line from center to a point on the grid
 Vector angle : The oscillator's phase (0° = right/east, 90° = up/north, 180° = left/west, -90° = down/south)
 Vector length : The oscillator's amplitude (short = weak signal, long = strong signal)
 Vector label : First letter of oscillator name (R = RSI, M = MACD, etc.)
 What to watch :
 Convergence : When all vectors cluster in one quadrant or sector, CI is rising and coherence is forming. This is your pre-signal warning.
 Scatter : When vectors point in random directions (360° spread), CI is low and the market is in a non-trending or transitional regime.
 Rotation : When the cluster rotates smoothly around the circle, the ensemble is in coherent oscillation—typically seen during steady trends.
 Sudden flips : When the cluster rapidly jumps from one side to the opposite (e.g., +90° to -90°), a phase reversal has occurred—often coinciding with trend reversals.
Example: If you see RSI, MACD, and Stochastic all pointing toward 45° (northeast) with long vectors, while CCI, TSI, and ROC point toward 40-50° as well, coherence is high and dominant phase is bullish. Expect an ignition signal if CI crosses threshold.
 Reading Dashboard Metrics 
The dashboard provides numerical confirmation of what the orbit plot shows visually:
 CI : Displays as 0-100%. Above 70% = high coherence (strong regime), 40-70% = moderate, below 40% = low (poor conditions for trend entries).
 Dom Phase : Angle in degrees with directional arrow. ⬆ = bullish bias, ⬇ = bearish bias, ⬌ = neutral.
 Field Strength : CI weighted by amplitude. High values (> 0.6) indicate not just alignment but  strong  alignment.
 Entangled Pairs : Count of oscillator pairs with E > threshold. Higher = more confirmation. If minimum is set to 4, you need at least 4 pairs entangled for signals.
 Phase Lock : 🔒 YES (all oscillators within tolerance) or 🔓 NO (spread too wide).
 State : Real-time classification:
🚀 IGNITION: CI just crossed threshold with phase-lock
⚡ COHERENT: CI is high and stable
💥 COLLAPSE: CI has dropped sharply
🌀 CHAOS: Low CI, scattered phases
 Collapse Risk : 0-100% scale based on recent CI change. Above 50% warns of imminent breakdown.
Interpreting Signals
 Long Ignition (Blue Triangle Below Price) :
Occurs when CI crosses above threshold (e.g., 0.80)
Dominant phase is in bullish range (-90° to +90°)
All oscillators are phase-locked (within tolerance)
Minimum entangled pairs requirement met
 Interpretation : The oscillator ensemble has transitioned from disorder to coherent bullish alignment. This is a high-probability long entry point. The multi-layer confirmation (CI + phase direction + lock + entanglement) ensures this is not a single-oscillator whipsaw.
 Short Ignition (Red Triangle Above Price) :
Same conditions as long, but dominant phase is in bearish range (< -90° or > +90°)
 Interpretation : Coherent bearish alignment has formed. High-probability short entry.
 Collapse (Circles Above and Below Price) :
CI has dropped by more than the collapse threshold (e.g., 0.55) over a 5-bar window
CI was previously above 0.6 (collapsing from coherent state)
 Interpretation : Phase coherence has broken down. If you are in a position, this is an exit warning. If looking to enter, stand aside—regime is transitioning.
 Phase-Time Heat Map Patterns 
Enable the heat map and position it at bottom right. The rows represent individual oscillators, columns represent time bins (most recent on left).
 Pattern: Horizontal Color Bands 
If a row (e.g., RSI) shows consistent color across columns (say, green for several bins), that oscillator has maintained stable phase over time. If  all  rows show horizontal bands of similar color, the entire ensemble has been phase-locked for an extended period—this is a strong trending regime.
 Pattern: Vertical Color Bands 
If a column (single time bin) shows all cells with the same or very similar color, that moment in time had high coherence. These vertical bands often align with ignition signals or major price pivots.
 Pattern: Rainbow Chaos 
If cells are random colors (red, green, yellow mixed with no pattern), coherence is low. The ensemble is scattered. Avoid trading during these periods unless you have external confirmation.
 Pattern: Color Transition 
If you see a row transition from red to green (or vice versa) sharply, that oscillator has phase-flipped. If multiple rows do this simultaneously, a regime change is underway.
 Entanglement Web Analysis 
Enable the web matrix (default: opposite corner from heat map). It shows an N×N grid where N = number of active oscillators.
 Bright Yellow/Gold Cells : High pairwise entanglement. For example, if the RSI-MACD cell is bright gold, those two oscillators are moving in phase. If the RSI-Stochastic cell is bright, they are entangled as well.
 Dark Gray Cells : Low entanglement. Oscillators are decorrelated or in quadrature.
 Diagonal : Always marked with "—" because an oscillator is always perfectly entangled with itself.
 How to use :
Scan for clustering: If most cells are bright, coherence is high across the board. If only a few cells are bright, coherence is driven by a subset (e.g., RSI and MACD are aligned, but nothing else is—weak signal).
Identify laggards: If one row/column is entirely dark, that oscillator is the outlier. You may choose to disable it or monitor for when it joins the group (late confirmation).
Watch for web formation: During low-coherence periods, the matrix is mostly dark. As coherence builds, cells begin lighting up. A sudden "web" of connections forming visually precedes ignition signals.
Trading Workflow
 Step 1: Monitor Coherence Level 
Check the dashboard CI metric or observe the orbit plot. If CI is below 40% and vectors are scattered, conditions are poor for trend entries. Wait.
 Step 2: Detect Coherence Building 
When CI begins rising (say, from 30% to 50-60%) and you notice vectors on the orbit plot starting to cluster, coherence is forming. This is your alert phase—do not enter yet, but prepare.
 Step 3: Confirm Phase Direction 
Check the dominant phase angle and the orbit plot quadrant where clustering is occurring:
Clustering in right half (0° to ±90°): Bullish bias forming
Clustering in left half (±90° to 180°): Bearish bias forming
Verify the dashboard shows the corresponding directional arrow (⬆ or ⬇).
 Step 4: Wait for Signal Confirmation 
Do  not  enter based on rising CI alone. Wait for the full ignition signal:
CI crosses above threshold
Phase-lock indicator shows 🔒 YES
Entangled pairs count >= minimum
Directional triangle appears on chart
This ensures all layers have aligned.
 Step 5: Execute Entry 
 Long : Blue triangle below price appears → enter long
 Short : Red triangle above price appears → enter short
 Step 6: Position Management 
 Initial Stop : Place stop loss based on your risk management rules (e.g., recent swing low/high, ATR-based buffer).
 Monitoring :
Watch the field cloud density. If it remains opaque and colored in your direction, the regime is intact.
Check dashboard collapse risk. If it rises above 50%, prepare for exit.
Monitor the orbit plot. If vectors begin scattering or the cluster flips to the opposite side, coherence is breaking.
 Exit Triggers :
Collapse signal fires (circles appear)
Dominant phase flips to opposite half-plane
CI drops below 40% (coherence lost)
Price hits your profit target or trailing stop
 Step 7: Post-Exit Analysis 
After exiting, observe whether a new ignition forms in the opposite direction (reversal) or if CI remains low (transition to range). Use this to decide whether to re-enter, reverse, or stand aside.
 Best Practices 
 Use Price Structure as Context 
QRFM identifies  when  coherence forms but does not specify  where  price will go. Combine ignition signals with support/resistance levels, trendlines, or chart patterns. For example:
Long ignition near a major support level after a pullback: high-probability bounce
Long ignition in the middle of a range with no structure: lower probability
 Multi-Timeframe Confirmation 
 Open QRFM on two timeframes simultaneously: 
Higher timeframe (e.g., 4-hour): Use CI level to determine regime bias. If 4H CI is above 60% and dominant phase is bullish, the market is in a bullish regime.
Lower timeframe (e.g., 15-minute): Execute entries on ignition signals that align with the higher timeframe bias.
This prevents counter-trend trades and increases win rate.
 Distinguish Between Regime Types 
 High CI, stable dominant phase (State: Coherent) : Trending market. Ignitions are continuation signals; collapses are profit-taking or reversal warnings.
 Low CI, erratic dominant phase (State: Chaos) : Ranging or choppy market. Avoid ignition signals or reduce position size. Wait for coherence to establish.
 Moderate CI with frequent collapses : Whipsaw environment. Use wider stops or stand aside.
 Adjust Parameters to Instrument and Timeframe 
 Crypto/Forex (high volatility) : Lower ignition threshold (0.65-0.75), lower CI smoothing (2-3), shorter oscillator lengths (7-10).
 Stocks/Indices (moderate volatility) : Standard settings (threshold 0.75-0.85, smoothing 5-7, oscillator lengths 14).
 Lower timeframes (5-15 min) : Reduce phase sample rate to 1-2 for responsiveness.
 Higher timeframes (daily+) : Increase CI smoothing and oscillator lengths for noise reduction.
 Use Entanglement Count as Conviction Filter 
 The minimum entangled pairs setting controls signal strictness: 
 Low (1-2) : More signals, lower quality (acceptable if you have other confirmation)
 Medium (3-5) : Balanced (recommended for most traders)
 High (6+) : Very strict, fewer signals, highest quality
Adjust based on your trade frequency preference and risk tolerance.
 Monitor Oscillator Contribution 
Use the entanglement web to see which oscillators are driving coherence. If certain oscillators are consistently dark (low E with all others), they may be adding noise. Consider disabling them. For example:
On low-volume instruments, MFI may be unreliable → disable MFI
On strongly trending instruments, mean-reversion oscillators (Stochastic, RSI) may lag → reduce weight or disable
 Respect the Collapse Signal 
Collapse events are early warnings. Price may continue in the original direction for several bars after collapse fires, but the underlying regime has weakened. Best practice:
If in profit: Take partial or full profit on collapse
If at breakeven/small loss: Exit immediately
If collapse occurs shortly after entry: Likely a false ignition; exit to avoid drawdown
Collapses do not guarantee immediate reversals—they signal  uncertainty .
 Combine with Volume Analysis 
If your instrument has reliable volume:
Ignitions with expanding volume: Higher conviction
Ignitions with declining volume: Weaker, possibly false
Collapses with volume spikes: Strong reversal signal
Collapses with low volume: May just be consolidation
Volume is not built into QRFM (except via MFI), so add it as external confirmation.
 Observe the Phase Spiral 
The spiral provides a quick visual cue for rotation consistency:
 Tight, smooth spiral : Ensemble is rotating coherently (trending)
 Loose, erratic spiral : Phase is jumping around (ranging or transitional)
If the spiral tightens, coherence is building. If it loosens, coherence is dissolving.
 Do Not Overtrade Low-Coherence Periods 
When CI is persistently below 40% and the state is "Chaos," the market is not in a regime where phase analysis is predictive. During these times:
Reduce position size
Widen stops
Wait for coherence to return
QRFM's strength is regime detection. If there is no regime, the tool correctly signals "stand aside."
 Use Alerts Strategically 
 Set alerts for: 
Long Ignition
Short Ignition
Collapse
Phase Lock (optional)
Configure alerts to "Once per bar close" to avoid intrabar repainting and noise. When an alert fires, manually verify:
Orbit plot shows clustering
Dashboard confirms all conditions
Price structure supports the trade
Do not blindly trade alerts—use them as prompts for analysis.
Ideal Market Conditions
Best Performance
 Instruments :
Liquid, actively traded markets (major forex pairs, large-cap stocks, major indices, top-tier crypto)
Instruments with clear cyclical oscillator behavior (avoid extremely illiquid or manipulated markets)
 Timeframes :
15-minute to 4-hour: Optimal balance of noise reduction and responsiveness
1-hour to daily: Slower, higher-conviction signals; good for swing trading
5-minute: Acceptable for scalping if parameters are tightened and you accept more noise
 Market Regimes :
Trending markets with periodic retracements (where oscillators cycle through phases predictably)
Breakout environments (coherence forms before/during breakout; collapse occurs at exhaustion)
Rotational markets with clear swings (oscillators phase-lock at turning points)
 Volatility :
Moderate to high volatility (oscillators have room to move through their ranges)
Stable volatility regimes (sudden VIX spikes or flash crashes may create false collapses)
Challenging Conditions
 Instruments :
Very low liquidity markets (erratic price action creates unstable oscillator phases)
Heavily news-driven instruments (fundamentals may override technical coherence)
Highly correlated instruments (oscillators may all reflect the same underlying factor, reducing independence)
 Market Regimes :
Deep, prolonged consolidation (oscillators remain near neutral, CI is chronically low, few signals fire)
Extreme chop with no directional bias (oscillators whipsaw, coherence never establishes)
Gap-driven markets (large overnight gaps create phase discontinuities)
 Timeframes :
Sub-5-minute charts: Noise dominates; oscillators flip rapidly; coherence is fleeting and unreliable
Weekly/monthly: Oscillators move extremely slowly; signals are rare; better suited for long-term positioning than active trading
 Special Cases :
During major economic releases or earnings: Oscillators may lag price or become decorrelated as fundamentals overwhelm technicals. Reduce position size or stand aside.
In extremely low-volatility environments (e.g., holiday periods): Oscillators compress to neutral, CI may be artificially high due to lack of movement, but signals lack follow-through.
Adaptive Behavior
QRFM is designed to self-adapt to poor conditions:
When coherence is genuinely absent, CI remains low and signals do not fire
When only a subset of oscillators aligns, entangled pairs count stays below threshold and signals are filtered out
When phase-lock cannot be achieved (oscillators too scattered), the lock filter prevents signals
This means the indicator will naturally produce fewer (or zero) signals during unfavorable conditions, rather than generating false signals. This is a  feature —it keeps you out of low-probability trades.
Parameter Optimization by Trading Style
Scalping (5-15 Minute Charts)
 Goal : Maximum responsiveness, accept higher noise
 Oscillator Lengths :
RSI: 7-10
MACD: 8/17/6
Stochastic: 8-10, smooth 2-3
CCI: 14-16
Others: 8-12
 Coherence Settings :
CI Smoothing Window: 2-3 bars (fast reaction)
Phase Sample Rate: 1 (every bar)
Ignition Threshold: 0.65-0.75 (lower for more signals)
Collapse Threshold: 0.40-0.50 (earlier exit warnings)
 Confirmation :
Phase Lock Tolerance: 40-50° (looser, easier to achieve)
Min Entangled Pairs: 2-3 (fewer oscillators required)
 Visuals :
Orbit Plot + Dashboard only (reduce screen clutter for fast decisions)
Disable heavy visuals (heat map, web) for performance
 Alerts :
Enable all ignition and collapse alerts
Set to "Once per bar close"
Day Trading (15-Minute to 1-Hour Charts)
 Goal : Balance between responsiveness and reliability
 Oscillator Lengths :
RSI: 14 (standard)
MACD: 12/26/9 (standard)
Stochastic: 14, smooth 3
CCI: 20
Others: 10-14
 Coherence Settings :
CI Smoothing Window: 3-5 bars (balanced)
Phase Sample Rate: 2-3
Ignition Threshold: 0.75-0.85 (moderate selectivity)
Collapse Threshold: 0.50-0.55 (balanced exit timing)
 Confirmation :
Phase Lock Tolerance: 30-40° (moderate tightness)
Min Entangled Pairs: 4-5 (reasonable confirmation)
 Visuals :
Orbit Plot + Dashboard + Heat Map or Web (choose one)
Field Cloud for regime backdrop
 Alerts :
Ignition and collapse alerts
Optional phase-lock alert for advance warning
Swing Trading (4-Hour to Daily Charts)
 Goal : High-conviction signals, minimal noise, fewer trades
 Oscillator Lengths :
RSI: 14-21
MACD: 12/26/9 or 19/39/9 (longer variant)
Stochastic: 14-21, smooth 3-5
CCI: 20-30
Others: 14-20
 Coherence Settings :
CI Smoothing Window: 5-10 bars (very smooth)
Phase Sample Rate: 3-5
Ignition Threshold: 0.80-0.90 (high bar for entry)
Collapse Threshold: 0.55-0.65 (only significant breakdowns)
 Confirmation :
Phase Lock Tolerance: 20-30° (tight clustering required)
Min Entangled Pairs: 5-7 (strong confirmation)
 Visuals :
All modules enabled (you have time to analyze)
Heat Map for multi-bar pattern recognition
Web for deep confirmation analysis
 Alerts :
Ignition and collapse
Review manually before entering (no rush)
Position/Long-Term Trading (Daily to Weekly Charts)
 Goal : Rare, very high-conviction regime shifts
 Oscillator Lengths :
RSI: 21-30
MACD: 19/39/9 or 26/52/12
Stochastic: 21, smooth 5
CCI: 30-50
Others: 20-30
 Coherence Settings :
CI Smoothing Window: 10-14 bars
Phase Sample Rate: 5 (every 5th bar to reduce computation)
Ignition Threshold: 0.85-0.95 (only extreme alignment)
Collapse Threshold: 0.60-0.70 (major regime breaks only)
 Confirmation :
Phase Lock Tolerance: 15-25° (very tight)
Min Entangled Pairs: 6+ (broad consensus required)
 Visuals :
Dashboard + Orbit Plot for quick checks
Heat Map to study historical coherence patterns
Web to verify deep entanglement
 Alerts :
Ignition only (collapses are less critical on long timeframes)
Manual review with fundamental analysis overlay
Performance Optimization (Low-End Systems)
If you experience lag or slow rendering:
 Reduce Visual Load :
Orbit Grid Size: 8-10 (instead of 12+)
Heat Map Time Bins: 5-8 (instead of 10+)
Disable Web Matrix entirely if not needed
Disable Field Cloud and Phase Spiral
 Reduce Calculation Frequency :
Phase Sample Rate: 5-10 (calculate every 5-10 bars)
Max History Depth: 100-200 (instead of 500+)
 Disable Unused Oscillators :
If you only want RSI, MACD, and Stochastic, disable the other five. Fewer oscillators = smaller matrices, faster loops.
 Simplify Dashboard :
Choose "Small" dashboard size
Reduce number of metrics displayed
These settings will not significantly degrade signal quality (signals are based on bar-close calculations, which remain accurate), but will improve chart responsiveness.
Important Disclaimers
This indicator is a technical analysis tool designed to identify periods of phase coherence across an ensemble of oscillators. It is  not  a standalone trading system and does not guarantee profitable trades. The Coherence Index, dominant phase, and entanglement metrics are mathematical calculations applied to historical price data—they measure past oscillator behavior and do not predict future price movements with certainty.
 No Predictive Guarantee : High coherence indicates that oscillators are currently aligned, which historically has coincided with trending or directional price movement. However, past alignment does not guarantee future trends. Markets can remain coherent while prices consolidate, or lose coherence suddenly due to news, liquidity changes, or other factors not captured by oscillator mathematics.
 Signal Confirmation is Probabilistic : The multi-layer confirmation system (CI threshold + dominant phase + phase-lock + entanglement) is designed to filter out low-probability setups. This increases the proportion of valid signals relative to false signals, but does not eliminate false signals entirely. Users should combine QRFM with additional analysis—support and resistance levels, volume confirmation, multi-timeframe alignment, and fundamental context—before executing trades.
 Collapse Signals are Warnings, Not Reversals : A coherence collapse indicates that the oscillator ensemble has lost alignment. This often precedes trend exhaustion or reversals, but can also occur during healthy pullbacks or consolidations. Price may continue in the original direction after a collapse. Use collapses as risk management cues (tighten stops, take partial profits) rather than automatic reversal entries.
 Market Regime Dependency : QRFM performs best in markets where oscillators exhibit cyclical, mean-reverting behavior and where trends are punctuated by retracements. In markets dominated by fundamental shocks, gap openings, or extreme low-liquidity conditions, oscillator coherence may be less reliable. During such periods, reduce position size or stand aside.
 Risk Management is Essential : All trading involves risk of loss. Use appropriate stop losses, position sizing, and risk-per-trade limits. The indicator does not specify stop loss or take profit levels—these must be determined by the user based on their risk tolerance and account size. Never risk more than you can afford to lose.
 Parameter Sensitivity : The indicator's behavior changes with input parameters. Aggressive settings (low thresholds, loose tolerances) produce more signals with lower average quality. Conservative settings (high thresholds, tight tolerances) produce fewer signals with higher average quality. Users should backtest and forward-test parameter sets on their specific instruments and timeframes before committing real capital.
 No Repainting by Design : All signal conditions are evaluated on bar close using bar-close values. However, the visual components (orbit plot, heat map, dashboard) update in real-time during bar formation for monitoring purposes. For trade execution, rely on the confirmed signals (triangles and circles) that appear only after the bar closes.
 Computational Load : QRFM performs extensive calculations, including nested loops for entanglement matrices and real-time table rendering. On lower-powered devices or when running multiple indicators simultaneously, users may experience lag. Use the performance optimization settings (reduce visual complexity, increase phase sample rate, disable unused oscillators) to improve responsiveness.
This system is most effective when used as  one component  within a broader trading methodology that includes sound risk management, multi-timeframe analysis, market context awareness, and disciplined execution. It is a tool for regime detection and signal confirmation, not a substitute for comprehensive trade planning.
Technical Notes
 Calculation Timing : All signal logic (ignition, collapse) is evaluated using bar-close values. The barstate.isconfirmed or implicit bar-close behavior ensures signals do not repaint. Visual components (tables, plots) render on every tick for real-time feedback but do not affect signal generation.
 Phase Wrapping : Phase angles are calculated in the range -180° to +180° using atan2. Angular distance calculations account for wrapping (e.g., the distance between +170° and -170° is 20°, not 340°). This ensures phase-lock detection works correctly across the ±180° boundary.
 Array Management : The indicator uses fixed-size arrays for oscillator phases, amplitudes, and the entanglement matrix. The maximum number of oscillators is 8. If fewer oscillators are enabled, array sizes shrink accordingly (only active oscillators are processed).
 Matrix Indexing : The entanglement matrix is stored as a flat array with size N×N, where N is the number of active oscillators. Index mapping: index(row, col) = row × N + col. Symmetric pairs (i,j) and (j,i) are stored identically.
 Normalization Stability : Oscillators are normalized to   using fixed reference levels (e.g., RSI overbought/oversold at 70/30). For unbounded oscillators (MACD, ROC, TSI), statistical normalization (division by rolling standard deviation) is used, with clamping to prevent extreme outliers from distorting phase calculations.
 Smoothing and Lag : The CI smoothing window (SMA) introduces lag proportional to the window size. This is intentional—it filters out single-bar noise spikes in coherence. Users requiring faster reaction can reduce the smoothing window to 1-2 bars, at the cost of increased sensitivity to noise.
 Complex Number Representation : Pine Script does not have native complex number types. Complex arithmetic is implemented using separate real and imaginary accumulators (sum_cos, sum_sin) and manual calculation of magnitude (sqrt(real² + imag²)) and argument (atan2(imag, real)).
 Lookback Limits : The indicator respects Pine Script's maximum lookback constraints. Historical phase and amplitude values are accessed using the   operator, with lookback limited to the chart's available bar history (max_bars_back=5000 declared).
 Visual Rendering Performance : Tables (orbit plot, heat map, web, dashboard) are conditionally deleted and recreated on each update using table.delete() and table.new(). This prevents memory leaks but incurs redraw overhead. Rendering is restricted to barstate.islast (last bar) to minimize computational load—historical bars do not render visuals.
 Alert Condition Triggers : alertcondition() functions evaluate on bar close when their boolean conditions transition from false to true. Alerts do not fire repeatedly while a condition remains true (e.g., CI stays above threshold for 10 bars fires only once on the initial cross).
 Color Gradient Functions : The phaseColor() function maps phase angles to RGB hues using sine waves offset by 120° (red, green, blue channels). This creates a continuous spectrum where -180° to +180° spans the full color wheel. The amplitudeColor() function maps amplitude to grayscale intensity. The coherenceColor() function uses cos(phase) to map contribution to CI (positive = green, negative = red).
 No External Data Requests : QRFM operates entirely on the chart's symbol and timeframe. It does not use request.security() or access external data sources. All calculations are self-contained, avoiding lookahead bias from higher-timeframe requests.
 Deterministic Behavior : Given identical input parameters and price data, QRFM produces identical outputs. There are no random elements, probabilistic sampling, or time-of-day dependencies.
— Dskyz, Engineering precision. Trading coherence.
Trend Pivot Retracements▶ OVERVIEW 
Trend Pivot Retracements   identifies market trend direction using a Donchian-style channel and dynamically highlights retracement zones during trending conditions. It calculates the percentage pullbacks from recent highs and lows, plots labeled zones with varying intensity, and visually connects key retracement pivots. The indicator also emphasizes price proximity to trend boundaries by dynamically adjusting the thickness of plotted trend bands.
 ▶ TREND DETECTION & BAND STRUCTURE 
The indicator determines the current trend by checking for new 50-bar extremes:
Uptrend: If a new highest high is made, the trend is considered bullish.
Downtrend: If a new lowest low is made, the trend is considered bearish.
Uptrend Band: Plots the 50-bar lowest low as a trailing support level.
Downtrend Band: Plots the 50-bar highest high as a trailing resistance level.
Thickness Variation: The thickness of the band increases the further price moves from it, indicating overextension.
 ▶ RETRACEMENT LABELING SYSTEM 
During a trend, the indicator monitors pivot points in the opposite direction to measure retracements:
Bullish Retracement:
Triggered when a pivot low forms during an uptrend.
Measures % pullback from the most recent swing high (searched up to 20 bars back).
Plots a bold horizontal line at the low and a dashed diagonal from the previous swing high.
Adds a “-%” label above the low; intensity is based on recent 50 pullbacks.
Bearish Retracement:
Triggered when a pivot high forms during a downtrend.
Measures % pullback from the previous swing low (up to 20 bars back).
Plots a bold horizontal line at the high and a dashed diagonal from the prior swing low.
Adds a “%” label below the high with gradient color based on the past 50 extremes.
 
▶ PIVOT CONNECTION LINES 
Each retracement includes a visual connector:
A diagonal dashed line linking the swing extreme (20 bars back) to the retracement point.
This line visually traces the path of price retreat within the trend.
Helps traders understand where the retracement originated and how steep it was.
 ▶ TREND SWITCH SIGNALS 
When trend direction changes:
A diamond marker is plotted on the new pivot confirming the trend shift.
Green diamonds signal new bullish trends at fresh lows.
Magenta diamonds signal new bearish trends at fresh highs.
 ▶ COLOR INTENSITY & CONTEXTUAL AWARENESS 
To help interpret the magnitude of retracements:
The % labels are color-coded using a gradient scale that references the max of the last 50 pullbacks.
Stronger pullbacks result in deeper color intensity, signaling more significant corrections.
Trend bands also use standard deviation normalization to adjust line thickness based on how far price has moved from the band.
This creates a visual cue for potential exhaustion or volatility extremes.
 ▶ USAGE 
Trend Pivot Retracements is a powerful tool for traders who want to:
Identify trend direction and contextual pullbacks within those trends.
Spot key retracement points that may serve as entry opportunities or reversal signals.
Use visual retracement angles to understand market pressure and trend maturity.
Read dynamic band thickness as an alert for price stretch, potential mean reversion, or breakout setups.
 ▶ CONCLUSION 
Trend Pivot Retracements   gives traders a clean, visually expressive way to monitor trending markets, while capturing and labeling meaningful retracements. With adaptive color intensity, diagonal connectors, and smart trend switching, it enhances situational awareness and provides immediate clarity on trend health and pullback strength.
USDJPY Fair Value Gap + Session Strategy🎯 Overview 
This strategy combines Fair Value Gaps (FVGs) with session-based order flow analysis, specifically optimized for USDJPY. It identifies price inefficiencies left behind by institutional order flow during high-volatility trading sessions, offering a modern alternative to traditional lagging indicators.
 🔬 What Are Fair Value Gaps? 
Fair Value Gaps represent areas where aggressive institutional buying or selling created "gaps" in the market structure:
Bullish FVG: Price moves up so aggressively that it leaves unfilled buy orders behind
Bearish FVG: Price moves down so quickly that it leaves unfilled sell orders behind
Research shows approximately 80% of FVGs get "filled" (price returns to the gap) within 20-60 bars, making them highly predictable trading zones.
(see the generated image above)
(see the generated image above)
FVG Detection Logic:
text
// Bullish FVG: Gap between high  and current low
bullishFVG = low > high  and high  > high 
// Bearish FVG: Gap between low  and current high
bearishFVG = high < low  and low  < low 
 🌏 Session-Based Trading 
Why Sessions Matter for USDJPY
(see the generated image above)
Tokyo Session (00:00-09:00 UTC)
Highest volatility during first hour (00:00-01:00 UTC)
Average movement: 51-60 pips
Best for breakout strategies
London/NY Overlap (13:00-16:00 UTC)
Maximum liquidity and institutional participation
Tightest spreads and most reliable FVG formations
Optimal for continuation trades
Monday Premium Effect
USDJPY moves 120+ pips on Mondays due to weekend positioning
Enhanced FVG formation during session opens
 📊 Strategy Components 
(see the generated image above)
1. Fair Value Gap Detection
Identifies bullish and bearish FVGs automatically
Age limit: FVGs expire after 20 bars to avoid stale setups
Size filter: Minimum gap size to filter out noise
2. Session Filtering
Tokyo Open focus: Trades during first hour of Asian session
London/NY Overlap: Captures high-liquidity institutional flows
Weekend gap strategy: Enhanced signals on Monday opens
3. Volume Confirmation
Requires 1.5x average volume spike
Confirms institutional participation
Reduces false signals
4. Trend Alignment
50 EMA filter ensures trades align with higher timeframe trend
Long trades above EMA, short trades below
Prevents costly counter-trend trades
5. Risk Management
2:1 Risk/Reward minimum ensures profitability with 40%+ win rate
Percentage-based stops adapt to USDJPY volatility (0.3% default)
Configurable position sizing
 🎯 Entry Conditions 
(see the generated image above)
Long Entry (BUY)
✅ Bullish FVG detected in previous bars
✅ Price returns to FVG zone during active trading session
✅ Volume spike above 1.5x average
✅ Price above 50 EMA (trend confirmation)
✅ Bullish candle closes within FVG zone
✅ Trading during Tokyo open OR London/NY overlap
Short Entry (SELL)
✅ Bearish FVG detected in previous bars
✅ Price returns to FVG zone during active trading session
✅ Volume spike above 1.5x average
✅ Price below 50 EMA (trend confirmation)
✅ Bearish candle closes within FVG zone
✅ Trading during Tokyo open OR London/NY overlap
 📈 Expected Performance 
 
 Backtesting Results (Based on Similar Strategies):
 Win Rate: 44-59% (profitable due to high R:R ratio)
 Average Winner: 60-90 pips during London/NY sessions
 Average Loser: 30-40 pips (tight stops at FVG boundaries)
 Risk/Reward: 2:1 minimum, often 3:1 during strong trends
 Best Performance: Monday Tokyo opens and Wednesday London/NY overlaps
 Why This Works for USDJPY:
 90% correlation with US-Japan bond yield spreads
 High volatility provides sufficient pip movement
 Heavy institutional/central bank participation creates clear FVGs
 Consistent volatility patterns across trading sessions
 
⚙️ Configurable Parameters
Session Settings:
Trade Tokyo Session (Enable/Disable)
Trade London/NY Overlap (Enable/Disable)
FVG Settings:
FVG Minimum Size (Filter small gaps)
Maximum FVG Age (20 bars default)
Show FVG Markers (Visual display)
Volume Settings:
Use Volume Filter (Enable/Disable)
Volume Multiplier (1.5x default)
Volume Average Period (20 bars)
Trend Settings:
Use Trend Filter (Enable/Disable)
Trend EMA Period (50 default)
Risk Management:
Risk/Reward Ratio (2.0 default)
Stop Loss Percentage (0.3% default)
🎨 Visual Indicators
🟡 Yellow Line: 50 EMA trend filter
🟢 Green Triangles: Long entry signals
🔴 Red Triangles: Short entry signals
🟢 Green Dots: Bullish FVG zones
🔴 Red Dots: Bearish FVG zones
🟦 Blue Background: Tokyo open session
🟧 Orange Background: London/NY overlap
📊 Recommended Settings
Optimal Timeframes:
Primary: 5-minute charts (scalping)
Secondary: 15-minute charts (swing trading)
Parameter Optimization:
Conservative: Stop Loss 0.2%, R:R 2:1, Volume 2.0x
Balanced: Stop Loss 0.3%, R:R 2:1, Volume 1.5x (default)
Aggressive: Stop Loss 0.4%, R:R 1.5:1, Volume 1.2x
Risk Management:
Maximum 1-2% of account per trade
Daily loss limit: Stop after 3-5 consecutive losses
Use fixed percentage position sizing
⚠️ Important Considerations
Avoid Trading During:
Major news events (BOJ interventions, NFP, FOMC)
Holiday periods with reduced liquidity
Low volatility Asian afternoon sessions
When US-Japan yield differential narrows sharply
Best Practices:
Limit to 2-3 trades per session maximum
Always respect the 50 EMA trend filter
Never risk more than planned per trade
Paper trade for 2-4 weeks before live implementation
Track performance by session and day of week
🚀 How to Use
 
 Add the script to your USDJPY chart
 Set timeframe to 5-minute or 15-minute
 Adjust parameters based on your risk tolerance
 Enable strategy alerts for automated notifications
 Wait for visual signals (triangles) to appear
 Enter trades according to your risk management rules
 
📚 Strategy Foundation
This strategy is based on:
Smart Money Concepts (SMC): Institutional order flow tracking
Market Microstructure: Understanding how FVGs form in electronic trading
Quantified Risk Management: Statistical edge through proper R:R ratios
Session Liquidity Patterns: Exploiting predictable volatility cycles
Advanced Speedometer Gauge [PhenLabs]Advanced Speedometer Gauge  
Version: PineScript™v6
 📌 Description 
The Advanced Speedometer Gauge is a revolutionary multi-metric visualization tool that consolidates 13 distinct trading indicators into a single, intuitive speedometer display. Instead of cluttering your workspace with multiple oscillators and panels, this gauge provides a unified interface where you can switch between different metrics while maintaining consistent visual interpretation.
Built on PineScript™ v6, the indicator transforms complex technical calculations into an easy-to-read semi-circular gauge with color-coded zones and a precision needle indicator. Each of the 13 available metrics has been carefully normalized to a 0-100 scale, ensuring that whether you’re analyzing RSI, volume trends, or volatility extremes, the visual interpretation remains consistent and intuitive.
The gauge is designed for traders who value efficiency and clarity. By consolidating multiple analytical perspectives into one compact display, you can quickly assess market conditions without the visual noise of traditional multi-indicator setups. All metrics are non-overlapping, meaning each provides unique insights into different aspects of market behavior.
 🚀 Points of Innovation 
 
  13 selectable metrics covering momentum, volume, volatility, trend, and statistical analysis, all accessible through a single dropdown menu
  Universal 0-100 normalization system that standardizes different indicator scales for consistent visual interpretation across all metrics
  Semi-circular gauge design with 21 arc segments providing smooth precision and clear visual feedback through color-coded zones
  Non-redundant metric selection ensuring each indicator provides unique market insights without analytical overlap
  Advanced metrics including MFI (volume-weighted momentum), CCI (statistical deviation), Volatility Rank (extended lookback), Trend Strength (ADX-style), Choppiness Index, Volume Trend, and Price Distance from MA
  Flexible positioning system with 5 chart locations, 3 size options, and fully customizable color schemes for optimal workspace integration
 
 🔧 Core Components 
 
   Metric Selection Engine:  Dropdown interface allowing instant switching between 13 different technical indicators, each with independent parameter controls
   Normalization System:  All metrics converted to 0-100 scale using indicator-specific algorithms that preserve the statistical significance of each measurement
   Semi-Circular Gauge:  Visual display using 21 arc segments arranged in curved formation with two-row thickness for enhanced visibility
   Color Zone System:  Three distinct zones (0-40 green, 40-70 yellow, 70-100 red) providing instant visual feedback on metric extremes
   Needle Indicator:  Dynamic pointer that positions across the gauge arc based on precise current metric value
   Table Implementation:  Professional table structure ensuring consistent positioning and rendering across different chart configurations
 
 🔥 Key Features 
 
   RSI (Relative Strength Index):  Classic momentum oscillator measuring overbought/oversold conditions with adjustable period length (default 14)
   Stochastic Oscillator:  Compares closing price to price range over specified period with smoothing, ideal for identifying momentum shifts
   MFI (Money Flow Index):  Volume-weighted RSI that combines price movement with volume to measure buying and selling pressure intensity
   CCI (Commodity Channel Index):  Measures statistical deviation from average price, normalized from typical -200 to +200 range to 0-100 scale
   Williams %R:  Alternative overbought/oversold indicator using high-low range analysis, inverted to match 0-100 scale conventions
   Volume %:  Current volume relative to moving average expressed as percentage, capped at 100 for extreme spikes
   Volume Trend:  Cumulative directional volume flow showing whether volume is flowing into up moves or down moves over specified period
   ATR Percentile:  Current Average True Range position within historical range using specified lookback period (default 100 bars)
   Volatility Rank:  Close-to-close volatility measured against extended historical range (default 252 days), differs from ATR in calculation method
   Momentum:  Rate of change calculation showing price movement speed, centered at 50 and normalized to 0-100 range
   Trend Strength:  ADX-style calculation using directional movement to quantify trend intensity regardless of direction
   Choppiness Index:  Measures market choppiness versus trending behavior, where high values indicate ranging markets and low values indicate strong trends
   Price Distance from MA:  Measures current price over-extension from moving average using standard deviation calculations
 
 🎨 Visualization 
 
   Semi-Circular Arc Display:  Curved gauge spanning from 0 (left) to 100 (right) with smooth progression and two-row thickness for visibility
   Color-Coded Zones:  Green zone (0-40) for low/oversold conditions, yellow zone (40-70) for neutral readings, red zone (70-100) for high/overbought conditions
   Needle Indicator:  Downward-pointing triangle (▼) positioned precisely at current metric value along the gauge arc
   Scale Markers:  Vertical line markers at 0, 25, 50, 75, and 100 positions with corresponding numerical labels below
   Title Display:  Merged cell showing “𓄀 PhenLabs” branding plus currently selected metric name in monospace font
   Large Value Display:  Current metric value shown with two decimal precision in large text directly below title
   Table Structure:  Professional table with customizable background color, text color, and transparency for minimal chart obstruction
 
 📖 Usage Guidelines 
 Metric Selection 
 
   Select Metric:  Default: RSI | Options: RSI, Stochastic, Volume %, ATR Percentile, Momentum, MFI (Money Flow), CCI (Commodity Channel), Williams %R, Volatility Rank, Trend Strength, Choppiness Index, Volume Trend, Price Distance | Choose the technical indicator you want to display on the gauge based on your current analytical needs
 
 RSI Settings 
 
   RSI Length:  Default: 14 | Range: 1+ | Controls the lookback period for RSI calculation, shorter periods increase sensitivity to recent price changes
 
 Stochastic Settings 
 
   Stochastic Length:  Default: 14 | Range: 1+ | Lookback period for stochastic calculation comparing close to high-low range
   Stochastic Smooth:  Default: 3 | Range: 1+ | Smoothing period applied to raw stochastic value to reduce noise and false signals
 
 Volume Settings 
 
   Volume MA Length:  Default: 20 | Range: 1+ | Moving average period used to calculate average volume for comparison with current volume
   Volume Trend Length:  Default: 20 | Range: 5+ | Period for calculating cumulative directional volume flow trend
 
 ATR and Volatility Settings 
 
   ATR Length:  Default: 14 | Range: 1+ | Period for Average True Range calculation used in ATR Percentile metric
   ATR Percentile Lookback:  Default: 100 | Range: 20+ | Historical range used to determine current ATR position as percentile
   Volatility Rank Lookback (Days):  Default: 252 | Range: 50+ | Extended lookback period for Volatility Rank metric using close-to-close volatility
 
 Momentum and Trend Settings 
 
   Momentum Length:  Default: 10 | Range: 1+ | Lookback period for rate of change calculation in Momentum metric
   Trend Strength Length:  Default: 20 | Range: 5+ | Period for directional movement calculations in ADX-style Trend Strength metric
 
 Advanced Metric Settings 
 
   MFI Length:  Default: 14 | Range: 1+ | Lookback period for Money Flow Index calculation combining price and volume
   CCI Length:  Default: 20 | Range: 1+ | Period for Commodity Channel Index statistical deviation calculation
   Williams %R Length:  Default: 14 | Range: 1+ | Lookback period for Williams %R high-low range analysis
   Choppiness Index Length:  Default: 14 | Range: 5+ | Period for calculating market choppiness versus trending behavior
   Price Distance MA Length:  Default: 50 | Range: 10+ | Moving average period used for Price Distance standard deviation calculation
 
 Visual Customization 
 
   Position:  Default: Top Right | Options: Top Left, Top Right, Bottom Left, Bottom Right, Middle Right | Controls gauge placement on chart for optimal workspace organization
   Size:  Default: Normal | Options: Small, Normal, Large | Adjusts overall gauge dimensions and text size for different monitor resolutions and preferences
   Low Zone Color (0-40):  Default: Green (#00FF00) | Customize color for low/oversold zone of gauge arc
   Medium Zone Color (40-70):  Default: Yellow (#FFFF00) | Customize color for neutral/medium zone of gauge arc
   High Zone Color (70-100):  Default: Red (#FF0000) | Customize color for high/overbought zone of gauge arc
   Background Color:  Default: Semi-transparent dark gray | Customize gauge background for contrast and chart integration
   Text Color:  Default: White (#FFFFFF) | Customize all text elements including title, value, and scale labels
 
 ✅ Best Use Cases 
 
  Quick visual assessment of market conditions when you need instant feedback on whether an asset is in extreme territory across multiple analytical dimensions
  Workspace organization for traders who monitor multiple indicators but want to reduce chart clutter and visual complexity
  Metric comparison by switching between different indicators while maintaining consistent visual interpretation through the 0-100 normalization
  Overbought/oversold identification using RSI, Stochastic, Williams %R, or MFI depending on whether you prefer price-only or volume-weighted analysis
  Volume analysis through Volume %, Volume Trend, or MFI to confirm price movements with corresponding volume characteristics
  Volatility monitoring using ATR Percentile or Volatility Rank to identify expansion/contraction cycles and adjust position sizing
  Trend vs range identification by comparing Trend Strength (high values = trending) against Choppiness Index (high values = ranging)
  Statistical over-extension detection using CCI or Price Distance to identify when price has deviated significantly from normal behavior
  Multi-timeframe analysis by duplicating the gauge on different timeframe charts to compare metric readings across time horizons
  Educational purposes for new traders learning to interpret technical indicators through consistent visual representation
 
 ⚠️ Limitations 
 
  The gauge displays only one metric at a time, requiring manual switching to compare different indicators rather than simultaneous multi-metric viewing
  The 0-100 normalization, while providing consistency, may obscure the raw values and specific nuances of each underlying indicator
  Table-based visualization cannot be exported or saved as an image separately from the full chart screenshot
  Optimal parameter settings vary by asset type, timeframe, and market conditions, requiring user experimentation for best results
 
 💡 What Makes This Unique 
 
   Unified Multi-Metric Interface:  The only gauge-style indicator offering 13 distinct metrics through a single interface, eliminating the need for multiple oscillator panels
   Non-Overlapping Analytics:  Each metric provides genuinely unique insights—MFI combines volume with price, CCI measures statistical deviation, Volatility Rank uses extended lookback, Trend Strength quantifies directional movement, and Choppiness Index measures ranging behavior
   Universal Normalization System:  All metrics standardized to 0-100 scale using indicator-appropriate algorithms that preserve statistical meaning while enabling consistent visual interpretation
   Professional Visual Design:  Semi-circular gauge with 21 arc segments, precision needle positioning, color-coded zones, and clean table implementation that maintains clarity across all chart configurations
   Extensive Customization:  Independent parameter controls for each metric, five position options, three size presets, and full color customization for seamless workspace integration
 
 🔬 How It Works 
 1. Metric Calculation Phase: 
 
  All 13 metrics are calculated simultaneously on every bar using their respective algorithms with user-defined parameters
  Each metric applies its own specific calculation method—RSI uses average gains vs losses, Stochastic compares close to high-low range, MFI incorporates typical price and volume, CCI measures deviation from statistical mean, ATR calculates true range, directional indicators measure up/down movement, and statistical metrics analyze price relationships
 
 2. Normalization Process: 
 
  Each calculated metric is converted to a standardized 0-100 scale using indicator-appropriate transformations
  Some metrics are naturally 0-100 (RSI, Stochastic, MFI, Williams %R), while others require scaling—CCI transforms from ±200 range, Momentum centers around 50, Volume ratio caps at 2x for 100, ATR and Volatility Rank calculate percentile positions, and Price Distance scales by standard deviations
 
 3. Gauge Rendering: 
 
  The selected metric’s normalized value determines the needle position across 21 arc segments spanning 0-100
  Each arc segment receives its color based on position—segments 0-8 are green zone, segments 9-14 are yellow zone, segments 15-20 are red zone
  The needle indicator (▼) appears in row 5 at the column corresponding to the current metric value, providing precise visual feedback
 
 4. Table Construction: 
 
  The gauge uses TradingView’s table system with merged cells for title and value display, ensuring consistent positioning regardless of chart configuration
  Rows are allocated as follows: Row 0 merged for title, Row 1 merged for large value display, Row 2 for spacing, Rows 3-4 for the semi-circular arc with curved shaping, Row 5 for needle indicator, Row 6 for scale markers, Row 7 for numerical labels at 0/25/50/75/100
  All visual elements update on every bar when barstate.islast is true, ensuring real-time accuracy without performance impact
 
 💡 Note: 
This indicator is designed for visual analysis and market condition assessment, not as a standalone trading system. For best results, combine gauge readings with price action analysis, support and resistance levels, and broader market context. Parameter optimization is recommended based on your specific trading timeframe and asset class. The gauge works on all timeframes but may require different parameter settings for intraday versus daily/weekly analysis. Consider using multiple instances of the gauge set to different metrics for comprehensive market analysis without switching between settings.
Stochastic Enhanced [DCAUT]█ Stochastic Enhanced  
 📊 ORIGINALITY & INNOVATION 
The Stochastic Enhanced indicator builds upon George Lane's classic momentum oscillator (developed in the late 1950s) by providing comprehensive smoothing algorithm flexibility. While traditional implementations limit users to Simple Moving Average (SMA) smoothing, this enhanced version offers 21 advanced smoothing algorithms, allowing traders to optimize the indicator's characteristics for different market conditions and trading styles.
 Key Improvements: 
 
 Extended from single SMA smoothing to 21 professional-grade algorithms including adaptive filters (KAMA, FRAMA), zero-lag methods (ZLEMA, T3), and advanced digital filters (Kalman, Laguerre)
 Maintains backward compatibility with traditional Stochastic calculations through SMA default setting
 Unified smoothing algorithm applies to both %K and %D lines for consistent signal processing characteristics
 Enhanced visual feedback with clear color distinction and background fill highlighting for intuitive signal recognition
 Comprehensive alert system covering crossovers and zone entries for systematic trade management
 
 Differentiation from Traditional Stochastic: 
Traditional Stochastic indicators use fixed SMA smoothing, which introduces consistent lag regardless of market volatility. This enhanced version addresses the limitation by offering adaptive algorithms that adjust to market conditions (KAMA, FRAMA), reduce lag without sacrificing smoothness (ZLEMA, T3, HMA), or provide superior noise filtering (Kalman Filter, Laguerre filters). The flexibility helps traders balance responsiveness and stability according to their specific needs.
 📐 MATHEMATICAL FOUNDATION 
 Core Stochastic Calculation: 
The Stochastic Oscillator measures the position of the current close relative to the high-low range over a specified period:
 Step 1: Raw %K Calculation 
%K_raw = 100 × (Close - Lowest Low) / (Highest High - Lowest Low)
Where:
 
 Close = Current closing price
 Lowest Low = Lowest low over the %K Length period
 Highest High = Highest high over the %K Length period
 Result ranges from 0 (close at period low) to 100 (close at period high)
 
 Step 2: Smoothed %K Calculation 
%K = MA(%K_raw, K Smoothing Period, MA Type)
Where:
 
 MA = Selected moving average algorithm (SMA, EMA, etc.)
 K Smoothing = 1 for Fast Stochastic, 3+ for Slow Stochastic
 Traditional Fast Stochastic uses %K_raw directly without smoothing
 
 Step 3: Signal Line %D Calculation 
%D = MA(%K, D Smoothing Period, MA Type)
Where:
 
 %D acts as a signal line and moving average of %K
 D Smoothing typically set to 3 periods in traditional implementations
 Both %K and %D use the same MA algorithm for consistent behavior
 
 Available Smoothing Algorithms (21 Options): 
 Standard Moving Averages: 
 
 SMA (Simple): Equal-weighted average, traditional default, consistent lag characteristics
 EMA (Exponential): Recent price emphasis, faster response to changes, exponential decay weighting
 RMA (Rolling/Wilder's): Smoothed average used in RSI, less reactive than EMA
 WMA (Weighted): Linear weighting favoring recent data, moderate responsiveness
 VWMA (Volume-Weighted): Incorporates volume data, reflects market participation intensity
 
 Advanced Moving Averages: 
 
 HMA (Hull): Reduced lag with smoothness, uses weighted moving averages and square root period
 ALMA (Arnaud Legoux): Gaussian distribution weighting, minimal lag with good noise reduction
 LSMA (Least Squares): Linear regression based, fits trend line to data points
 DEMA (Double Exponential): Reduced lag compared to EMA, uses double smoothing technique
 TEMA (Triple Exponential): Further lag reduction, triple smoothing with lag compensation
 ZLEMA (Zero-Lag Exponential): Lag elimination attempt using error correction, very responsive
 TMA (Triangular): Double-smoothed SMA, very smooth but slower response
 
 Adaptive & Intelligent Filters: 
 
 T3 (Tilson T3): Six-pass exponential smoothing with volume factor adjustment, excellent smoothness
 FRAMA (Fractal Adaptive): Adapts to market fractal dimension, faster in trends, slower in ranges
 KAMA (Kaufman Adaptive): Efficiency ratio based adaptation, responds to volatility changes
 McGinley Dynamic: Self-adjusting mechanism following price more accurately, reduced whipsaws
 Kalman Filter: Optimal estimation algorithm from aerospace engineering, dynamic noise filtering
 
 Advanced Digital Filters: 
 
 Ultimate Smoother: Advanced digital filter design, superior noise rejection with minimal lag
 Laguerre Filter: Time-domain filter with N-order implementation, adjustable lag characteristics
 Laguerre Binomial Filter: 6-pole Laguerre filter, extremely smooth output for long-term analysis
 Super Smoother: Butterworth filter implementation, removes high-frequency noise effectively
 
 📊 COMPREHENSIVE SIGNAL ANALYSIS 
 Absolute Level Interpretation (%K Line): 
 
 %K Above 80: Overbought condition, price near period high, potential reversal or pullback zone, caution for new long entries
 %K in 70-80 Range: Strong upward momentum, bullish trend confirmation, uptrend likely continuing
 %K in 50-70 Range: Moderate bullish momentum, neutral to positive outlook, consolidation or mild uptrend
 %K in 30-50 Range: Moderate bearish momentum, neutral to negative outlook, consolidation or mild downtrend
 %K in 20-30 Range: Strong downward momentum, bearish trend confirmation, downtrend likely continuing
 %K Below 20: Oversold condition, price near period low, potential bounce or reversal zone, caution for new short entries
 
 Crossover Signal Analysis: 
 
 %K Crosses Above %D (Bullish Cross): Momentum shifting bullish, faster line overtakes slower signal, consider long entry especially in oversold zone, strongest when occurring below 20 level
 %K Crosses Below %D (Bearish Cross): Momentum shifting bearish, faster line falls below slower signal, consider short entry especially in overbought zone, strongest when occurring above 80 level
 Crossover in Midrange (40-60): Less reliable signals, often in choppy sideways markets, require additional confirmation from trend or volume analysis
 Multiple Failed Crosses: Indicates ranging market or choppy conditions, reduce position sizes or avoid trading until clear directional move
 
 Advanced Divergence Patterns (%K Line vs Price): 
 
 Bullish Divergence: Price makes lower low while %K makes higher low, indicates weakening bearish momentum, potential trend reversal upward, more reliable when %K in oversold zone
 Bearish Divergence: Price makes higher high while %K makes lower high, indicates weakening bullish momentum, potential trend reversal downward, more reliable when %K in overbought zone
 Hidden Bullish Divergence: Price makes higher low while %K makes lower low, indicates trend continuation in uptrend, bullish trend strength confirmation
 Hidden Bearish Divergence: Price makes lower high while %K makes higher high, indicates trend continuation in downtrend, bearish trend strength confirmation
 
 Momentum Strength Analysis (%K Line Slope): 
 
 Steep %K Slope: Rapid momentum change, strong directional conviction, potential for extended moves but also increased reversal risk
 Gradual %K Slope: Steady momentum development, sustainable trends more likely, lower probability of sharp reversals
 Flat or Horizontal %K: Momentum stalling, potential reversal or consolidation ahead, wait for directional break before committing
 %K Oscillation Within Range: Indicates ranging market, sideways price action, better suited for range-trading strategies than trend following
 
 🎯 STRATEGIC APPLICATIONS 
 Mean Reversion Strategy (Range-Bound Markets): 
 
 Identify ranging market conditions using price action or Bollinger Bands
 Wait for Stochastic to reach extreme zones (above 80 for overbought, below 20 for oversold)
 Enter counter-trend position when %K crosses %D in extreme zone (sell on bearish cross above 80, buy on bullish cross below 20)
 Set profit targets near opposite extreme or midline (50 level)
 Use tight stop-loss above recent swing high/low to protect against breakout scenarios
 Exit when Stochastic reaches opposite extreme or %K crosses %D in opposite direction
 
 Trend Following with Momentum Confirmation: 
 
 Identify primary trend direction using higher timeframe analysis or moving averages
 Wait for Stochastic pullback to oversold zone (<20) in uptrend or overbought zone (>80) in downtrend
 Enter in trend direction when %K crosses %D confirming momentum shift (bullish cross in uptrend, bearish cross in downtrend)
 Use wider stops to accommodate normal trend volatility
 Add to position on subsequent pullbacks showing similar Stochastic pattern
 Exit when Stochastic shows opposite extreme with failed cross or bearish/bullish divergence
 
 Divergence-Based Reversal Strategy: 
 
 Scan for divergence between price and Stochastic at swing highs/lows
 Confirm divergence with at least two price pivots showing divergent Stochastic readings
 Wait for %K to cross %D in direction of anticipated reversal as entry trigger
 Enter position in divergence direction with stop beyond recent swing extreme
 Target profit at key support/resistance levels or Fibonacci retracements
 Scale out as Stochastic reaches opposite extreme zone
 
 Multi-Timeframe Momentum Alignment: 
 
 Analyze Stochastic on higher timeframe (4H or Daily) for primary trend bias
 Switch to lower timeframe (1H or 15M) for precise entry timing
 Only take trades where lower timeframe Stochastic signal aligns with higher timeframe momentum direction
 Higher timeframe Stochastic in bullish zone (>50) = only take long entries on lower timeframe
 Higher timeframe Stochastic in bearish zone (<50) = only take short entries on lower timeframe
 Exit when lower timeframe shows counter-signal or higher timeframe momentum reverses
 
 Zone Transition Strategy: 
 
 Monitor Stochastic for transitions between zones (oversold to neutral, neutral to overbought, etc.)
 Enter long when Stochastic crosses above 20 (exiting oversold), signaling momentum shift from bearish to neutral/bullish
 Enter short when Stochastic crosses below 80 (exiting overbought), signaling momentum shift from bullish to neutral/bearish
 Use zone midpoint (50) as dynamic support/resistance for position management
 Trail stops as Stochastic advances through favorable zones
 Exit when Stochastic fails to maintain momentum and reverses back into prior zone
 
 📋 DETAILED PARAMETER CONFIGURATION 
 %K Length (Default: 14): 
 
 Lower Values (5-9): Highly sensitive to price changes, generates more frequent signals, increased false signals in choppy markets, suitable for very short-term trading and scalping
 Standard Values (10-14): Balanced sensitivity and reliability, traditional default (14) widely used,适合 swing trading and intraday strategies
 Higher Values (15-21): Reduced sensitivity, smoother oscillations, fewer but potentially more reliable signals, better for position trading and lower timeframe noise reduction
 Very High Values (21+): Slow response, long-term momentum measurement, fewer trading signals, suitable for weekly or monthly analysis
 
 %K Smoothing (Default: 3): 
 
 Value 1: Fast Stochastic, uses raw %K calculation without additional smoothing, most responsive to price changes, generates earliest signals with higher noise
 Value 3: Slow Stochastic (default), traditional smoothing level, reduces false signals while maintaining good responsiveness, widely accepted standard
 Values 5-7: Very slow response, extremely smooth oscillations, significantly reduced whipsaws but delayed entry/exit timing
 Recommendation: Default value 3 suits most trading scenarios, active short-term traders may use 1, conservative long-term positions use 5+
 
 %D Smoothing (Default: 3): 
 
 Lower Values (1-2): Signal line closely follows %K, frequent crossover signals, useful for active trading but requires strict filtering
 Standard Value (3): Traditional setting providing balanced signal line behavior, optimal for most trading applications
 Higher Values (4-7): Smoother signal line, fewer crossover signals, reduced whipsaws but slower confirmation, better for trend trading
 Very High Values (8+): Signal line becomes slow-moving reference, crossovers rare and highly significant, suitable for long-term position changes only
 
 Smoothing Type Algorithm Selection: 
 For Trending Markets: 
 
 ZLEMA, DEMA, TEMA: Reduced lag for faster trend entry, quick response to momentum shifts, suitable for strong directional moves
 HMA, ALMA: Good balance of smoothness and responsiveness, effective for clean trend following without excessive noise
 EMA: Classic choice for trending markets, faster than SMA while maintaining reasonable stability
 
 For Ranging/Choppy Markets: 
 
 Kalman Filter, Super Smoother: Superior noise filtering, reduces false signals in sideways action, helps identify genuine reversal points
 Laguerre Filters: Smooth oscillations with adjustable lag, excellent for mean reversion strategies in ranges
 T3, TMA: Very smooth output, filters out market noise effectively, clearer extreme zone identification
 
 For Adaptive Market Conditions: 
 
 KAMA: Automatically adjusts to market efficiency, fast in trends and slow in congestion, reduces whipsaws during transitions
 FRAMA: Adapts to fractal market structure, responsive during directional moves, conservative during uncertainty
 McGinley Dynamic: Self-adjusting smoothing, follows price naturally, minimizes lag in trending markets while filtering noise in ranges
 
 For Conservative Long-Term Analysis: 
 
 SMA: Traditional choice, predictable behavior, widely understood characteristics
 RMA (Wilder's): Smooth oscillations, reduced sensitivity to outliers, consistent behavior across market conditions
 Laguerre Binomial Filter: Extremely smooth output, ideal for weekly/monthly timeframe analysis, eliminates short-term noise completely
 
 Source Selection: 
 
 Close (Default): Standard choice using closing prices, most common and widely tested
 HLC3 or OHLC4: Incorporates more price information, reduces impact of sudden spikes or gaps, smoother oscillator behavior
 HL2: Midpoint of high-low range, emphasizes intrabar volatility, useful for markets with wide intraday ranges
 Custom Source: Can use other indicators as input (e.g., Heikin Ashi close, smoothed price), creates derivative momentum indicators
 
 📈 PERFORMANCE ANALYSIS & COMPETITIVE ADVANTAGES 
 Responsiveness Characteristics: 
 Traditional SMA-Based Stochastic: 
 
 Fixed lag regardless of market conditions, consistent delay of approximately (K Smoothing + D Smoothing) / 2 periods
 Equal treatment of trending and ranging markets, no adaptation to volatility changes
 Predictable behavior but suboptimal in varying market regimes
 
 Enhanced Version with Adaptive Algorithms: 
 
 KAMA and FRAMA reduce lag by up to 40-60% in strong trends compared to SMA while maintaining similar smoothness in ranges
 ZLEMA and T3 provide near-zero lag characteristics for early entry signals with acceptable noise levels
 Kalman Filter and Super Smoother offer superior noise rejection, reducing false signals in choppy conditions by estimations of 30-50% compared to SMA
 Performance improvements vary by algorithm selection and market conditions
 
 Signal Quality Improvements: 
 
 Adaptive algorithms help reduce whipsaw trades in ranging markets by adjusting sensitivity dynamically
 Advanced filters (Kalman, Laguerre, Super Smoother) provide clearer extreme zone readings for mean reversion strategies
 Zero-lag methods (ZLEMA, DEMA, TEMA) generate earlier crossover signals in trending markets for improved entry timing
 Smoother algorithms (T3, Laguerre Binomial) reduce false extreme zone touches for more reliable overbought/oversold signals
 
 Comparison with Standard Implementations: 
 
 Versus Basic Stochastic: Enhanced version offers 21 smoothing options versus single SMA, allowing optimization for specific market characteristics and trading styles
 Versus RSI: Stochastic provides range-bound measurement (0-100) with clear extreme zones, RSI measures momentum speed, Stochastic offers clearer visual overbought/oversold identification
 Versus MACD: Stochastic bounded oscillator suitable for mean reversion, MACD unbounded indicator better for trend strength, Stochastic excels in range-bound and oscillating markets
 Versus CCI: Stochastic has fixed bounds (0-100) for consistent interpretation, CCI unbounded with variable extremes, Stochastic provides more standardized extreme readings across different instruments
 
 Flexibility Advantages: 
 
 Single indicator adaptable to multiple strategies through algorithm selection rather than requiring different indicator variants
 Ability to optimize smoothing characteristics for specific instruments (e.g., smoother for crypto volatility, faster for forex trends)
 Multi-timeframe analysis with consistent algorithm across timeframes for coherent momentum picture
 Backtesting capability with algorithm as optimization parameter for strategy development
 
 Limitations and Considerations: 
 
 Increased complexity from multiple algorithm choices may lead to over-optimization if parameters are curve-fitted to historical data
 Adaptive algorithms (KAMA, FRAMA) have adjustment periods during market regime changes where signals may be less reliable
 Zero-lag algorithms sacrifice some smoothness for responsiveness, potentially increasing noise sensitivity in very choppy conditions
 Performance characteristics vary significantly across algorithms, requiring understanding and testing before live implementation
 Like all oscillators, Stochastic can remain in extreme zones for extended periods during strong trends, generating premature reversal signals
 
 USAGE NOTES 
This indicator is designed for technical analysis and educational purposes to provide traders with enhanced flexibility in momentum analysis. The Stochastic Oscillator has limitations and should not be used as the sole basis for trading decisions.
 Important Considerations: 
 
 Algorithm performance varies with market conditions - no single smoothing method is optimal for all scenarios
 Extreme zone signals (overbought/oversold) indicate potential reversal areas but not guaranteed turning points, especially in strong trends
 Crossover signals may generate false entries during sideways choppy markets regardless of smoothing algorithm
 Divergence patterns require confirmation from price action or additional indicators before trading
 Past indicator characteristics and backtested results do not guarantee future performance
 Always combine Stochastic analysis with proper risk management, position sizing, and multi-indicator confirmation
 Test selected algorithm on historical data of specific instrument and timeframe before live trading
 Market regime changes may require algorithm adjustment for optimal performance
 
The enhanced smoothing options are intended to provide tools for optimizing the indicator's behavior to match individual trading styles and market characteristics, not to create a perfect predictive tool. Responsible usage includes understanding the mathematical properties of selected algorithms and their appropriate application contexts.
AI Trading Alerts v6 — SL/TP + Confidence + Panel (Fixed)Overview 
This Pine Script is designed to identify high-probability trading opportunities in Forex, commodities, and crypto markets. It combines EMA trend filters, RSI, and Stochastic RSI, with automatic stop-loss (SL) & take-profit (TP) suggestions, and provides a confidence panel to quickly assess the trade setup strength.
It also includes TradingView alert conditions so you can set up notifications for Long/Short setups and EMA crosses.
 ⚙️ Features 
 EMA Trend Filter 
 
 Uses EMA 50, 100, 200 for trend confirmation.
 Bull trend = EMA50 > EMA100 > EMA200
 Bear trend = EMA50 < EMA100 < EMA200
 
 RSI Filter 
 
 Bullish trades require RSI > 50
 Bearish trades require RSI < 50
 
 Stochastic RSI Filter 
 
 Prevents entries during overbought/oversold extremes.
 Bullish entry only if %K and %D < 80
 Bearish entry only if %K and %D > 20
 
 EMA Proximity Check 
 
 Price must be near EMA50 (within ATR × adjustable multiplier).
 
 Signals 
Continuation Signals:
 
 Long if all bullish conditions align.
 Short if all bearish conditions align.
 
Cross Events:
 
 Long Cross when price crosses above EMA50 in bull trend.
 Short Cross when price crosses below EMA50 in bear trend.
 
 Automatic SL/TP Suggestions 
SL size adjusts depending on asset:
 
 Gold/Silver (XAU/XAG): 5 pts
 Bitcoin/Ethereum: 100 pts
 FX pairs (default): 20 pts
 
TP = SL × Risk:Reward ratio (default 1:2).
 Confidence Score (0–4) 
Based on conditions met (trend, RSI, Stoch, EMA proximity).
Labels:
 
 Strongest (4/4)
 Strong (3/4)
 Medium (2/4)
 Low (1/4)
 
 Visual Panel on Chart 
 
 Shows ✅/❌ for each condition (trend, RSI, Stoch, EMA proximity, signal now).
 Confidence row with color-coded strength.
 
 Alerts 
 
 Long Setup
 Short Setup
 Long Cross
 Short Cross
 
 🖥️ How to Use 
 1. Add the Script 
 
 Open TradingView → Pine Editor.
 Paste the full script.
 Click Add to chart.
 Save as "AI Trading Alerts v6 — SL/TP + Confidence + Panel".
 
 2. Configure Inputs 
 
 EMA Lengths: Default 50/100/200 (works well for swing trading).
 RSI Length: 14 (standard).
 Stochastic Length/K/D: Default 14/3/3.
 Risk:Reward Ratio: Default 2.0 (can change to 1.5, 3.0, etc.).
 EMA Proximity Threshold: Default 0.20 × ATR (adjust to be stricter/looser).
 
 3. Read the Panel 
Top-right of chart, you’ll see ✅ or ❌ for:
 
 Trend → Are EMAs aligned?
 RSI → Above 50 (bull) or below 50 (bear)?
 Stoch OK → Not extreme?
 Near EMA50 → Close enough to EMA50?
 Above/Below OK → Price position vs. EMA50 matches trend?
 Signal Now → Entry triggered?
 
Confidence row:
 
 🟢 Green = Strongest
 🟩 Light green = Strong
 🟧 Orange = Medium
 🟨 Yellow = Low
 ⬜ Gray = None
 
 4. Alerts Setup 
Go to TradingView Alerts (⏰ icon).
Choose the script under “Condition”.
Select alert type:
 
 Long Setup
 Short Setup
 Long Cross
 Short Cross
 
Set notification method (popup, sound, email, mobile).
Click Create.
Now TradingView will notify you automatically when signals appear.
 5. Example Workflow 
Wait for Confidence = Strong/Strongest.
Check if market session supports volatility (e.g., XAU in London/NY).
Review SL/TP suggestions:
 
 Long → Entry: current price, SL: close - risk_pts, TP: close + risk_pts × RR.
 Short → Entry: current price, SL: close + risk_pts, TP: close - risk_pts × RR.
 
Adjust based on your own price action analysis.
 📊 Best Practices 
 
 Use on H1 + D1 combo → align higher timeframe bias with intraday entries.
 Risk only 1–2% of account per trade (position sizing required).
 Filter with market sessions (Asia, Europe, US).
 Strongest signals work best with trending pairs (e.g., XAUUSD, USDJPY, BTCUSD).
MAxRSI Signals [KedArc Quant]Description:
MAxRSI Indicator Marks LONG/SHORT signals from a Moving Average crossover and (optionally) confirms them with RSI. Includes repaint-safe confirmation, optional higher-timeframe (HTF) smoothing, bar coloring, and alert conditions.
Why combine MA + RSI
* The MA crossover is the primary trend signal (fast trend vs slow trend).
* RSI is a gate, not a second, separate signal. A crossover only becomes a trade signal if momentum agrees (e.g., RSI ≥ level for LONG, ≤ level for SHORT). This reduces weak crosses in ranging markets.
* The parts are integrated in one rule: *Crossover AND RSI condition (if enabled)* → plot signal/alert. No duplicated outputs or unrelated indicators.
How it works (logic)
* MA types: SMA / EMA / WMA / HMA (HMA is built via WMA of `len/2` and `len`, then WMA with `sqrt(len)`).
* Signals:
* LONG when *Fast MA crosses above Slow MA* and (if enabled) *RSI ≥ Long Min*.
* SHORT when *Fast MA crosses below Slow MA* and (if enabled) *RSI ≤ Short Max*.
* Repaint-safe (optional): confirms crosses on closed bars to avoid intrabar repaint.
* HTF (optional): computes MA/RSI on a higher timeframe to smooth noise on lower charts.
* Alerts: crossover alerts + state-flip (bull↔bear) alerts.
How to use (step-by-step)
1. Add to chart. Set MA Type, Fast and Slow (keep Fast < Slow).
2. Turn Use RSI Filter ON for confirmation (default: RSI 14 with 50/50 levels).
3. (Optional) Turn Repaint-Safe ON for close-confirmed signals.
4. (Optional) Turn HTF ON (e.g., 60 = 1h) for smoother signals on low TFs.
5. Enable alerts: pick “MAxRSI Long/Short” or “Bullish/Bearish State”.
Timeframe guidance
* Intraday (1–15m): EMA 9–20 fast vs EMA 50 slow, RSI filter at 50/50.
* Swing (1h–D): EMA 20 fast vs EMA 200 slow, RSI 50/50 (55/45 for stricter).
What makes it original
* Repaint-safe cross confirmation (previous-bar check) for reliable signals/alerts.
* HTF gating (doesn’t compute both branches) for speed and clarity.
* Warning-free MA helper (precomputes SMA/EMA/WMA/HMA each bar), HMA built from built-ins only.
* State-flip alerts and optional RSI overlay on price pane.
Built-ins used
`ta.sma`, `ta.ema`, `ta.wma`, (HMA built from these), `ta.rsi`, `ta.crossover`, `ta.crossunder`, `request.security`, `plot`, `plotshape`, `barcolor`, `alertcondition`, `input.*`, `math.*`.
Note: Indicator only (no orders). Test settings per symbol. Not financial advice.
⚠️ Disclaimer
This script is provided for educational purposes only.
Past performance does not guarantee future results.
Trading involves risk, and users should exercise caution and use proper risk management when applying this strategy.
CCI Stochastic - YOSI
CCI Stochastic (Pro v6) – MTF, Adaptive Bands & Live Label
What it does
This indicator applies a Stochastic calculation on the CCI (K/D lines) to highlight momentum shifts, overbought/oversold zones, and adaptive market regimes. It comes with optional higher-timeframe confirmation, adaptive volatility bands, a live value label, and built-in alerts.
Key Features
Core Signal: Choose between D or K line of the Stoch-CCI.
Extreme Zones: Customizable OB/OS thresholds (default 80/20) and a midline (50), with dynamic background shading.
Adaptive Bands (optional): Mean ± k·standard deviation of the signal, to capture cyclic extremes.
MTF Confirmation (optional): Fetches the same signal from a higher timeframe via request.security.
Arrows/Signals:
Enter – Cross above OS (Buy) / below OB (Sell).
Center – Cross of the 50 midline (momentum shift).
Exit – Exit from extreme zones.
Alerts: All arrow signals + adaptive band crosses.
Live Value Label: Shows the latest signal value near the last bar, customizable decimals/offset/background colors.
Visuals: Red line above OB, green below OS, gray neutral; adaptive band fills.
Use Cases
Momentum / Reversals: Enter with OS/OB crosses confirmed by MTF.
Trend validation: Combine with moving averages (e.g., EMA200) or support/resistance.
Mean Reversion: Fade extreme zones, especially with adaptive band or OB/OS exit alerts.
Inputs
CCI Period, Stoch Period, Smooth K/D – core calculation.
Overbought / Oversold – thresholds (default 80/20).
Line to plot – K or D.
Show Arrows (Enter, Center, Exit) – visual control.
Adaptive Bands – length and k multiplier.
Higher TF – optional confirmation timeframe.
Live Label – decimals, offset, colors.
Quick Tips
For scalping/short-term setups: tighten OB/OS (e.g., 85/15) to filter noise.
In high volatility: increase adaptLen or decrease k to smooth bands.
Reduce false signals: require local + MTF alignment (e.g., only long if MTF > 50).
Disclaimer
This is a technical analysis tool – not a standalone buy/sell signal. Always use with proper risk management, key levels, and confluence from multiple factors.
מה זה עושה?
האינדיקטור מחשב Stochastic על CCI (קו K/D) ומציג אזורי קיצון, חציות ומשטרי שוק. הוא כולל אופציה לאישור מטיימפריים גבוה, בנדים אדפטיביים, תווית ערך חיה והתרעות מוכנות.
יכולות עיקריות
סיגנל מרכזי: בחירה בין קו D או K של Stoch-CCI.
אזורי קיצון: קווים ניתנים להגדרה (ברירת מחדל 80/20) וקו אמצע 50, עם צביעת רקע דינמית כשנכנסים לקיצון.
Adaptive Bands (אופציונלי): ממוצע ± k·סטיית תקן של הסיגנל—מסייע לזהות overheat ומחזוריות.
אישור MTF (אופציונלי): אותו סיגנל מטיימפריים גבוה באמצעות request.security.
חיצים/סיגנלים:
Enter – חציה מלמטה מעל OS (קנייה) / מלמעלה מתחת OB (מכירה).
Center – חציה של 50 (שינוי מומנטום).
Exit – יציאה מאזורים קיצוניים (OS/OB).
Alerts: לכל הסיגנלים לעיל + כניסה/יציאה לבנדים האדפטיביים.
תווית ערך חיה: מציגה את ערך הסיגנל האחרון ליד הנקודה (ספרות ו־offset ניתנים להגדרה).
עיצוב קריא: צבע קו אדום מעל OB, ירוק מתחת OS, אפור ניטרלי; מילוי אזורים.
שימוש מומלץ
מומנטום/היפוכים: כניסה עם חציה מה-OS/OB ואישור מה-MTF.
ממוצע נע/רמות מחיר: חברו לאימות מגמה (למשל EMA200 או תמיכה/התנגדות).
Mean Reversion: חיפוש חזרה מאזורי קיצון, במיוחד כשיש התרעת יציאה מ-OB/OS או נגיעה בבנד אדפטיבי.
קלטים מרכזיים
CCI Period, Stoch Period, Smooth K/D – פרמטרי חישוב.
Overbought / Oversold – ספי קיצון (ברירת מחדל 80/20).
Line to plot – בחירה בין K או D.
Show Arrows/Center/Exit/Enter – שליטה בתצוגת החיצים.
Adaptive Bands (len, k) – חלון ורגישות לבנדים.
Higher TF – טיימפריים לאישור (אופציונלי).
Live Label – ספרות, היסט ברים, צבעי רקע.
טיפים מהירים
בסקלפים/טווחים קצרים: הקשיחו ספי קיצון (למשל 85/15) להפחתת רעש.
בשוק תנודתי: העלו את adaptLen או הורידו את k כדי לקבל בנדים רגישים פחות.
להקטנת אותות שווא: דרשו התאמה בין הסיגנל המקומי ל-MTF (לדוגמה, לונג רק כשה-MTF מעל 50).
הערה חשובה
זהו כלי ניתוח טכני—לא אות קנייה/מכירה בפני עצמו. שלבו אותו עם ניהול סיכונים (SL/TP), בדיקת רמות מפתח ואימות ממספר אינדיקטורים או טיימפריימים.
RMA Smoothed RSIRMA Smoothed RSI 
 Description: 
An enhanced RSI built for cleaner intraday and swing reads. It applies RMA smoothing to damp noise.
 How It Works 
RSI (RMA-Smoothed):
Computes classic RSI from price changes and smooths the result with an additional RMA (user-controlled 3–7, where 5 is the sweet spot). This reduces whipsaw while preserving shifts in momentum.
 How to Interpret 
50 Midline = Bias Filter: Above 50 favors strength; below 50 favors weakness.
RSI vs RSI-MA Crosses: Cross up can precede thrust or mean-revert toward 50; cross down the opposite.
 Inputs 
Length: RSI period (default 14).
Source: Price source for RSI (default Close).
Smoothing: RMA smoothing length on RSI (3–7; default 3; 5 sweet spot).
Calculate Divergence: Toggle to compute pivots/divergences and enable alerts.
Moving Average Type: None, SMA, EMA, WMA, VWMA (default EMA).
MA Length: Length of the RSI-based MA (separate from RSI length).
 Best For 
Traders who want a cleaner RSI read without losing responsiveness.
Scalpers timing momentum shifts around the 50 line and MA crosses.
Swing traders using divergences as early reversal context.
 Pro Tips 
For fast intraday charts, start with Length 14, Smoothing 3–5, and EMA as the RSI-MA.
Use 50 reclaims/rejections as a simple regime filter.
Combine divergence labels with volume surges, key S/R, or volatility tools (e.g., BBW/TTM squeeze) to time entries.
Divergence alerts fire only if Calculate Divergence is enabled—keep it on if you rely on signals.
TRAPPER TRENDLINES — PRICEDraws dynamic trendlines on price by connecting the two most recent confirmed swing points (highs to highs for resistance, lows to lows for support). Swings are defined with a symmetric left/right pivot window. Old anchors are ignored so lines stay attached to current structure. Optional break alerts are included.
How it works (plain language)
Pivots: A bar is a swing high (or low) only if it’s the most extreme point compared with a set number of bars on the left and the right.
Lines:
Support connects the last two confirmed swing lows.
Resistance connects the last two confirmed swing highs.
Lines can be extended right only or both left & right (toggle).
Recency filter: Only swings within the last N bars are kept. This avoids anchoring to very old pivots far from current price.
Alerts: Optional alerts fire when price closes above resistance or below support.
Inputs
Auto Settings
Auto pivot size by chart timeframe: When ON, the script picks a pivot size suitable for the current timeframe (you can scale it with Auto pivot multiplier). When OFF, the manual left/right inputs are used.
Auto pivot multiplier: Scales the auto pivot size (e.g., 1.5 makes pivots stricter).
Manual Pivots
Pivot Left / Pivot Right: Bars to the left/right required to confirm a swing. Example: Left=50 & Right=50 keeps only major swings.
Recency Filter
Use last N bars for pivots: Swings older than this window are discarded so trendlines stay relevant to current price.
Style
Support/Resistance color: Line colors.
Extend Left & Right: When ON, both endpoints extend; when OFF, lines extend to the right only.
Alerts
Enable Break Alerts: When ON, alert conditions are exposed:
Price: Break Up — close above resistance.
Price: Break Down — close below support.
Suggested settings
Higher timeframes (4H / 1D / 1W):
Manual: Pivot Left = 50, Pivot Right = 50, Use last N bars = 400–800.
Or enable Auto with Auto pivot multiplier = 1.0–1.5.
Intraday (15m / 30m / 1H):
Manual: Pivot Left = 30, Pivot Right = 30, Use last N bars = 300–500.
Or enable Auto with multiplier ≈ 1.0–1.2.
Pairing with RSI for confluence/divergence
This tool is designed to pair with a companion TRAPPER TRENDLINES — RSI (or any RSI trendline script):
To mirror swings, set RSI Pivot Lookback equal to the price Pivot Left/Right you use here.
Example: Price = 50/50 → RSI Pivot Lookback = 50.
Keep RSI at Length 14 with 70/30 channel for clarity.
Confluence: Price holds/rejects at a trendline while RSI trendline agrees.
Divergence: Price prints a higher high (resistance line rising) while RSI prints a lower high (RSI resistance line falling), or vice-versa for lows. Matching pivot windows makes these relationships clear and reduces false signals.
Reading the signals
Trendline touch/hold: Potential reaction area; wait for follow-through.
Break Up / Break Down (alerts): Close beyond the line. Consider retest behavior, higher-timeframe context, and volume/RSI confirmation.
Notes & limitations
Pivots require future bars to confirm (by design). Lines update as pivots confirm.
“Use last N bars” purposely ignores very old swings. Increase this value if you need legacy structure.
Lines are based on two most recent confirmed pivots per side; rapidly changing markets can replace anchors as new swings confirm.
This is a visual/analytical tool. No strategy entries/exits or performance claims are provided.
Compliance
This script is for educational purposes only and does not constitute financial advice. Trading involves risk. Past results do not guarantee future outcomes. No promises of profit, accuracy, or performance are made.
Alerts (titles/messages)
Price: Break Up — “Price broke above resistance trendline.”
Price: Break Down — “Price broke below support trendline.”
Quick start
Add the indicator to your chart.
Choose Auto or set Pivot Left/Right manually.
Set Use last N bars for how far back to consider swings.
Toggle Extend Left & Right to your preference.
(Optional) Add your RSI trendline indicator and match Pivot Lookback with your price pivot size for clean confluence/divergence.
Enable alerts if you want notifications on breaks.
buy sell ultra systemWhat it is
EMA-POC Momentum System Ultra combines a proven trend stack (EMA 20/50/238), a price-of-control layer (POC via Bar-POC or VWAP alternative), and a momentum trigger (RSI) to surface higher-quality entries only when multiple, independent conditions align. This is not a cosmetic mashup; each component gates the others.
How components work together
Trend (EMA 20/50/238): Defines short/medium/long bias and filters counter-trend signals.
POC (Bar-POC or Alt-POC/VWAP): Locates the most-traded/weighted price area; a neutral band around POC helps avoid chop.
Control background: Above POC → buyers likely in control; below → sellers.
Momentum (RSI): Entry arrows print only when RSI confirms with trend and price location vs POC; optional “cross 50” requirement reduces noise.
Optional HTF trend: Confluence with a higher-timeframe EMA stack for stricter filtering.
Why it’s original/useful
Signals require confluence of (1) EMA trend stack, (2) POC location and neutral-zone filtering, (3) momentum confirmation, (4) optional slope and distance-to-POC checks, and (5) optional HTF trend. This reduces false positives compared with using any layer in isolation.
How to use
Markets/TFs: Built for XAUUSD (Gold) and US30. Works 1m–1h for intraday; 2h–4h for swing.
Entries:
Long: EMA stack bullish, price above POC, not in neutral band, RSI condition true → “Buy” arrow.
Short: Opposite conditions → “Sell” arrow.
Stops/Targets (suggested):
Initial stop beyond POC/neutral band or recent swing.
First target around 1R; trail with EMA20/50 or structure breaks.
Settings to tune:
POC Mode: Bar-POC (highest-volume bar’s close over lookback) or Alt-POC (VWAP).
Neutral Band %: 0.10–0.35 typical intraday.
Min distance from POC: 0.10–0.50% helps avoid low-RR entries right at POC.
RSI: Choose “cross 50” for stricter triggers or simple >/< 50 for more signals.
HTF trend: Turn on for extra confluence.
Alerts:
Buy Signal and Sell Signal (separate), or one Combined Buy/Sell alert.
Set to “Once per bar close” if you want only confirmed arrows.
Repainting / limitations
Shapes can move until bar close (standard Pine behavior) when using intrabar conditions; final confirmation at close. No system guarantees profitability—forward test and adapt to your market/instrument.
Clean chart
The published chart contains only this script so outputs are easy to identify.
Versions / updates
Use Publish → Update for minor changes; do not create new publications for small tweaks. If you fork to preserve older behavior, explain why and how your fork differs.
Changelog
v1.1 – Tuning for Gold/US30, neutral-band & distance filters, optional HTF trend, combined alert.
v1.0 – Initial public release (EMA stack + POC modes + RSI + alerts).
License & credits
Open-source for learning and improvement. Please credit on forks and explain modifications in your description.
Dow Theory Indicator## 🎯 Key Features of the Indicator
### 📈 Complete Implementation of Dow Theory
- Three-tier trend structure: primary trend (50 periods), secondary trend (20 periods), and minor trend (10 periods).
- Swing point analysis: automatically detects critical swing highs and lows.
- Trend confirmation mechanism: strict confirmation logic based on consecutive higher highs/higher lows or lower highs/lower lows.
- Volume confirmation: ensures price moves are supported by trading volume.
### 🕐 Flexible Timeframe Parameters
All key parameters are adjustable, making it especially suitable for U.S. equities:  
Trend analysis parameters:
- Primary trend period: 20–200 (default 50; recommended 50–100 for U.S. stocks).
- Secondary trend period: 10–100 (default 20; recommended 15–30 for U.S. stocks).
- Minor trend period: 5–50 (default 10; recommended 5–15 for U.S. stocks).  
Dow Theory parameters:
- Swing high/low lookback: 5–50 (default 10).
- Trend confirmation bar count: 1–10 (default 3).
- Volume confirmation period: 10–100 (default 20).
### 🇺🇸 U.S. Market Optimizations
- Session awareness: distinguishes Regular Trading Hours (9:30–16:00 EST) from pre-market and after-hours.
- Pre/post-market weighting: adjustable weighting factor for signals during extended hours.
- Earnings season filter: automatically adjusts sensitivity during earnings periods.
- U.S.-optimized default parameters.
## 🎨 Visualization
1. Trend lines: three differently colored trend lines.
2. Background fill: green (uptrend) / red (downtrend) / gray (neutral).
3. Signal markers: arrows, labels, and warning icons.
4. Swing point markers: small triangles at key turning points.
5. Info panel: real-time display of eight key metrics.
## 🚨 Alert System
- Trend turning to up/down.
- Strong bullish/bearish signals (dual confirmation).
- Volume divergence warning.
- New swing high/low formed.
## 📋 How to Use
1. Open the Pine Editor in TradingView.
2. Copy the contents of dow_theory_indicator.pine.
3. Paste and click “Add to chart.”
4. Adjust parameters based on trading style:
   - Long-term investing: increase all period parameters.
   - Swing trading: use the default parameters.
   - Short-term trading: decrease all period parameters.
## 💡 Parameter Tips for U.S. Stocks
- Large-cap blue chips (AAPL, MSFT): primary 60–80, secondary 25–30.
- Mid-cap growth stocks: primary 40–60, secondary 18–25.
- Small-cap high-volatility stocks: primary 30–50, secondary 15–20. 
Smart Breadth [smartcanvas]Overview 
This indicator is a market breadth analysis tool focused on the S&P 500 index. It visualizes the percentage of S&P 500 constituents trading above their 50-day and 200-day moving averages, integrates the McClellan Oscillator for advance-decline analysis, and detects various breadth-based signals such as thrusts, divergences, and trend changes. The indicator is displayed in a separate pane and provides visual cues, a summary label with tooltip, and alert conditions to highlight potential market conditions.
The tool uses data symbols like S5FI (percentage above 50-day MA), S5TH (percentage above 200-day MA), ADVN/DECN (S&P advances/declines), and optionally NYSE advances/declines for certain calculations. If primary data is unavailable, it falls back to calculated breadth from advance-decline ratios.
This indicator is intended for educational and analytical purposes to help users observe market internals. My intention was to pack in one indicator things you will only find in a few. It does not provide trading signals as financial advice, and users are encouraged to use it in conjunction with their own research and risk management strategies. No performance guarantees are implied, and historical patterns may not predict future market behavior.
Key Components and Visuals
 Plotted Lines: 
 
 Aqua line: Percentage of S&P 500 stocks above their 50-day MA.
 Purple line: Percentage of S&P 500 stocks above their 200-day MA.
 Optional orange line (enabled via "Show Momentum Line"): 10-day momentum of the 50-day MA breadth, shifted by +50 for scaling.
 Optional line plot (enabled via "Show McClellan Oscillator"): McClellan Oscillator, colored green when positive and red when negative. Can use actual scale or normalized to fit breadth percentages (0-100).
 
 Horizontal Levels: 
 
 Dotted green at 70%: "Strong" level.
 Dashed green at user-defined green threshold (default 60%): "Buy Zone".
 Dashed yellow at user-defined yellow threshold (default 50%): "Neutral".
 Dotted red at 30%: "Oversold" level.
 Optional dotted lines for McClellan (when shown and not using actual scale): Overbought (red), Oversold (green), and Zero (gray), scaled to fit.
 
 Background Coloring: 
 
 Green shades for bullish/strong bullish states.
 Yellow for neutral.
 Orange for caution.
 Red for bearish.
 
 Signal Shapes: 
 
 Rocket emoji (🚀) at bottom for Zweig Breadth Thrust trigger.
 Green circle at bottom for recovery signal.
 Red triangle down at top for negative divergence warning.
 Green triangle up at bottom for positive divergence.
 Light green triangle up at bottom for McClellan oversold bounce.
 Green diamond at bottom for capitulation signal.
 
 Summary Label (Right Side): 
Displays current action (e.g., "BUY", "HOLD") with emoji, breadth percentages with colored circles, McClellan value with emoji, market state, risk/reward stars, and active signals.
Hover tooltip provides detailed breakdown: action priority, breadth metrics, McClellan status, momentum/trend, market state, active signals, data quality, thresholds, recent changes, and a general recommendation category.
 Calculations and Logic 
 
 Breadth Percentages: Derived from S5FI/S5TH or calculated from advances/(advances + declines) * 100, with fallback adjustments.
 McClellan Oscillator: Difference between fast (default 19) and slow (default 39) EMAs of net advances (advances - declines).
 Momentum: 10-day change in 50-day MA breadth percentage.
 Trend Analysis: Counts consecutive rising days in breadth to detect upward trends.
 Breadth Thrust (Zweig): 10-day EMA of advances/total issues crossing from below a bottom level (default 40) to above a top level (default 61.5). Can use S&P or NYSE data.
 Divergences: Compares S&P 500 price highs/lows with breadth or McClellan over a lookback period (default 20) to detect positive (bullish) or negative (bearish) divergences.
 Market States: Determined by breadth levels relative to thresholds, trend direction, and McClellan conditions (e.g., strong bullish if above green threshold, rising, and McClellan supportive).
 Actions: Prioritized logic (0-10) selects an action like "BUY" or "AVOID LONGS" based on signals, states, and conditions. Higher priority (e.g., capitulation at 10) overrides lower ones.
 Alerts: Triggered on new occurrences of key conditions, such as breadth thrust, divergences, state changes, etc.
 
 Input Parameters 
The indicator offers customization through grouped inputs, but the use of defaults is encouraged.
 Usage Notes 
Add the indicator to a chart of any symbol (though designed around S&P 500 data; works best on daily or higher timeframes). Monitor the label and tooltip for a consolidated view of conditions. Set up alerts for specific events.
This script relies on external security requests, which may have data availability issues on certain exchanges or timeframes. The fallback mechanism ensures continuity but may differ slightly from primary sources.
 Disclaimer 
This indicator is provided for informational and educational purposes only. It does not constitute investment advice, financial recommendations, or an endorsement of any trading strategy. Market conditions can change rapidly, and users should not rely solely on this tool for decision-making. Always perform your own due diligence, consult with qualified professionals if needed, and be aware of the risks involved in trading. The author and TradingView are not responsible for any losses incurred from using this script.
Stochastic Ribbon & EMAsHere's a comprehensive description for publishing your indicator:
---
# **Stochastic Ribbon & EMAs**
A clean and powerful trading indicator that combines **Stochastic Support/Resistance levels** with **Essential Moving Averages** for comprehensive market analysis.
## **📊 What It Does**
This indicator provides **7 key reference lines** on your chart:
- **3 Stochastic levels** (20%, 50%, 80%) - Dynamic support/resistance zones
- **4 Essential EMAs** (20, 50, 100, 200) - Trend direction and momentum
## **🎯 Key Features**
### **Stochastic Ribbon (3 Yellow Lines)**
- **80% Line**: Dynamic resistance level - potential selling zone
- **50% Line**: Market equilibrium - trend direction reference  
- **20% Line**: Dynamic support level - potential buying zone
- **Default 50-period lookback** for stable, reliable levels
- **All lines in yellow** for clean, consistent visualization
### **Essential EMAs (4 Colored Lines)**
- **20 EMA** (Purple): Short-term trend and entry timing
- **50 EMA** (Dark Cyan): Medium-term trend direction
- **100 EMA** (Rosy Brown): Long-term trend confirmation
- **200 EMA** (Brown): Major trend and institutional levels
## **📈 How to Use**
### **For Support & Resistance:**
- **Above 80% line**: Look for selling opportunities (overbought zone)
- **Between 50-80%**: Bullish bias, pullbacks to 50% line for entries
- **Around 50% line**: Key equilibrium - watch for direction
- **Between 20-50%**: Bearish bias, bounces to 50% line for exits
- **Below 20% line**: Look for buying opportunities (oversold zone)
### **For Trend Analysis:**
- **EMA Stack Order**: Higher timeframe EMAs above lower = uptrend
- **Price above all EMAs**: Strong bullish momentum
- **Price below all EMAs**: Strong bearish momentum
- **EMA as dynamic support/resistance**: Bounces and rejections
### **For Entry Signals:**
- **Confluence zones**: Where Stochastic levels meet EMA levels
- **Breakouts**: Price breaking through multiple levels simultaneously
- **Reversals**: Price rejection at extreme Stochastic levels with EMA confirmation
## **⚙️ Settings**
### **Stochastic Ribbon**
- **Show/Hide**: Toggle the 3 Stochastic lines
- **Length**: Period for high/low calculation (default: 50)
- **Start**: Multiplier for calculation (default: 1)
### **EMAs**
- **Individual toggles**: Show/hide each EMA separately
- **Custom periods**: Adjust each EMA length (defaults: 20, 50, 100, 200)
- **Custom colors**: Personalize each EMA color
## **🚀 Why This Indicator?**
✅ **Clean & Simple**: No cluttered charts - just essential levels  
✅ **Multi-Timeframe**: Works on all timeframes from 1m to 1W  
✅ **Versatile**: Suitable for scalping, day trading, and swing trading  
✅ **Low Lag**: Dynamic levels that adapt to current market conditions  
✅ **Proven Components**: Combines two well-established technical concepts  
✅ **Customizable**: Adjust all parameters to fit your trading style  
## **💡 Pro Tips**
- **Use multiple timeframes**: Check higher timeframe alignment for stronger signals
- **Combine with volume**: Look for volume confirmation at key levels
- **Watch for confluences**: Best signals occur where multiple levels align
- **Respect the 50% line**: Often acts as the most important level for trend direction
## **📋 Technical Details**
- **Version**: Pine Script v5
- **Overlay**: Yes (displays on main price chart)
- **Plots**: 7 total (well within Pine Script limits)
- **Performance**: Optimized for fast loading and smooth operation
---
**Perfect for traders who want clear, actionable levels without chart clutter. Whether you're a beginner learning support/resistance or an experienced trader looking for clean reference points, this indicator delivers exactly what you need.**
Flexi MA Reversal🔹 FlexiMA Reversal – Customizable MA-Based Reversal Indicator
FlexiMA Reversal is a real-time, moving average-based reversal indicator designed to highlight potential market turning points using signal and alert lines. It provides visual cues for both early alerts and confirmed entry signals on candle close.
🔧 Key Features:
Customizable Moving Average Type: Choose from EMA, SMA, WMA, or VWMA (default is EMA).
Flexible MA Inputs: Configure up to three MAs (commonly used 5, 50, and 200).
Toggle Visibility: Enable or disable each MA line as needed.
Real-Time Alert System:
Thin alert lines appear when a potential reversal is detected.
Thicker signal lines confirm the reversal when price closes beyond the alert level.
Optional Visual Styling:
Choose custom colors for each MA, signal, and alert line.
Alert candles are automatically colored to match the corresponding alert line.
Option to show only signal lines for cleaner charts.
Customizable projection length for both alert and signal lines.
📈 Strategy Logic:
This indicator is designed to detect reversal opportunities based on the relationship between price and a selected short-term moving average.
Bullish Setup:
Price closes below the selected MA (e.g., EMA 5).
A bullish alert line is drawn at the high.
If a subsequent candle closes above the alert line and the MA, a bullish signal line is plotted.
Bearish Setup:
Price closes above the selected MA.
A bearish alert line is drawn at the low.
If a subsequent candle closes below the alert line and the MA, a bearish signal line is plotted.
This approach attempts to capture quick market shifts where short-term momentum reverses direction near key MA levels.
🎯 How to Use:
Although originally developed using the 5 EMA strategy, through testing it was found that using 6, 7, or 8 EMA offers even better signal quality.
To add broader trend context, 50 MA and 200 MA lines are included and can be toggled on/off based on your strategy preference.
🔍 Trend Filtering & Re-Entry Tips:
Due to the nature of shorter moving averages, reversal signals may appear frequently. For better trend alignment:
Use the 50 MA as a trend filter:
❌ Ignore bearish signals when price is above 50 MA
❌ Ignore bullish signals when price is below 50 MA
Alternatively, filtered-out signals can be used for re-entry within the trend:
For example, if you receive a bearish alert and signal above the 50 MA, and the next candle closes back above the bearish alert line, this may be interpreted as a bullish re-entry opportunity into the prevailing uptrend.
🛠️ Styling Tips:
You can disable alert candle coloring in the Style tab of the indicator settings.
Use the "Show Only Signal Lines" checkbox to keep the chart minimalistic while still tracking confirmed entries.
Active PMI Support/Resistance Levels [EdgeTerminal]The PMI Support & Resistance indicator revolutionizes traditional technical analysis by using Pointwise Mutual Information (PMI) - a statistical measure from information theory - to objectively identify support and resistance levels. Unlike conventional methods that rely on visual pattern recognition, this indicator provides mathematically rigorous, quantifiable evidence of price levels where significant market activity occurs.
- The Mathematical Foundation: Pointwise Mutual Information
Pointwise Mutual Information measures how much more likely two events are to occur together compared to if they were statistically independent. In our context:
 
 Event A: Volume spikes occurring (high trading activity)
 Event B: Price being at specific levels
 
The PMI formula calculates: PMI = log(P(A,B) / (P(A) × P(B)))
Where:
 
 P(A,B) = Probability of volume spikes occurring at specific price levels
 P(A) = Probability of volume spikes occurring anywhere
 P(B) = Probability of price being at specific levels
 
High PMI scores indicate that volume spikes and certain price levels co-occur much more frequently than random chance would predict, revealing genuine support and resistance zones.
- Why PMI Outperforms Traditional Methods
Subjective interpretation: What one trader sees as significant, another might ignore
Confirmation bias: Tendency to see patterns that confirm existing beliefs
Inconsistent criteria: No standardized definition of "significant" volume or price action
Static analysis: Doesn't adapt to changing market conditions
No strength measurement: Can't quantify how "strong" a level truly is
PMI Advantages:
✅ Objective & Quantifiable: Mathematical proof of significance, not visual guesswork
✅ Statistical Rigor: Levels backed by information theory and probability
✅ Strength Scoring: PMI scores rank levels by statistical significance
✅ Adaptive: Automatically adjusts to different market volatility regimes
✅ Eliminates Bias: Computer-calculated, removing human interpretation errors
✅ Market Structure Aware: Reveals the underlying order flow concentrations
- How It Works
Data Processing Pipeline:
 
 Volume Analysis: Identifies volume spikes using configurable thresholds
 Price Binning: Divides price range into discrete levels for analysis
 Co-occurrence Calculation: Measures how often volume spikes happen at each price level
 PMI Computation: Calculates statistical significance for each price level
 Level Filtering: Shows only levels exceeding minimum PMI thresholds
 Dynamic Updates: Refreshes levels periodically while maintaining historical traces
 
Visual System:
 
 Current Levels: Bright, thick lines with PMI scores - your actionable levels
 Historical Traces: Faded previous levels showing market structure evolution
 Strength Tiers: Line styles indicate PMI strength (solid/dashed/dotted)
 Color Coding: Green for support, red for resistance
 Info Table: Real-time display of strongest levels with scores
 
- Indicator Settings:
 Core Parameters 
 Lookback Period (Default: 200) 
Lower (50-100): More responsive to recent price action, catches short-term levels
Higher (300-500): Focuses on major historical levels, more stable but less responsive
Best for: Day trading (100-150), Swing trading (200-300), Position trading (400-500)
 Volume Spike Threshold (Default: 1.5) 
Lower (1.2-1.4): More sensitive, catches smaller volume increases, more levels detected
Higher (2.0-3.0): Only major volume surges count, fewer but stronger signals
Market dependent: High-volume stocks may need higher thresholds (2.0+), low-volume stocks lower (1.2-1.3)
 Price Bins (Default: 50) 
Lower (20-30): Broader price zones, less precise but captures wider areas
Higher (70-100): More granular levels, precise but may be overly specific
Volatility dependent: High volatility assets benefit from more bins (70+)
 Minimum PMI Score (Default: 0.5) 
Lower (0.2-0.4): Shows more levels including weaker ones, comprehensive view
Higher (1.0-2.0): Only statistically strong levels, cleaner chart
Progressive filtering: Start with 0.5, increase if too cluttered
 Max Levels to Show (Default: 8) 
Fewer (3-5): Clean chart focusing on strongest levels only
More (10-15): Comprehensive view but may clutter chart
Strategy dependent: Scalpers prefer fewer (3-5), swing traders more (8-12)
 Historical Tracking Settings 
Update Frequency (Default: 20 bars)
Lower (5-10): More frequent updates, captures rapid market changes
Higher (50-100): Less frequent updates, focuses on major structural shifts
Timeframe scaling: 1-minute charts need lower frequency (5-10), daily charts higher (50+)
 Show Historical Levels (Default: True) 
Enables the "breadcrumb trail" effect showing evolution of support/resistance
Disable for cleaner charts focusing only on current levels
 Max Historical Marks (Default: 50) 
Lower (20-30): Less memory usage, shorter history
Higher (100-200): Longer historical context but more resource intensive
 Fade Strength (Default: 0.8) 
Lower (0.5-0.6): Historical levels more visible
Higher (0.9-0.95): Historical levels very subtle
 Visual Settings 
Support/Resistance Colors: Choose colors that contrast well with your chart theme Line Width: Thicker lines (3-4) for better visibility on busy charts Show PMI Scores: Toggle labels showing statistical strength Label Size: Adjust based on screen resolution and chart zoom level
- Most Effective Usage Strategies
For Day Trading:
Setup: Lookback 100-150, Volume Threshold 1.8-2.2, Update Frequency 10-15
Use PMI levels as bounce/rejection points for scalp entries
Higher PMI scores (>1.5) offer better probability setups
Watch for volume spike confirmations at levels
For Swing Trading:
Setup: Lookback 200-300, Volume Threshold 1.5-2.0, Update Frequency 20-30
Enter on pullbacks to high PMI support levels
Target next resistance level with PMI score >1.0
Hold through minor levels, exit at major PMI levels
For Position Trading:
Setup: Lookback 400-500, Volume Threshold 2.0+, Update Frequency 50+
Focus on PMI scores >2.0 for major structural levels
Use for portfolio entry/exit decisions
Combine with fundamental analysis for timing
- Trading Applications:
 Entry Strategies: 
 PMI Bounce Trades 
Price approaches high PMI support level (>1.0)
Wait for volume spike confirmation (orange triangles)
Enter long on bullish price action at the level
Stop loss just below the PMI level
Target: Next PMI resistance level
 PMI Breakout Trades 
Price consolidates near high PMI level
Volume increases (watch for orange triangles)
Enter on decisive break with volume
Previous resistance becomes new support
Target: Next major PMI level
 PMI Rejection Trades 
Price approaches PMI resistance with momentum
Watch for rejection signals and volume spikes
Enter short on failure to break through
Stop above the PMI level
Target: Next PMI support level
 Risk Management: 
 Stop Loss Placement 
Place stops 0.1-0.5% beyond PMI levels (adjust for volatility)
Higher PMI scores warrant tighter stops
Use ATR-based stops for volatile assets
 Position Sizing 
Larger positions at PMI levels >2.0 (highest conviction)
Smaller positions at PMI levels 0.5-1.0 (lower conviction)
Scale out at multiple PMI targets
- Key Warning Signs & What to Watch For
 Red Flags: 
🚨 Very Low PMI Scores (<0.3): Weak statistical significance, avoid trading
 🚨 No Volume Confirmation: PMI level without recent volume spikes may be stale
 🚨 Overcrowded Levels: Too many levels close together suggests poor parameter tuning
 🚨 Outdated Levels: Historical traces are reference only, not tradeable
 Optimization Tips: 
✅ Regular Recalibration: Adjust parameters monthly based on market regime changes
 ✅ Volume Context: Always check for recent volume activity at PMI levels
 ✅ Multiple Timeframes: Confirm PMI levels across different timeframes
 ✅ Market Conditions: Higher thresholds during high volatility periods
Interpreting PMI Scores
PMI Score Ranges:
 
 0.5-1.0: Moderate statistical significance, proceed with caution
 1.0-1.5: Good significance, reliable for most trading strategies
 1.5-2.0: Strong significance, high-confidence trade setups
 2.0+: Very strong significance, institutional-grade levels
 
Historical Context: The historical trace system shows how support and resistance evolve over time. When current levels align with multiple historical traces, it indicates persistent market memory at those prices, significantly increasing the level's reliability.
Multi-Timeframe EMA Alignment + Listing InfoEnhanced EMA Alignment Checks
Original 4-EMA rows: Check 10EMA ≥ 20EMA ≥ 50EMA ≥ 200EMA for all timeframes
New 3-EMA rows: Check 10EMA ≥ 20EMA ≥ 50EMA (without 200EMA requirement) for weekly and monthly timeframes
Visual Distinction
White background: 4-EMA alignment rows (standard check)
Yellow background: 3-EMA alignment rows (less restrictive check)
Asterisk notation: "1W*" and "1M*" indicate the 3-EMA version
Complete Table Layout
1H: 4-EMA alignment (10≥20≥50≥200)
1D: 4-EMA alignment (10≥20≥50≥200)
1W: 4-EMA alignment (10≥20≥50≥200)
1M: 4-EMA alignment (10≥20≥50≥200)
1W* : 3-EMA alignment (10≥20≥50) - NEW
1M* : 3-EMA alignment (10≥20≥50) - NEW
Separator line
Since List: Weeks/months since listing
Benefits of This Setup:
Comprehensive Analysis: You can now see both strict (4-EMA) and relaxed (3-EMA) trend conditions
Better Entry Signals: The 3-EMA alignment might trigger earlier than 4-EMA, providing potential early entry signals
Trend Strength Assessment: When both 3-EMA and 4-EMA are aligned, it indicates very strong trend conditions
Flexible Strategy: You can use 3-EMA for trend following and 4-EMA for confirmation
The table now provides a complete multi-timeframe trend analysis with both conservative and aggressive alignment criteria, giving you more flexibility in your trading decisions.
Stochastic SuperTrend [BigBeluga]🔵 OVERVIEW 
 A hybrid momentum-trend tool that combines Stochastic RSI with SuperTrend logic to deliver clean directional signals based on momentum turns. 
 Stochastic SuperTrend   is a straightforward yet powerful oscillator overlay designed to highlight turning points in momentum with high clarity. It overlays a SuperTrend-style envelope onto the Stochastic RSI, generating intuitive up/down signals when a momentum shift occurs across the neutral 50 level. Built for traders who appreciate simplicity without sacrificing reliability.
 🔵 CONCEPTS 
 
   Stochastic RSI:  Measures momentum by applying stochastic calculations to the RSI curve instead of raw price.
   SuperTrend Bands:  Dynamic upper/lower bands are drawn around the smoothed Stoch RSI line using a user-defined multiplier.
   Momentum Direction:  Trend flips when the smoothed Stoch RSI crosses above/below the calculated bands.
   Neutral Bias Filter:  Directional arrows only appear when momentum turns above or below the central 50 level—adding confluence.
 
 🔵 FEATURES 
 
   Trend Detection on Oscillator:  Applies SuperTrend logic directly to the Stoch RSI curve.
  
   Clean Entry Signals: 
→ 🢁 arrow printed when trend flips bullish below 50 (bottom reversals).
→ 🢃 arrow printed when trend flips bearish above 50 (top reversals).
  
   Custom Multiplier:  Adjust sensitivity of SuperTrend band spacing around the oscillator.
  
   Neutral Zone Highlight:  Visual zone between 0–50 (green) and 50–100 (red) for quick momentum polarity reference.
   Toggle SuperTrend Line:  Option to show/hide the SuperTrend trail on the Stoch RSI.
 
 🔵 HOW TO USE 
 
  Use 🢁 signals for potential  bottom reversals  when momentum flips bullish from oversold regions.
  Use 🢃 signals for potential  top reversals  when momentum flips bearish from overbought areas.
  Combine with price-based SuperTrend or support/resistance zones for confluence.
  Suitable for scalping, swing trading, or momentum filtering across all timeframes.
 
 🔵 CONCLUSION 
 Stochastic SuperTrend   is a simple yet refined tool that captures clean momentum shifts with directional clarity. Whether you're identifying reversals, filtering entries, or spotting exhaustion in a trend, this oscillator overlay delivers just what you need— no clutter, just clean momentum structure.
Money Flow: In & Out Detector[THANHCONG]Indicator Name:
Money Flow: In & Out Detector
Indicator Description:
The Money Flow: In & Out Detector indicator uses technical indicators such as RSI (Relative Strength Index), MFI (Money Flow Index), and volume analysis to determine money inflow and outflow in the market.
This indicator helps traders identify changes in money flow, allowing them to detect buy and sell signals based on the combination of the following factors:
RSI > 50 and MFI > 50: Money inflow, indicating a buy signal.
RSI < 50 and MFI < 50: Money outflow, indicating a sell signal.
Volume increase/decrease relative to the average: Identifies strong market behavior changes.
Adjustable Parameters:
RSI Length: The number of periods to calculate the RSI (default is 14).
MFI Length: The number of periods to calculate the MFI (default is 14).
Volume MA Length: The number of periods to calculate the moving average of volume (default is 20).
Volume Increase/Decrease (%): The percentage threshold for volume change compared to the moving average (default is 20%).
Look Back Period: The number of periods used to identify peaks and troughs (default is 20).
How to Use the Indicator:
Money Inflow: When both RSI and MFI are above 50, and volume increases significantly relative to the moving average, the indicator shows a Buy signal.
Money Outflow: When both RSI and MFI are below 50, and volume decreases significantly relative to the moving average, the indicator shows a Sell signal.
Identifying Peaks and Troughs: The indicator also helps identify market peaks and troughs based on technical conditions.
Note:
This indicator assists in decision-making, but does not replace comprehensive market analysis.
Use this indicator in conjunction with other technical analysis methods to increase the accuracy of trade signals.
Steps for Publishing the Indicator on TradingView:
Log in to TradingView:
Go to TradingView and log into your account.
Access Pine Script Editor:
Click on Pine Editor from the menu under the chart.
Paste your Pine Script® code into the editor window.
Check the Source Code:
Ensure your code is error-free and running correctly.
Review the entire source code and add the MPL-2.0 license notice if necessary.
Save and Publish:
After testing and confirming the code works correctly, click Add to Chart to try the indicator on your chart.
If satisfied with the result, click Publish Script at the top right of the Pine Editor.
Provide a name for the indicator and then enter the detailed description you’ve prepared.
Ensure you specify the MPL-2.0 license in the description if required.
Choose the Access Type:
You can choose either Public or Private access for your indicator depending on your intention.
Submit for Publication:
Wait for TradingView to review and approve your indicator. Typically, this process takes a few working days for verification and approval.
User Guide:
You can share detailed instructions for users on how to use the indicator on TradingView, including how to adjust the parameters and interpret the signals. For example:
Set RSI Length: Experiment with different RSI Length values to find the sensitivity that suits your strategy.
Interpreting In/Out Signals: When there is strong money inflow (In), consider entering a buy order. When there is strong money outflow (Out), consider selling.
C&B Auto MK5C&B Auto MK5.2ema BullBear
Overview
The C&B Auto MK5.2ema BullBear is a versatile Pine Script indicator designed to help traders identify bullish and bearish market conditions across various timeframes. It combines Exponential Moving Averages (EMAs), Relative Strength Index (RSI), Average True Range (ATR), and customizable time filters to generate actionable signals. The indicator overlays on the price chart, displaying EMAs, a dynamic cloud, scaled RSI levels, bull/bear signals, and market condition labels, making it suitable for swing trading, day trading, or scalping in trending or volatile markets.
What It Does
This indicator generates bull and bear signals based on the interaction of two EMAs, filtered by RSI thresholds, ATR-based volatility, a 50/200 EMA trend filter, and user-defined time windows. It adapts to market volatility by adjusting EMA lengths and RSI thresholds. A dynamic cloud highlights trend direction or neutral zones, with candlestick coloring in neutral conditions. Market condition labels (current and historical) provide real-time trend and volatility context, displayed above the chart.
How It Works
The indicator uses the following components:
EMAs: Two EMAs (short and long) are calculated on a user-selected timeframe (1, 5, 15, 30, or 60 minutes). Their crossover or crossunder triggers potential bull/bear signals. EMA lengths adjust based on volatility (e.g., 10/20 for volatile markets, 5/10 for non-volatile).
Dynamic Cloud: The area between the EMAs forms a cloud, colored green for bullish trends, red for bearish trends, or a user-defined color (default yellow) for neutral zones (when EMAs are close, determined by an ATR-based threshold). Users can widen the cloud for visibility.
RSI Filter: RSI is scaled to price levels and plotted on the chart (optional). Signals are filtered to ensure RSI is within volatility-adjusted bull/bear thresholds and not in overbought/oversold zones.
ATR Volatility Filter: An optional filter ensures signals occur during sufficient volatility (ATR(14) > SMA(ATR, 20)).
50/200 EMA Trend Filter: An optional filter restricts bull signals to bullish trends (50 EMA > 200 EMA) and bear signals to bearish trends (50 EMA < 200 EMA).
Time Filter: Signals are restricted to a user-defined UTC time window (default 9:00–15:00), aligning with active trading sessions.
Market Condition Labels: Labels above the chart display the current trend (Bullish, Bearish, Neutral) and optionally volatility (e.g., “Bullish Volatile”). Up to two historical labels persist for a user-defined number of bars (default 5) to show recent trend changes.
Visual Aids: Bull signals appear as green triangles/labels below the bar, bear signals as red triangles/labels above. Candlesticks in neutral zones are colored (default yellow).
The indicator ensures compatibility with standard chart types (e.g., candlestick or bar charts) to produce realistic signals, avoiding non-standard types like Heikin Ashi or Renko.
How to Use It
Add to Chart: Apply the indicator to a candlestick or bar chart on TradingView.
Configure Settings:
Timeframe: Choose a timeframe (1, 5, 15, 30, or 60 minutes) to match your trading style.
Filters:
Enable/disable the ATR volatility filter to focus on high-volatility periods.
Enable/disable the 50/200 EMA trend filter to align signals with the broader trend.
Enable the time filter and set custom UTC hours/minutes (default 9:00–15:00).
Cloud Settings: Adjust the cloud width, neutral zone threshold, color, and transparency.
EMA Colors: Use default trend-based colors or set custom colors for short/long EMAs.
RSI Display: Toggle the scaled RSI and its thresholds, with customizable colors.
Signal Settings: Toggle bull/bear labels and set signal colors.
Market Condition Labels: Toggle current/historical labels, include/exclude volatility, and adjust decay period.
Interpret Signals:
Bull Signal: A green triangle or “Bull” label below the bar indicates potential bullish momentum (EMA crossover, RSI above bull threshold, within time window, passing filters).
Bear Signal: A red triangle or “Bear” label above the bar indicates potential bearish momentum (EMA crossunder, RSI below bear threshold, within time window, passing filters).
Neutral Zone: Yellow candlesticks and cloud (if enabled) suggest a lack of clear trend; consider range-bound strategies or avoid trading.
Market Condition Labels: Check labels above the chart for real-time trend (Bullish, Bearish, Neutral) and volatility status to confirm market context.
Monitor Context: Use the cloud, RSI, and labels to assess trend strength and volatility before acting on signals.
Unique Features
Volatility-Adaptive EMAs: Automatically adjusts EMA lengths based on ATR to suit volatile or non-volatile markets, reducing manual configuration.
Neutral Zone Detection: Uses an ATR-based threshold to identify low-trend periods, helping traders avoid choppy markets.
Scaled RSI Visualization: Plots RSI and thresholds directly on the price chart, simplifying momentum analysis relative to price.
Flexible Time Filtering: Supports precise UTC-based trading windows, ideal for day traders targeting specific sessions.
Historical Market Labels: Displays recent trend changes (up to two) with a decay period, providing context for market shifts.
50/200 EMA Trend Filter: Aligns signals with the broader market trend, enhancing signal reliability.
Notes
Use on standard candlestick or bar charts to ensure accurate signals.
Test the indicator on a demo account to optimize settings for your market and timeframe.
Combine with other analysis (e.g., support/resistance, volume) for better decision-making.
The indicator is not a standalone system; use it as part of a broader trading strategy.
Limitations
Signals may lag in fast-moving markets due to EMA-based calculations.
Neutral zone detection may vary in extremely volatile or illiquid markets.
Time filters are UTC-based; ensure your platform’s timezone settings align.
This indicator is designed for traders seeking a customizable, trend-following tool that adapts to volatility and provides clear visual cues with robust filtering for bullish and bearish market conditions.






















