Prev 1-Min Volume โข 5% Max Shares (TTP-ready)๐ก Overview
This tool was built to help Trade The Pool (TTP) traders comply with the new โ5% per minute volumeโ rule โ without needing to calculate anything manually.
It automatically tracks the previous 1-minute volume, calculates 5% of it, and compares that to your planned order size.
If your planned size is within the limit, it shows green โ
.
If youโre above, it flashes red ๐ซ.
And when liquidity spikes allow for more size, youโll see a green glow and ๐ alert โ so you can size up confidently without breaking the rule.
โ๏ธ Features
โ
Auto-calculates 5% volume cap from the previous 1-min candle
โ
Displays previous volume, max allowed shares, and your planned size
โ
TTP โdifferent volumeโ scaling option (e.g. 0.69 for 45M vs 65M real volume)
โ
Per-bar slice suggestion for 10s scalpers
โ
Corner selector (top-left, top-right, bottom-left, bottom-right)
โ
Visual glow and ๐ alert when liquidity window opens
โ
Compact and real-time responsive on 10s charts
Cari skrip untuk "scalp"
MTF Multi EMA - IntradayMTF Multi EMA โ Intraday
Purpose:
To quickly analyze trend direction and alignment across multiple timeframes (1m, 3m, 5m, 15m, 30m, and 60m) using fast and slow EMAs for each timeframe โ and combine them into a simple โstack scoreโ for easy visual decision-making. The script is tuned for Intraday Trading indicator by default.
Concept
Each timeframe (TF) โ like 1m, 3m, 5m, etc. โ has two EMAs:
A fast EMA (shorter length)
A slow EMA (longer length)
When the fast EMA > slow EMA, that timeframe is bullish.
When the fast EMA < slow EMA, that timeframe is bearish.
By combining multiple timeframes together, the indicator helps you:
Identify when all trends align bullishly (strong buy bias)
Identify when all trends align bearishly (strong sell bias)
Stay out during mixed or sideways phases
Inputs Explained
Setting Description
1m / 3m / 5m / 15m / 30m / 60m EMA Lengths Controls the EMA period for each timeframeโs fast and slow EMAs.
Fast EMA Color Color for all fast EMAs plotted on chart.
Slow EMA Color Color for all slow EMAs plotted on chart.
Use Smooth Interpolation Ensures smoother plots when merging higher TF data into a smaller chart (recommended ON).
Show Toggle visibility of each timeframeโs EMAs.
Table Position Lets you move the mini dashboard to any chart corner.
Stack Score
The Stack Score measures how many timeframes are bullish vs bearish:
Stack Score Meaning
+6 All timeframes bullish โ Strong Uptrend
+3 to +5 Majority bullish โ Bullish Bias
0 Neutral / Mixed โ Sideways Market
โ3 to โ5 Majority bearish โ Bearish Bias
โ6 All timeframes bearish โ Strong Downtrend
Table Display
At the chosen chart corner, youโll see:
TF Direction
1m ๐ข B (Bullish) / ๐ด S (Bearish)
3m ๐ข B (Bullish) / ๐ด S (Bearish)
5m ๐ข B (Bullish) / ๐ด S (Bearish)
15m ๐ข B (Bullish) / ๐ด S (Bearish)
30m ๐ข B (Bullish) / ๐ด S (Bearish)
60m ๐ข B (Bullish) / ๐ด S (Bearish)
Score Final alignment score (color-coded)
Color meanings:
๐ข Green cell = bullish for that TF
๐ด Red cell = bearish for that TF
The Score cell background color changes with strength:
Bright green โ strong bull
Yellow โ neutral
Red / Maroon โ strong bear
How to Use for Trading (Intraday NIFTY 5m)
Recommended Chart: 5-minute timeframe on NIFTY Futures or major index stocks.
๐น 1. Identify Trend Alignment
When Score โฅ +3 โ Market bias is bullish.
โ Look for long entries (buy breakouts or EMA retests).
When Score โค โ3 โ Market bias is bearish.
โ Look for short entries (sell breakdowns or retests).
When Score is between โ2 and +2 โ Trend is mixed.
โ Best to wait โ avoid trading in choppy conditions.
๐น 2. Combine with Price Action
Use it with:
Trendline breaks or retests
Candle confirmation (e.g. bullish engulfing or rejection)
Volume surge
Example:
On NIFTY 5m โ if score = +5, price breaks above a descending trendline, and 1mโ15m EMAs are all rising โ strong long signal.
๐น 3. Avoid Conflicts
If lower timeframes (1m/3m/5m) are bullish but higher ones (30m/60m) are bearish,
โ Trend is short-term bullish but larger bias is down โ scalps only, not swings.
Optional Alerts
If you add alert conditions (as suggested earlier):
โStrong Bullish Alignmentโ triggers when score โฅ +5
โStrong Bearish Alignmentโ triggers when score โค โ5
This gives you early alerts when full trend alignment occurs โ ideal for breakout setups.
Some more Tips
Use 5m or 15m chart as your main view.
Use Stack Score as a trend filter โ trade with it, not against it.
Combine with Breakout + Retest strategy or Trendline color-coded system youโre building.
In sideways days (score near 0), reduce risk or skip trades.
8x Heikin Ashi Streak (1m) by Bitcoin Benito๐งญ Indicator Description: โ8x Heikin Ashi Streak (1m) by Bitcoin Benitoโ
**Purpose:**
The *8x Heikin Ashi Streak* indicator helps traders quickly identify strong short-term momentum on the **1-minute timeframe**. It automatically tracks Heikin Ashi candles and alerts you whenever **8 consecutive bullish or bearish candles** appear โ a visual cue that a strong intraday trend or exhaustion point might be forming.
---
๐ **How It Works**
* The indicator continuously counts Heikin Ashi candles in real-time.
* When it detects **8 bullish (green)** or **8 bearish (red)** candles in a row:
* A green โฒ marker appears **below** the 8th candle for bullish streaks.
* A red โผ marker appears **above** the 8th candle for bearish streaks.
* You can set alerts to automatically notify you when these streaks occur.
This makes it ideal for **momentum traders**, **scalpers**, and **trend-reversal spotters** who want to:
* Catch strong intraday moves early.
* Identify potential overextension zones before pullbacks.
* Automate alert signals for short-term trading setups.
IMPORTANT: Only trade when most of the 8 candles are below/above the EMA 8 Line respectively. Add an EMA 8 indicator to see if this is the case
---
โ๏ธ **How to Use**
1. **Apply to a 1-minute chart** (this script is optimized for 1m timeframes).
2. When the indicator plots a green or red triangle:
* **Green triangle (8 bullish candles):** Trend momentum is strong upward.
* **Red triangle (8 bearish candles):** Downward momentum is dominant.
3. Optionally, combine with volume or EMA filters to confirm breakouts or exhaustion.
---
๐ **Setting Up Alerts**
* Click the **Alert (๐)** icon on TradingView.
* Under *Condition*, select:
* โ8x Heikin Ashi Streak (1m)โ โ โ8 Bullish Heikin Ashi (1m)โ
* OR โ8x Heikin Ashi Streak (1m)โ โ โ8 Bearish Heikin Ashi (1m)โ
* Choose **Once per bar close** to trigger the alert when the 8th candle completes.
* Add your custom message, e.g.
> โ๐ 8 bullish Heikin Ashi candles in a row on 1-minute chart!โ
> โ๐ป 8 bearish Heikin Ashi candles in a row on 1-minute chart!โ
---
๐ **Best Practices**
* Works best on **liquid assets** (major forex pairs, indices, BTC/USD, etc.).
* Pair with **RSI**, **EMA**, or **Volume** indicators for stronger confirmation.
* Not a standalone buy/sell signal โ treat it as a **momentum or exhaustion alert**.
* Can be adapted to other timeframes by changing chart resolution.
---
โ ๏ธ **Disclaimer**
This indicator is for **educational and analytical purposes only**.
Trading carries risk โ always test on demo accounts and use proper risk management.
No indicator guarantees profit; this is a tool for insight and timing, not financial advice.
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
TFRSI & RSI Analog Dial [CHE] TFRSI & RSI Analog Dial โ Interactive analog visualization for TFRSI or RSI with gradient zones, radial markers, and a trailing hand pointer.
Summary
This indicator renders an interactive analog dial for either TFRSI or standard RSI, providing a visual gauge with gradient-filled zones for oversold, neutral, and overbought regions. The hand pointer tracks the current value, with optional trailing dots at recent positions to show momentum direction. Radial lines mark key thresholds, and a digital readout displays the exact value. This design enhances readability over linear plots by leveraging familiar clock-like intuition, reducing cognitive load during quick scans. Signals are robust due to clamping to safe bounds and mode-specific scaling, ensuring consistent display across different volatility regimes.
Motivation: Why this design?
Traditional linear RSI or momentum indicators often feel abstract, especially in fast-paced screening where users scan multiple assets. Sharp swings can make thresholds hard to gauge at a glance, leading to missed nuances in overbought or oversold conditions. This dial addresses that by mapping values to a curved scale with color gradients, making extremes visually pop while the hand's trail hints at recent path without cluttering the chart. The dual-mode support allows seamless switching between advanced momentum (TFRSI) and classic RSI, fitting diverse strategies without reloading scripts.
Whatโs different vs. standard approaches?
- Baseline reference: Diverges from linear plotlines like the built-in RSI oscillator, which stacks values vertically and relies on horizontal lines for thresholds.
- Architecture differences:
- Curved projection with perspective tilt for depth illusion, using polyline arcs instead of straight plots.
- Mode-aware clamping and scaling to handle TFRSI's extended range versus RSI's standard bounds.
- Persistent trail array for hand history, capped at three points to avoid performance drag.
- Gradient segmentation for smooth zone transitions, rendered via multiple thin polylines.
- Practical effect: Charts show a compact, rotatable dial that fits in pane corners, with colors intuitively signaling bias (lime for buy zones, red for sell). The trail adds qualitative flow without numerical overload, helping spot divergences faster than static bars.
How it works (technical)
The indicator first computes the selected metric: for TFRSI, it processes price accelerations through a multi-step filter involving differencing, exponential damping, and normalization to a centered scale; for RSI, it uses the standard gain-loss ratio over the specified period. The value is then clamped between mode-specific minimum and maximum bounds to prevent display overflow.
This clamped value drives the hand angle on a 300-degree arc, projected from a 3D-like model rotated for perspective. Arcs for zones are built as segmented polylines, with colors interpolated linearly across the gradient. Key levels are drawn as radial lines from inner to outer radius, colored by zone. The trail maintains up to three prior angles in an array, updated only on confirmed bars to avoid repainting, and rendered as sized dots fading from small to large.
Initialization seeds filter states to zero on first bar, with persistent variables holding smoothing history. Data flows from price to metric computation, clamping, angle mapping, and projectionโall executed globally on the last bar for redraw efficiency.
Parameter Guide
Mode โ Switches between TFRSI (extended momentum gauge) and RSI (classic oscillator); affects bounds, zones, and labels. Default: "TFRSI". Trade-offs: TFRSI adds sensitivity to accelerations but may amplify noise; RSI is more stable for trend confirmation.
Dial Size โ Sets radius in pixels, scaling all elements proportionally. Default: 200. Bounds: 50โ500. Tips: Larger for detailed views, smaller for multi-pane layouts; auto-scales hand length to match.
Dial Vertical Offset โ Shifts entire dial up/down in pixels. Default: 0. Bounds: -200โ200. Trade-offs: Negative pulls toward price action; positive spaces belowโuse to avoid overlap.
Camera Angle โ Tilts view from top-down (0) to side (90) for 3D effect. Default: 45. Bounds: 0โ90. Tips: Steeper angles emphasize depth but compress horizontally; flat for precision.
Resolution โ Polygon sides for smooth arcs. Default: 64. Bounds: 4โ64. Trade-offs: Higher reduces jaggedness but increases draw callsโbalance with pane zoom.
TFRSI Hand Length โ Base pointer length at 200px dial, auto-scaled. Default: 170. Bounds: 10โ200. Tips: Longer for emphasis in large dials; shorter avoids edge clipping.
Show TFRSI Hand โ Toggles pointer visibility. Default: true. Trade-offs: Off for clean zones only; on for value tracking.
Show Hand Trail Dots โ Displays 3 fading dots at recent tips. Default: true. Trade-offs: Adds motion context but may clutter static viewsโdisable in alerts.
TFRSI Hand Color โ Pointer hue, used for trail dots too. Default: 7E57C2. Tips: Match strategy theme; gradients auto-blend to zones.
Dial Base Color โ Arc outline/fill tint. Default: blue. Trade-offs: Opaque for contrast; transparent blends with background.
Neutral Color (50) โ Mid-zone shade. Default: gray. Tips: Neutral tones reduce bias in balanced markets.
Oversold Color โ Low-zone fill. Default: lime. Trade-offs: Bright for alerts; muted for subtlety.
Overbought Color โ High-zone fill. Default: red. Trade-offs: As aboveโpair with hand blending.
Label Size โ Text scaling for thresholds. Default: "normal". Options: tiny/small/normal/large/huge. Tips: Smaller for dense charts; larger for presentations.
Digital TFRSI Size โ Readout font. Default: "large". Options: as above. Trade-offs: Balances visibility without dominating dial.
Digital Vertical Offset โ Readout position shift. Default: -50. Bounds: -200โ200. Tips: Negative centers above dial; adjust for multi-indicators.
TFRSI Length โ Core lookback for accelerations. Default: 6. Min: 1. Trade-offs: Shorter heightens reactivity, risks whipsaws; longer smooths extremes.
TFRSI Trigger Length โ Final smoothing passes. Default: 2. Min: 1. Tips: Increase for fewer false crosses; decrease for quicker pivots.
RSI Length โ Period for gain-loss averaging. Default: 14. Min: 1. Trade-offs: Classic 14 balances; shorter for scalps, longer for swings.
Reading & Interpretation
The dial arcs sweep from overbought (right, red) through neutral (top, gray) to oversold (left, lime), with the hand pointing to the current valueโclockwise for rising, counterclockwise for falling. Trail dots grow larger toward the present, colored to match hand zones, indicating recent direction without numbers. Threshold lines thicken at center (50) for quick zeroing; labels confirm levels. Digital readout below shows precise value prefixed by mode. Hand color gradients from neutral to extremes signal building pressure verbally: deepening red warns of potential pullbacks, brightening lime suggests bounces.
Practical Workflows & Combinations
Trend following: Enter long when hand crosses above 50 from oversold trail; confirm with higher highs in price structure. Filter shorts below 50 in downtrends using volume spikes.
Exits/Stops: Trail stops to recent dot positions in overbought; tighten on red gradients exceeding thresholds. Conservative: Exit at neutral; aggressive: Hold to extremes if trail aligns with momentum.
Multi-asset/Multi-TF: Defaults suit forex/stocks on 1Hโ4H; for crypto, shorten lengths by 20% for volatility. Stack with HTF security calls (e.g., daily mode on 15m chart) for confluenceโwatch for alignment across dials.
Behavior, Constraints & Performance
Closed-bar updates ensure no repainting; live bars show provisional hand/trail, confirmed on close. No security or HTF calls, so zero lookahead bias. Resources: Caps at 500 lines/labels/polylines, rebuilds only on last bar; max_bars_back=2000 handles history without lag. Known limits: Trail may stutter in flat markets; gradients approximate smooth fills via segments, visible at low resolution.
Sensible Defaults & Quick Tuning
Start with TFRSI mode, length=6, trigger=2 for responsive momentum on daily charts. Too choppy? Bump trigger to 4 for stability. Lagging entries? Drop length to 4, watch for overreactions. For RSI trend filter, set length=21; combine with MA cross for entries when dial nears 30/70.
What this indicator isโand isnโt
This is a visualization layer for momentum gauges, aiding quick bias assessment and threshold spotting. Pair it with price action, volume, and risk rules for decisions. Itโs not a standalone signal generator or predictive toolโvalues reflect past data, prone to whipsaws in ranging conditions.
Disclaimer
The content provided, including all code and materials, is strictly for educational and informational purposes only. It is not intended as, and should not be interpreted as, financial advice, a recommendation to buy or sell any financial instrument, or an offer of any financial product or service. All strategies, tools, and examples discussed are provided for illustrative purposes to demonstrate coding techniques and the functionality of Pine Script within a trading context.
Any results from strategies or tools provided are hypothetical, and past performance is not indicative of future results. Trading and investing involve high risk, including the potential loss of principal, and may not be suitable for all individuals. Before making any trading decisions, please consult with a qualified financial professional to understand the risks involved.
By using this script, you acknowledge and agree that any trading decisions are made solely at your discretion and risk.
Do not use this indicator on Heikin-Ashi, Renko, Kagi, Point-and-Figure, or Range charts, as these chart types can produce unrealistic results for signal markers and alerts.
Best regards and happy trading
Chervolino
Market SessionsMarket Sessions (Asian, London, NY, Pacific)
Summary
This indicator plots the main global market sessions (Asian, European, American, Pacific) as boxes on your chart, complete with dynamic high/low tracking.
It's an essential tool for intraday traders to track session-based volatility patterns and visualize key support/resistance levels (like the Asian Range) that often define price action for the rest of the day.
Who itโs for
Intraday traders, scalpers, and day traders who need to visualize market hours and session-based ranges. If your strategy depends on the London open, the New York close, or the Asian range, this script will map it out for you.
What it shows
Customizable Session Boxes: Four fully configurable boxes for the Asian, European (London), American (New York), and Pacific (Sydney) sessions.
Session High & Low: The script tracks and boxes the highest high and lowest low of each session, dynamically updating as the session progresses.
Session Labels: Clear labels (e.g., "AS", "EU") mark each session, anchored to the start time.
Key Features
Powerful Timezone Control: This is the core feature.
Use Exchange Timezone (Default): Simply enter session times (e.g., 8:00 for London) relative to the exchange's timezone (e.g., "NASDAQ" or "BINANCE").
Use UTC Offset: Uncheck the box and enter a UTC offset (e.g., +3 or -5). Now, all session times you enter are relative to that specific UTC offset. This gives you full control regardless of the chart you're on.
Fully Customizable: Toggle any session on/off.
Style Control: Change the fill color, border color, transparency, border width, and line style (Solid, Dashed, Dotted) for each session individually.
Smart Labels: Labels stay anchored to the start of the session (no "sliding") and float just above the session high.
Why this helps
Track Volatility & Market Behavior: Visually identify the "personality" of each session. Some sessions might consistently produce powerful pumps or dumps, while others are prone to sideways "chop" or accumulation. This indicator helps you see these repeating patterns.
Find Key Support/Resistance Levels: The High and Low of a session (e.g., the Asian Range) often become critical support and resistance levels for the next session (e.g., London). This script makes it easy to spot these "session-to-session" S/R flips and reactions.
Aid Statistical Analysis: The script provides the core visual data for your statistical research. You can easily track how often the London session breaks the Asian high, or which session is most likely to reverse the trend, helping you build a robust trading plan.
Context is King: Instantly see which market is active, which are overlapping (like the high-volume London-NY overlap), and which have closed.
Quick setup
Go to Timezone Settings.
Decide how you want to enter times:
Easy (Default): Leave Use Exchange Timezone checked. Enter session times based on the chart's native exchange (e.g., for BTC/USDT on Binance, use UTC+0 times).
Manual (Pro): Uncheck Use Exchange Timezone. Enter your UTC Offset (e.g., +2 for Berlin). Now, enter all session times as they appear on the clock in Berlin.
Go to each session tab (Asian, European...) to enable/disable it and set the correct start/end hours and minutes.
Style the colors to match your chart theme.
Disclaimer
For educational/informational purposes only; not financial advice. Trading involves riskโmanage it responsibly.
Lot Size Calculator - Gold๐ฅ Lot Size Calculator for Gold (XAU/USD)
Description:
A professional and accurate lot size calculator specifically designed for Gold (XAU/USD) trading. This indicator helps traders calculate the optimal position size based on account balance, risk percentage, and stop loss distance, ensuring proper risk management for every trade.
Key Features:
Accurate Gold Calculations - Properly accounts for Gold pip values ($10 per pip for standard 100oz lots)
Multi-Currency Support - Works with USD, EUR, and GBP account currencies
Flexible Contract Sizes - Supports Standard (100 oz), Mini (10 oz), and Micro (1 oz) lots
Customizable Decimal Places - Display lot sizes with 2-8 decimal precision (no rounding)
Clean Visual Design - Modern, professional info panel with gold-themed styling
Adjustable Display - Position panel anywhere on chart with customizable colors and sizes
Real-Time Calculations - Instantly updates as you adjust your risk parameters
How It Works:
The calculator uses the standard forex position sizing formula optimized for Gold:
Lot Size = Risk Amount / (Stop Loss in Pips ร Pip Value Per Lot)
For Gold (XAU/USD):
Standard Lot (100 oz): 1 pip = $10
Mini Lot (10 oz): 1 pip = $1
Micro Lot (1 oz): 1 pip = $0.10
Settings:
Account Settings:
Account Balance: Your trading capital
Account Currency: USD, EUR, or GBP
Risk Percentage: How much to risk per trade (default: 2%)
Contract Size: 100 oz (Standard), 10 oz (Mini), or 1 oz (Micro)
Display Currency: Choose how to display risk amounts
Trade Settings:
Stop Loss: Your SL distance in pips
Display Settings:
Label Position: Top/Bottom, Left/Right, Middle Right
Label Size: Tiny to Huge
Decimal Places: 2-8 decimals
Custom Colors: Background, text, and accent colors
Perfect For:
Gold (XAU/USD) day traders and swing traders
Position sizing and risk management
Traders using fixed percentage risk models
Anyone trading Gold CFDs or spot markets
Scalpers to long-term Gold investors
What Makes This Different:
Unlike generic lot size calculators, this tool correctly calculates Gold's pip values based on contract size. Many calculators get this wrong, leading to incorrect position sizing. This indicator ensures you're always trading the right lot size for your risk tolerance.
Example Usage:
Account Balance: $10,000
Risk: 1% = $100
Stop Loss: 60 pips
Contract Size: 100 oz (Standard)
Result: 0.1667 lots (exact, no rounding)
Perfect for maintaining consistent risk management in your Gold trading strategy!
Auto Fibonacci LevelsAuto Fibonacci Momentum Zones with Visible Range Table
Overview and Originality
The Auto Fibonacci Momentum Zones indicator offers a streamlined, static overlay of Fibonacci retracement levels inspired by extreme RSI momentum thresholds, enhanced with a dynamic table displaying the high and low of the currently visible chart range. This isn't a repackaged RSI oscillator or basic Fib drawerโcommon in TradingView's libraryโbut a purposeful fusion of geometric harmony (Fibonacci ratios) with momentum psychology (RSI extremes at 35/85), projected as fixed horizontal reference lines on the price chart. The addition of the visible range table, powered by PineCoders' VisibleChart library, provides real-time context for the chart's current view, enabling traders to quickly assess range compression or expansion relative to these zones.
This script's originality stems from its "static momentum mapping": by hardcoding Fib levels on a dynamic chart, it creates universal psychological support/resistance lines that transcend specific assets or timeframes.
Unlike dynamic Fib tools that auto-adjust to price swings (risking noise in ranging markets) or standalone RSI plots (confined to panes), this delivers clean, bias-adjustable overlays for confluence analysis. The visible range table justifies the library integrationโit's not a gratuitous add-on but a complementary tool that quantifies the "screen real estate" of price action, helping users correlate Fib touches with actual volatility. Drawn from original code (no auto-generation or public templates), it builds TradingView's body of knowledge by simplifying multi-tool workflows into one indicator, ideal for discretionary traders who value visual efficiency over algorithmic complexity.
How It Works: Underlying Concepts
Fibonacci retracements, derived from the Fibonacci sequence and the golden ratio (โ0.618), identify potential reversal points based on the idea that markets retrace prior moves in predictable proportions: shallow (23.6%, 38.2%), mid (50%), and deep (61.8%, 78.6%).
Adjustable Outputs
1. The "Invert Fibs" toggle (default: true) for bearish/topping bias, can be flipped aligning with trend context.
2. Fibonacci Levels: Seven semi-transparent horizontal lines are drawn using `hline()`:
- 0.0 at high (gray).
- 0.236: high - (range ร 0.236) (light cyan, shallow pullback).
- 0.382: high - (range ร 0.382) (teal, common retracement).
- 0.5: midpoint average (green, equilibrium).
- 0.618: high - (range ร 0.618) (amber, golden pocket for reversals).
- 0.786: high - (range ร 0.786) (orange, deep support).
- 1.0 at low (gray).
Colors progress from cool (shallow) to warm (deep) for intuitive scanning.
3. Optional Fib Labels: Right-edge text labels (e.g., "0.618") appear only if enabled, positioned at the last bar + offset for non-cluttering visibility.
4. Visible Range Table: Leveraging the VisibleChart library's `visible.high()` and `visible.low()` functions, a compact 2x2 table (top-right corner) updates on the last bar to show the extrema of bars currently in view. This mashup enhances utility: Fib zones provide fixed anchors, while the table's dynamic values reveal if price is "pinned" to a zone (e.g., visible high hugging 0.382 signals resistance). The library is invoked sparingly for performance, adding value by bridging static geometry with viewport-aware dataโunavailable in built-ins without custom code.
How to Use It
1. Setup:
Add to any chart (e.g., 15M for scalps, Daily for swings). As an overlay, lines appear directly on price candlesโadjust chart scaling if needed.
2. Input Tweaks:
Invert Fibs: Enable for downtrends (85 top), disable for uptrends (35 bottom).
Show Fibs: Toggle labels for ratio callouts (off for clean charts).
Show Table: Display/hide the visible high/low summary (red for high, green for low, formatted to 2 decimals).
3. Trading Application:
Zone Confluence: Seek price reactions at each fibonacci levelโe.g., a doji at 0.618 + rising volume suggests entry; use 0.0/1.0 as invalidation.
Range Context: Check the table: If visible high/low spans <20% of the Fib arc (e.g., both near 0.5), anticipate breakout; wider spans signal consolidation.
Multi-Timeframe: Overlay on higher TF for bias, lower for precisionโe.g., Daily Fibs guide 1H entries.
Enhancements: Pair with volume or candlesticks; set alerts on line crosses via TradingView's built-in tools. Backtest on your symbols to validate (e.g., equities favor 0.382, forex the 0.786).
This indicator automates advanced Fibonacci synthesis dynamically, eliminating manual measurement and calculations.
published by ozzy_livin
Cumulative Delta Volume MTFCumulative Delta Volume MTF (CDV_MTF)
Within volume analytics, โdelta (buy โ sell)โ often acts as a leading indicator for price.
This indicator is a cumulative delta tailored for day trading.
It differs from conventional cumulative delta in two key ways:
Daily Reset
If heavy buying hits into the prior dayโs close, a standard cumulative delta โcarriesโ that momentum into the next dayโs open. You can then misread directionโselling may actually be dominant, but yesterdayโs residue still pushes the delta positive. With Daily Reset, accumulation uses only the current dayโs delta, giving you a more reliable, open-to-close read for intraday decision-making.
Timeframe Selection (MTF)
You might chart 30s/15s candles to capture micro structure, while wanting the cumulative delta on 5-minute to judge the broader flow. With Timeframe (MTF), you can view a lower-timeframe chart and a higher-timeframe delta in one pane.
Overview
MTF aggregation: choose the deltaโs computation timeframe via Timeframe (empty = chart) (empty = chart timeframe).
Daily Reset: toggle on/off to accumulate strictly within the current session/day.
Display: Candle or Line (Candle supports Heikin Ashi), with Bull/Bear background shading.
Overlays: up to two SMA and two EMA lines.
Panel: plotted in a sub-window (overlay=false).
Example Use Cases
At the open: turn Daily Reset = ON to see the pure, same-day buy/sell build-up.
Entry on lower TF, bias from higher TF: chart at 30s, set Timeframe = 5 to reduce noise and false signals.
Quick read of momentum: Candle + HA + background shading for intuitive direction; confirm with SMA/EMA slope or crosses.
Key Parameters
Timeframe (empty = chart): timeframe used to compute cumulative delta.
Enable Daily Reset: resets accumulation when the trading day changes.
Style: Candle / Line; Heikin Ashi toggle for Candle mode.
SMA/EMA 1 & 2: individual length and color settings.
Background: customize Bull and Bear background colors.
How to Read
Distance from zero: positive build = buy-side dominance; negative = sell-side dominance.
Slope ร MAs: use CDV slope and MA direction/crossovers for momentum and potential turns.
Reset vs. non-reset:
ON โ isolates intraday net flow.
OFF โ tracks multi-day accumulation/dispersion.
Notes & Caveats
The delta here is a heuristic derived from candle body/wick proportionsโit is not true bid/ask tape.
MTF updates are based on the selected timeframeโs bar closes; values can fluctuate intrabar.
Date logic follows the symbolโs exchange timezone.
Renders in a separate pane.
Suggested Defaults
Timeframe = 5 (or 15) / Daily Reset = ON
Style = Candle + Heikin Ashi = ON
EMA(50/200) to frame trend context
For the first decisions after the openโand for scalps/day trades throughout the sessionโMTF ร Daily Reset helps you lock onto the flow that actually matters, right now.
==========================
Cumulative Delta Volume MTF๏ผCDV_MTF๏ผ
ๅบๆฅ้ซใฎไธญใงใโใใซใฟ๏ผ่ฒทใโๅฃฒใ๏ผโใฏๆ ชไพกใฎๅ
่กๆๆจใซใชใใใใใ
ๆฌใคใณใธใฑใผใฟใผใฏใใคใใฌใผใใซ็นๅใใ็ดฏ็ฉใใซใฟใงใใ
้ๅธธใฎ็ดฏ็ฉใใซใฟใจ็ฐใชใใใคใณใใฏ2ใคใ
ใใคใชใผใชใปใใๆฉ่ฝ
ๅๆฅใฎๅคงๅผใใงๅคงใใช่ฒทใใๅ
ฅใใจใ้ๅธธใฎ็ดฏ็ฉใใซใฟใฏใใฎๅขใใ็ฟๆฅใฎๅฏใใซใโๆใก่ถใโใพใใๅฎ้ใฏๅฃฒใๅงใๅผทใใฎใซใๅๆฅใฎๆฎๆธฃใซๅผใฃๅผตใใใฆๆนๅใ่ชคใใใจใใใใใใคใชใผใชใปใใใไฝฟใใฐๅฝๆฅๅใ ใใง็ดฏ็ฉใใใใใๅฏใ็ดๅพใใใฎๅคๆญๅบๆบใจใใฆไฟก้ ผๅบฆใไธใใใพใใ
ใฟใคใ ใใฌใผใ ๆๅฎ๏ผMTF๏ผๆฉ่ฝ
ใใจใใฐใใฃใผใใฏ30็ง่ถณ/15็ง่ถณใง็ดฐ้จใฎๅใใ่ฟฝใใ็ดฏ็ฉใใซใฟใฏ5ๅ่ถณใงโๅคงใใชๆตใโใ็ขบ่ชใใใโโใใใชใใผใบใซๅฏพๅฟใ**ไธ็ป้ขใงโไธไฝ่ถณใฎๅคๅใ ร ไธไฝ่ถณใฎใใญใผโ**ใๅๆใซๆๆกใงใใพใใ
ๆฆ่ฆ
MTFๅฏพๅฟ๏ผTimeframe ใง้่จ่ถณใๆๅฎ๏ผ็ฉบๆฌ๏ผใใฃใผใ่ถณ๏ผ
ใใคใชใผใชใปใใ๏ผๅฝๆฅๅใฎใฟใง็ดฏ็ฉ๏ผใชใณ/ใชใๅๆฟ๏ผ
่กจ็คบ๏ผCandle/Line๏ผCandleใฏHAๅๆฟๅฏ๏ผใ่ๆฏใBull/Bearใง่ชๅๅกใๅใ
่ฃๅฉ็ท๏ผSMA/EMA๏ผๅ2ๆฌ๏ผใ้ใญๆใ
่กจ็คบๅ
๏ผใตใใฆใฃใณใใฆ๏ผoverlay=false๏ผ
ไฝฟใๆนใฎไพ
ๅฏใใฎใใญใผๅคๅฎ๏ผใใคใชใผใชใปใใ๏ผใชใณใงใๅฏใ็ดๅพใฎ็ด็ฒใช่ฒทใ/ๅฃฒใใฎ็ฉใฟไธใใใ็ขบ่ช
ไธไฝ่ถณใฎใจใณใใชใผ ร ไธไฝ่ถณใฎใใคใขใน๏ผใใฃใผใ๏ผ30็งใTimeframe=5ๅใง้จใใๆธใใ
ๅขใใฎ่ฆ่ช๏ผCandle๏ผHA๏ผ่ๆฏ่ฒใง็ดๆ็ใซไธใไธใใๆๆกใSMA/EMAใฎๅพใใง่ฃๅผท
ไธปใชใใฉใกใผใฟ
Timeframe (empty = chart)๏ผ็ดฏ็ฉใซไฝฟใๆ้่ถณ
ใใคใชใผใชใปใใใๆๅนใซใใ๏ผๆฅไปๅๆฟใง็ดฏ็ฉใใชใปใใ
Style๏ผCandle / LineใHeikin Ashiๅๆฟ
SMA/EMA 1ใป2๏ผๆ้ใป่ฒใๅๅฅ่จญๅฎ
่ๆฏ่ฒ๏ผBull่ๆฏ / Bear่ๆฏ ใไปปๆใฎใใผใณใซ
่ชญใฟๅใใฎใณใ
ใผใญใใใฎไน้ข๏ผ๏ผๅดใธ็ฉใฟไธใใใปใฉ่ฒทใๅชไฝใโๅดใฏๅฃฒใๅชไฝ
ๅพใรMA๏ผCDVใฎๅพใใจ็งปๅๅนณๅใฎๆนๅ/ใฏใญในใง่ปขๆใใขใกใณใฟใ ใๆจๆธฌ
ๆฅๅ
/ๆฅ่ทจใใฎๅๆฟ๏ผใใคใชใผใชใปใใ๏ผใชใณใงๆฅๅ
ใฎ็ดๆตๅ
ฅๅบใใชใใงๆ้ๅ
จไฝใฎๅใ
ไปๆงใปๆณจๆ
ๆฌใใซใฟใฏใญใผใฝใฏใฎใใใฃ/ใใฒๆฏ็ใใ่ฟไผผใใใใฅใผใชในใใฃใใฏใงใๅฎ้ใฎBid/Ask้่จใจใฏ็ฐใชใใพใใ
MTFใฏๆๅฎ่ถณใฎ็ขบๅฎใใผในใงๆดๆฐใใใพใใ
ๆฅไปๅคๅฎใฏใทใณใใซใฎๅๅผๆใฟใคใ ใพใผใณๆบๆ ใ
ๆจๅฅจๅๆใปใใ
Timeframe=5๏ผใพใใฏ15๏ผ๏ผใใคใชใผใชใปใใ=ๆๅน
Style=Candle๏ผHA=ๆๅน
EMA(50/200)ใงๆตใใฎๆฏ่ผ
ๅฏใใฎไธๆใใใใฆในใญใฃใซ/ใใคใฎๅคๆญๆๆใซใMTFรใใคใชใผใชใปใใใงใโๅนใใฆใใใใญใผโใๆ็ญ่ท้ขใงๆใใพใใ
pine script tradingbot - many ema oscillator## ๐งญ **Many EMA Oscillator (TradingView Pine Script Indicator)**
*A multi-layer EMA differential oscillator for trend strength and momentum analysis*
---
### ๐งฉ **Overview**
The **Many EMA Oscillator** is a **TradingView Pine Script indicator** designed to help traders visualize **trend direction**, **momentum strength**, and **multi-timeframe EMA alignment** in one clean oscillator panel.
Itโs a **custom EMA-based trend indicator** that shows how fast or slow different **Exponential Moving Averages (EMAs)** are expanding or contracting โ helping you identify **bullish and bearish momentum shifts** early.
This **Pine Script EMA indicator** is especially useful for traders looking to combine multiple **EMA signals** into one **momentum oscillator** for better clarity and precision.
---
### โ๏ธ **How It Works**
1. **Multiple EMA Layers:**
The indicator calculates seven **EMAs** (default: 20, 50, 100, 150, 200, 300) and applies a **smoothing filter** using another EMA (default smoothing = 20).
This removes short-term noise and gives a smoother, professional-grade momentum reading.
2. **EMA Gap Analysis:**
The oscillator measures the **difference between consecutive EMAs**, revealing how trend layers are separating or converging.
```
diff1 = EMA(20) - EMA(50)
diff2 = EMA(50) - EMA(100)
diff3 = EMA(100) - EMA(150)
diff4 = EMA(150) - EMA(200)
diff5 = EMA(200) - EMA(300)
```
These gaps (or โdifferentialsโ) show **trend acceleration or compression**, acting like a **multi-EMA MACD system**.
3. **Color-Coded Visualization:**
Each differential (`diff1`โ`diff5`) is plotted as a **histogram**:
- ๐ข **Green bars** โ EMAs expanding โ bullish momentum growing
- ๐ด **Red bars** โ EMAs contracting โ bearish momentum or correction
This gives a clean, compact view of **trend strength** without cluttering your chart.
4. **Automatic Momentum Signals:**
- **๐ก Up Triangle** โ All EMA gaps increasing โ strong bullish trend alignment
- **โช Down Triangle** โ All EMA gaps decreasing โ trend weakening or bearish transition
---
### ๐ **Inputs**
| Input | Default | Description |
|-------|----------|-------------|
| `smmoth_emas` | 20 | Smoothing factor for all EMAs |
| `Length2`โ`Length7` | 20โ300 | Adjustable EMA periods |
| `Length21`, `Length31`, `Length41`, `Length51` | Optional | For secondary EMA analysis |
---
### ๐ง **Interpretation Guide**
| Observation | Meaning |
|--------------|----------|
| Increasing green bars | Trend acceleration and bullish continuation |
| Decreasing red bars | Trend exhaustion or sideways consolidation |
| Yellow triangles | All EMA layers aligned bullishly |
| White triangles | All EMA layers aligned bearishly |
This **EMA oscillator for TradingView** simplifies **multi-EMA trading strategies** by showing alignment strength in one place.
It works great for **swing traders**, **scalpers**, and **trend-following systems**.
---
### ๐งช **Best Practices for Use**
- Works on **all TradingView timeframes** (1m, 5m, 1h, 1D, etc.)
- Suitable for **stocks, forex, crypto, and indices**
- Combine with **RSI**, **MACD**, or **price action** confirmation
- Excellent for detecting **EMA compression zones**, **trend continuation**, or **momentum shifts**
- Can be used as part of a **multi-EMA trading strategy** or **trend strength indicator setup**
---
### ๐ก **Why It Stands Out**
- 100% built in **Pine Script v6**
- Optimized for **smooth EMA transitions**
- Simple color-coded momentum visualization
- Professional-grade **multi-timeframe trend oscillator**
This is one of the most **lightweight and powerful EMA oscillators** available for TradingView users who prefer clarity over clutter.
---
### โ ๏ธ **Disclaimer**
This indicator is published for **educational and analytical purposes only**.
It does **not provide financial advice**, buy/sell signals, or investment recommendations.
Always backtest before live use and trade responsibly.
---
### ๐จโ๐ป **Author**
Developed by **@algo_coders**
Built in **Pine Script v6** on **TradingView**
Licensed under the (mozilla.org)
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.
Grok's xAI Signal (GXS) Indicator for BTC V6Grok's xAI Signal (GXS) Indicator: A Simple Guide
Imagine trying to decide if Bitcoin is a "buy," "sell," or "wait" without staring at 10 different charts. The GXS Indicator does that for youโit's like a smart dashboard for BTC traders, overlaying signals right on your price chart. It boils down complex market clues into one easy score (from -1 "super bearish" to +1 "super bullish") and flashes green/red arrows or shaded zones when action's needed. No fancy math overload; just clear visuals like tiny triangles for trades, colored clouds for trends, and a bottom "mood bar" (green=up vibe, red=down, gray=meh).
At its core, GXS mixes three big-picture checks:
Price Momentum (50% weight): Quick scans of RSI (overbought/oversold vibes), MACD (speed of ups/downs), EMAs (is price riding the trend wave?), and Bollinger Bands (is the market squeezing for a breakout?). This catches short-term "hot or not" energy.
Network Health (30% weight): A simple "NVT" hack using trading volume vs. price to spot if BTC feels undervalued (buy hint) or overhyped (sell warning). It's like checking if the crowd's too excited or chill.
Trend Strength (20% weight): ADX filter ensures signals only fire in "trending" markets (not choppy sideways noise), plus a MACD boost for extra momentum nudge.
Why this approach? BTC's wildโpure price charts give false alarms in flat times, while ignoring volume/network ignores the "why" behind moves. GXS blends old-school TA (reliable for patterns) with on-chain smarts (crypto-specific "under the hood" data) and a trend gate (skips 70% of bad trades). It's conservative: Signals need the score to cross ยฑ0.08 and a strong trend, reducing noise for swing/position traders. Result? Fewer emotional guesses, more "wait for confirmation" patienceโperfect for volatile assets like BTC where hype kills.
Quick Tips to Tweak for Better Results
Start with defaults, then experiment on historical charts (backtest via TradingView's strategy tester if pairing with one):
Fewer False Signals: Bump thresholds to ยฑ0.15 (buy/sell)โtrades only on stronger conviction, cutting whipsaws by 20-30% in choppy markets. Or raise ADX thresh to 28 for "only big trends."
Faster/Slower Response: Shorten EMAs (e.g., 5/21) or RSI (10) for quicker scalps; lengthen (12/50) for swing holds. Test on 4H/daily BTC.
Volume Sensitivity: If NVT flips too often, extend its length to 20โsmooths on-chain noise in bull runs.
Visual Polish: Crank cloud opacity to 80% for subtler fills; toggle off EMAs if they clutter. Enable table for score breakdowns during live trades.
Risk Tip: Always pair with stops (e.g., 2-3% below signals). On BTC, tweak in bull markets (looser thresh) vs. bears (tighter).
In short, GXS is your BTC "sixth sense"โbalanced, not black-box. Tweak small, track win rate, and let trends lead. Happy trading!
Svopex Session Highlighter# Session Highlighter
## Description
**Session Highlighter** is a powerful Pine Script indicator designed to visually identify and mark specific trading hours on your chart. This tool helps traders focus on their preferred trading sessions by highlighting the background during active hours and marking the session start with customizable visual markers.
## Key Features
- **๐ Session Background Highlighting**: Automatically shades the chart background during your defined trading hours (default: 7:00 - 23:00)
- **๐ฏ Smart Session Start Marker**: Places a marker on the last candle before session start, intelligently adapting to your timeframe:
- 1 Hour chart: Marker at 6:00
- 15 Minute chart: Marker at 6:45
- 5 Minute chart: Marker at 6:55
- 1 Minute chart: Marker at 6:59
- **๐ Timezone Support**: Choose from multiple timezones (Europe/Prague, Europe/London, America/New_York, UTC)
- **๐จ 5 Marker Styles**: Customize your session start indicator:
- Triangle
- Circle
- Diamond
- Label with time text
- Vertical line
- **โ๏ธ Fully Customizable**: Adjust start/end hours, timezone, and marker style through simple settings
## Settings
- **Start Hour**: Set your session start time (0-23)
- **End Hour**: Set your session end time (0-23)
- **Timezone**: Select your trading timezone
- **Marker Style**: Choose your preferred visual marker
## Use Cases
- Identify London/New York trading sessions
- Mark Asian session hours
- Highlight your personal trading windows
- Avoid trading during off-hours
- Perfect for day traders and scalpers
## Installation
1. Copy the Pine Script code
2. Open TradingView Pine Editor
3. Paste the code and click "Add to Chart"
4. Configure settings to match your trading schedule
Kalman VWAP Filter [BackQuant]Kalman VWAP Filter
A precision-engineered price estimator that fuses Kalman filtering with the Volume-Weighted Average Price (VWAP) to create a smooth, adaptive representation of fair value. This hybrid model intelligently balances responsiveness and stability, tracking trend shifts with minimal noise while maintaining a statistically grounded link to volume distribution.
If you would like to see my original Kalman Filter, please find it here:
Concept overview
The Kalman VWAP Filter is built on two core ideas from quantitative finance and control theory:
Kalman filtering โ a recursive Bayesian estimator used to infer the true underlying state of a noisy system (in this case, fair price).
VWAP anchoring โ a dynamic reference that weights price by traded volume, representing where the majority of transactions have occurred.
By merging these concepts, the filter produces a line that behaves like a "smart moving average": smooth when noise is high, fast when markets trend, and self-adjusting based on both market structure and user-defined noise parameters.
How it works
Measurement blend : Combines the chosen Price Source (e.g., close or hlc3) with either a Session VWAP or a Rolling VWAP baseline. The VWAP Weight input controls how much the filter trusts traded volume versus price movement.
Kalman recursion : Each bar updates an internal "state estimate" using the Kalman gain, which determines how much to trust new observations vs. the prior state.
Noise parameters :
Process Noise controls agility โ higher values make the filter more responsive but also more volatile.
Measurement Noise controls smoothness โ higher values make it steadier but slower to adapt.
Filter order (N) : Defines how many parallel state estimates are used. Larger orders yield smoother output by layering multiple one-dimensional Kalman passes.
Final output : A refined price trajectory that captures VWAP-adjusted fair value while dynamically adjusting to real-time volatility and order flow.
Why this matters
Most smoothing techniques (EMA, SMA, Hull) trade off lag for smoothness. Kalman filtering, however, adaptively rebalances that tradeoff each bar using probabilistic weighting, allowing it to follow market state changes more efficiently. Anchoring it to VWAP integrates microstructure context โ capturing where liquidity truly lies rather than only where price moves.
Use cases
Trend tracking : Color-coded candle painting highlights shifts in slope direction, revealing early trend transitions.
Fair value mapping : The line represents a continuously updated equilibrium price between raw price action and VWAP flow.
Adaptive moving average replacement : Outperforms static MAs in variable volatility regimes by self-adjusting smoothness.
Execution & reversion logic : When price diverges from the Kalman VWAP, it may indicate short-term imbalance or overextension relative to volume-adjusted fair value.
Cross-signal framework : Use with standard VWAP or other filters to identify convergence or divergence between liquidity-weighted and state-estimated prices.
Parameter guidance
Process Noise : 0.01โ0.05 for swing traders, 0.1โ0.2 for intraday scalping.
Measurement Noise : 2โ5 for normal use, 8+ for very smooth tracking.
VWAP Weight : 0.2โ0.4 balances both price and VWAP influence; 1.0 locks output directly to VWAP dynamics.
Filter Order (N) : 3โ5 for reactive short-term filters; 8โ10 for smoother institutional-style baselines.
Interpretation
When price > Kalman VWAP and slope is positive โ bullish pressure; buyers dominate above fair value.
When price < Kalman VWAP and slope is negative โ bearish pressure; sellers dominate below fair value.
Convergence of price and Kalman VWAP often signals equilibrium; strong divergence suggests imbalance.
Crosses between Kalman VWAP and the base VWAP can hint at shifts in short-term vs. long-term liquidity control.
Summary
The Kalman VWAP Filter blends statistical estimation with market microstructure awareness, offering a refined alternative to static smoothing indicators. It adapts in real time to volatility and order flow, helping traders visualize balance, transition, and momentum through a lens of probabilistic fair value rather than simple price averaging.
Ehlers Autocorrelation Periodogram (EACP)# EACP: Ehlers Autocorrelation Periodogram
## Overview and Purpose
Developed by John F. Ehlers (Technical Analysis of Stocks & Commodities, Sep 2016), the Ehlers Autocorrelation Periodogram (EACP) estimates the dominant market cycle by projecting normalized autocorrelation coefficients onto Fourier basis functions. The indicator blends a roofing filter (high-pass + Super Smoother) with a compact periodogram, yielding low-latency dominant cycle detection suitable for adaptive trading systems. Compared with Hilbert-based methods, the autocorrelation approach resists aliasing and maintains stability in noisy price data.
EACP answers a central question in cycle analysis: โWhat period currently dominates the market?โ It prioritizes spectral power concentration, enabling downstream tools (adaptive moving averages, oscillators) to adjust responsively without the lag present in sliding-window techniques.
## Core Concepts
* **Roofing Filter:** High-pass plus Super Smoother combination removes low-frequency drift while limiting aliasing.
* **Pearson Autocorrelation:** Computes normalized lag correlation to remove amplitude bias.
* **Fourier Projection:** Sums cosine and sine terms of autocorrelation to approximate spectral energy.
* **Gain Normalization:** Automatic gain control prevents stale peaks from dominating power estimates.
* **Warmup Compensation:** Exponential correction guarantees valid output from the very first bar.
## Implementation Notes
**This is not a strict implementation of the TASC September 2016 specification.** It is a more advanced evolution combining the core 2016 concept with techniques Ehlers introduced later. The fundamental Wiener-Khinchin theorem (power spectral density = Fourier transform of autocorrelation) is correctly implemented, but key implementation details differ:
### Differences from Original 2016 TASC Article
1. **Dominant Cycle Calculation:**
- **2016 TASC:** Uses peak-finding to identify the period with maximum power
- **This Implementation:** Uses Center of Gravity (COG) weighted average over bins where power โฅ 0.5
- **Rationale:** COG provides smoother transitions and reduces susceptibility to noise spikes
2. **Roofing Filter:**
- **2016 TASC:** Simple first-order high-pass filter
- **This Implementation:** Canonical 2-pole high-pass with โ2 factor followed by Super Smoother bandpass
- **Formula:** `hp := (1-ฮฑ/2)ยฒยท(p-2p +p ) + 2(1-ฮฑ)ยทhp - (1-ฮฑ)ยฒยทhp `
- **Rationale:** Evolved filtering provides better attenuation and phase characteristics
3. **Normalized Power Reporting:**
- **2016 TASC:** Reports peak power across all periods
- **This Implementation:** Reports power specifically at the dominant period
- **Rationale:** Provides more meaningful correlation between dominant cycle strength and normalized power
4. **Automatic Gain Control (AGC):**
- Uses decay factor `K = 10^(-0.15/diff)` where `diff = maxPeriod - minPeriod`
- Ensures K < 1 for proper exponential decay of historical peaks
- Prevents stale peaks from dominating current power estimates
### Performance Characteristics
- **Complexity:** O(Nยฒ) where N = (maxPeriod - minPeriod)
- **Implementation:** Uses `var` arrays with native PineScript historical operator ` `
- **Warmup:** Exponential compensation (ยง2 pattern) ensures valid output from bar 1
### Related Implementations
This refined approach aligns with:
- TradingView TASC 2025.02 implementation by blackcat1402
- Modern Ehlers cycle analysis techniques post-2016
- Evolved filtering methods from *Cycle Analytics for Traders*
The code is mathematically sound and production-ready, representing a refined version of the autocorrelation periodogram concept rather than a literal translation of the 2016 article.
## Common Settings and Parameters
| Parameter | Default | Function | When to Adjust |
|-----------|---------|----------|---------------|
| Min Period | 8 | Lower bound of candidate cycles | Increase to ignore microstructure noise; decrease for scalping. |
| Max Period | 48 | Upper bound of candidate cycles | Increase for swing analysis; decrease for intraday focus. |
| Autocorrelation Length | 3 | Averaging window for Pearson correlation | Set to 0 to match lag, or enlarge for smoother spectra. |
| Enhance Resolution | true | Cubic emphasis to highlight peaks | Disable when a flatter spectrum is desired for diagnostics. |
**Pro Tip:** Keep `(maxPeriod - minPeriod)` โค 64 to control $O(n^2)$ inner loops and maintain responsiveness on lower timeframes.
## Calculation and Mathematical Foundation
**Explanation:**
1. Apply roofing filter to `source` using coefficients $\alpha_1$, $a_1$, $b_1$, $c_1$, $c_2$, $c_3$.
2. For each lag $L$ compute Pearson correlation $r_L$ over window $M$ (default $L$).
3. For each period $p$, project onto Fourier basis:
$C_p=\sum_{n=2}^{N} r_n \cos\left(\frac{2\pi n}{p}\right)$ and $S_p=\sum_{n=2}^{N} r_n \sin\left(\frac{2\pi n}{p}\right)$.
4. Power $P_p=C_p^2+S_p^2$, smoothed then normalized via adaptive peak tracking.
5. Dominant cycle $D=\frac{\sum p\,\tilde P_p}{\sum \tilde P_p}$ over bins where $\tilde P_pโฅ0.5$, warmup-compensated.
**Technical formula:**
```
Step 1: hp_t = ((1-ฮฑโ)/2)(src_t - src_{t-1}) + ฮฑโ hp_{t-1}
Step 2: filt_t = cโ(hp_t + hp_{t-1})/2 + cโ filt_{t-1} + cโ filt_{t-2}
Step 3: r_L = (M ฮฃxy - ฮฃx ฮฃy) / โ
Step 4: P_p = (ฮฃ_{n=2}^{N} r_n cos(2ฯn/p))ยฒ + (ฮฃ_{n=2}^{N} r_n sin(2ฯn/p))ยฒ
Step 5: D = ฮฃ_{pโฮฉ} p ยท ฤคP_p / ฮฃ_{pโฮฉ} ฤคP_p with warmup compensation
```
> ๐ **Technical Note:** Warmup uses $c = 1 / (1 - (1 - \alpha)^{k})$ to scale early-cycle estimates, preventing low values during initial bars.
## Interpretation Details
- **Primary Dominant Cycle:**
- High $D$ (e.g., > 30) implies slow regime; adaptive MAs should lengthen.
- Low $D$ (e.g., < 15) signals rapid oscillations; shorten lookback windows.
- **Normalized Power:**
- Values > 0.8 indicate strong cycle confidence; consider cyclical strategies.
- Values < 0.3 warn of flat spectra; favor trend or volatility approaches.
- **Regime Shifts:**
- Rapid drop in $D$ alongside rising power often precedes volatility expansion.
- Divergence between $D$ and price swings may highlight upcoming breakouts.
## Limitations and Considerations
- **Spectral Leakage:** Limited lag range can smear peaks during abrupt volatility shifts.
- **O(nยฒ) Segment:** Although constrained (โค 60 loops), wide period spans increase computation.
- **Stationarity Assumption:** Autocorrelation presumes quasi-stationary cycles; regime changes reduce accuracy.
- **Latency in Noise:** Even with roofing, extremely noisy assets may require higher `avgLength`.
- **Downtrend Bias:** Negative trends may clip high-pass output; ensure preprocessing retains signal.
## References
* Ehlers, J. F. (2016). โPast Market Cycles.โ *Technical Analysis of Stocks & Commodities*, 34(9), 52-55.
* Thinkorswim Learning Center. โEhlers Autocorrelation Periodogram.โ
* Fab MacCallini. โautocorrPeriodogram.R.โ GitHub repository.
* QuantStrat TradeR Blog. โAutocorrelation Periodogram for Adaptive Lookbacks.โ
* TradingView Script by blackcat1402. โEhlers Autocorrelation Periodogram (Updated).โ
Previous session High/Low โ Asia London USA Overview
This indicator automatically plots the Previous Dayโs (PD) session Highs and Lows for the Asia (Tokyo), London, and USA (New York) trading sessions.
Each session is color-coded for clarity:
๐ฉ Asia (Green)
๐ฅ London (Red)
๐ฆ USA (Blue)
At the close of each session, the indicator records that sessionโs high and low, draws horizontal lines across the chart, and labels them neatly in the center of each range โ above the high and below the low for perfect visual balance.
โ๏ธ How It Works
The script continuously tracks the current high and low within each session.
When a session closes, those values are locked in as the PD High and PD Low.
Clean lines and centered labels are drawn immediately.
The labels automatically offset slightly above or below the line to avoid overlap, with user-controlled spacing.
This helps traders quickly identify where price interacts with the previous sessionโs structure, a core concept for many session-based and liquidity-based strategies.
๐งญ Sessions and Timezones
Each market session runs in its native timezone, so you can align them perfectly to your chart or your preferred trading hours:
Asia Session: Default 08:30 โ 11:00 (Australia/Adelaide time)
London Session: Default 08:00 โ 10:00 (Europe/London)
USA Session: Default 09:30 โ 16:00 (America/New_York)
You can change each sessionโs hours and timezone from the Inputs panel.
๐จ Customization
In the Inputs menu you can:
Toggle each session on or off
Choose line color and thickness
Enable or disable labels
Adjust vertical offset (ticks) for label spacing
โHigh label offsetโ โ moves label further above the high line
โLow label offsetโ โ moves label further below the low line
These adjustments make it easy to keep charts clean and readable on any instrument or timeframe.
๐ Practical Use
This indicator is ideal for:
Session traders who mark PD Highs/Lows as liquidity zones
London or NY session scalpers who watch for breakouts, fakeouts, or reversals
ICT / Smart Money Concepts users wanting automatic session reference levels
Anyone wanting a quick visual map of inter-session structure
EMA 9 & 26 + Bollinger Bands โ Auto AlertsHereโs a professional **TradingView description** you can use when publishing your new version of the indicator with alerts ๐
---
## ๐ข EMA 9 & 26 + Bollinger Bands โ Auto Buy/Sell Alerts
This indicator combines **EMA crossover strategy** and **Bollinger Bands** to generate high-clarity **Buy/Sell signals** for any market (crypto, forex, stocks).
It also includes **automatic alerts** that notify you the moment a new signal appears โ perfect for traders using 3-minute or 5-minute charts such as ETHUSDT, BTCUSDT, or other pairs.
---
### โ๏ธ **Core Features**
* **EMA 9 & EMA 26 Crossover Logic**
* ๐ **BUY** when EMA 9 crosses above EMA 26 โ start of bullish momentum
* โค๏ธ **SELL** when EMA 9 crosses below EMA 26 โ start of bearish momentum
* **Bollinger Bands Overlay**
* Visualize volatility and spot potential breakout or retracement zones
* **Real-Time Alerts**
* Instant notification as soon as a BUY or SELL signal appears
* Works seamlessly on any timeframe (3m / 5m / 15m / 1h / 4h / 1D)
* **Color-Coded Labels**
* BUY = Aqua-Green (#00FFCC)
* SELL = Pink-Red (#FF007F)
---
### ๐ **How to Set Up Alerts**
1. Add the indicator to your chart.
2. Choose your symbol (e.g., **ETHUSDT**) and timeframe (**3 min or 5 min**).
3. Click the **Alarm Clock โฐ โ Create Alert**.
4. Under **Condition**, select this indicator โ choose **BUY Signal** or **SELL Signal**.
5. Choose โOnce per barโ or โOnce per bar closeโ.
6. Enable **App**, **Email**, or **Webhook** notifications.
---
### ๐ก **Best Use**
* Ideal for **scalpers** and **short-term trend traders**
* Works on any liquid asset (crypto, forex, stocks, indices)
* Combine with **RSI**, **volume**, or **support/resistance** for stronger confirmation
---
### โ ๏ธ **Disclaimer**
This indicator is a **technical tool**, not financial advice. Always confirm signals with your own analysis and risk management strategy.
---
Would you like me to make a **short SEO-optimized summary** (under 250 characters) for the *TradingView Public Library card* โ e.g. what shows under the title when people browse indicators?
CHOCH + FVG Signals [30m Optimized]CHOCH + FVG Signals
๐ฏ What It Does:
This script automatically scans your chart for high-probability Smart Money Concepts (SMC) setups based on two key institutional trading principles:
Change of Character (CHOCH) โ A shift in market structure signaling potential reversal
Fair Value Gap (FVG) โ An imbalance zone where price moved too fast, often acting as support/resistance
When both conditions align, the script plots clear Buy (โฒ) and Sell (โผ) signals directly on your chart โ ideal for intraday trading on the 30-minute timeframe (but works on any timeframe).
โ
Key Features:
๐น Visual Fair Value Gaps
Green shaded zones = Bullish FVGs (potential support)
Red shaded zones = Bearish FVGs (potential resistance)
Toggle on/off in settings
๐น Smart CHOCH Detection
Detects breaks of recent swing highs/lows with proper context
Avoids false signals by confirming prior price structure
๐น Clear Trade Signals
Green โฒ below bar = Buy signal (Bullish CHOCH + FVG confluence)
Red โผ above bar = Sell signal (Bearish CHOCH + FVG confluence)
๐น Customizable Filters
Option to require FVG for a signal (recommended for higher accuracy)
Adjust sensitivity via swing detection settings (default optimized for 30m)
๐น Alert-Ready
Built-in alert conditions for instant notifications on TradingView mobile/desktop
โ๏ธ How to Use:
Apply to a 30-minute chart (e.g., EURUSD, Gold, NAS100, BTC)
Wait for at least 50โ100 bars to load (so swing points appear)
Look for:
A green triangle (โฒ) โ consider long entry near FVG support
A red triangle (โผ) โ consider short entry near FVG resistance
Confirm with price action: Wait for a strong candle close or rejection at the FVG zone
Use stop-loss below/above the FVG and target recent liquidity pools
๐ก Pro Tip: Best used during high-volume sessions (e.g., London Open 7โ10 AM UTC, NY Open 12:30โ3:30 PM UTC).
๐ ๏ธ Settings (Inputs):
Show Fair Value Gaps
โ
Enabled
Visualize FVG zones
Max FVG History
100 bars
Prevent chart clutter
Require FVG for Signal?
โ
Enabled
Higher-quality setups (disable to test CHOCH-only)
โ ๏ธ Important Notes:
This is a signal generator, not financial advice. Always manage risk.
Works best in trending or breaking markets โ avoid during low-volatility ranges.
FVGs may get filled (tested) before price continues โ patience improves results.
Backtest on historical data before live trading.
๐ฃ Ideal For:
Retail traders learning Smart Money Concepts (SMC)
Price action traders seeking institutional-level confluence
Intraday scalpers & swing traders on 30mโ1H timeframes
WorldCup Dashboard + Institutional Sessionsยฉ 2025 NewMetaโข โ Educational use only.
# Full, Premium Description
## WorldCup Dashboard + Institutional Sessions
**A trade-ready, intraday framework that combines market structure, real flow, and institutional timing.**
This toolkit fuses **Institutional Sessions** with a **priceโvolume decision engine** so you can see *who is active*, *where value sits*, and *whether the drive is real*. You get: **CVD/Delta**, volume-weighted **Momentum**, **Aggression** spikes, **FVG (MTF)** with nearest side, **Daily Volume Profile (VAH/POC/VAL)**, **ATR regime**, a **24h position gauge**, classic **candle patterns**, IBH/IBL + **first-hour โtrue closeโ** lines, and a **10-vote confluence scoreboard**โall in one view.
---
## Whatโs inside (and how to trade it)
### ๐ Institutional Sessions (Sydney โข Tokyo โข London โข New York)
* Session boxes + a highlighted **first hour**.
* Plots the **true close** (first-hour close) as a running line with a label.
**Use:** Many desks anchor risk to this print. Above = bullish bias; below = bearish. **IBH/IBL** breaks during London/NY carry the most signal.
### ๐ CVD / Delta (Flow)
* Net buyer vs seller pressure with smooth trend state.
**Use:** **Rising CVD + acceptance above mid/POC** confirms continuation. Bearish price + rising CVD = caution (possible absorption).
### โก Volume-Weighted Momentum
* Momentum adjusted by participation quality (volume).
**Use:** Momentum>MA and >0 โ trend drive is โrealโ; <0 and falling โ distribution risk.
### ๐ฅ Aggression Detector
* ROC ร normalized volume ร wick factor to flag **forceful** candles.
**Use:** On spikes, avoid fading blindlyโwait for pullbacks into **aligned FVG** or for aggression to cool.
### ๐ฆ๐ช Fair Value Gaps (with MTF)
* Detects up to 3 recent FVGs and marks the **nearest** side to price.
**Use:** Trend pullbacks into **bullish FVG** for longs; bounces into **bearish FVG** for shorts. Optional threshold to filter weak gaps.
### ๐งญ 24h Gauge (positioning)
* Shows current price across the 24h lowโขhigh with a mid reference.
**Use:** Above mid and pushing upper third = momentum continuation setups; below mid = sell the rips bias.
### ๐งฑ Daily Volume Profile (manual per day)
* **VAH / POC / VAL** derived from discretized rows.
**Use:** **POC below** supports longs; **POC above** caps rallies. Fade VAH/VAL in ranges; treat them as break/hold levels in trends.
### ๐ ATR Regime
* **ATR vs ATR-avg** with direction and regime flag (**HIGH / NORMAL / LOW**).
**Use:** HIGH โ give trades room & favor trend following. LOW โ fade edges, scale targets.
### ๐ฏ๏ธ Candle Patterns (contextual, not standalone)
* Engulfings, Morning/Evening Star, 3 Soldiers/Crows, Harami, Hammer/Shooting Star, Double Top/Bottom.
**Use:** Only with session + flow + momentum alignment.
### ๐ค PriceโVolume Classification
* Labels each bar as **continuation**, **exhaustion**, **distribution**, or **healthy pullback**.
**Use:** Align continuation reads with trend; treat โPriceโ + Volโโ as a caution flag.
### ๐งช Confluence Scoreboard & B/S Meter
* Ten elements vote: ๐ต bull, โช neutral, ๐ฃ bear.
**Use:** Execution filterโtake setups when the boardโs skew matches your trade direction.
---
## Playbooks (actionable)
**Trend Pullback (Long)**
1. London/NY active, Momentumโ, CVDโ, price above 24h mid & POC.
2. Pullback into **nearest bullish FVG**.
3. Invalidate under FVG low or **true-close** line.
4. Targets: IBH โ VAH โ 24h high.
**Range Fade (Short)**
1. Asia/quiet regime, **Priceโ + Volโ** into **VAH**, ATR low.
2. Nearest FVG bearish or scoreboard skew bearish.
3. Invalidate above VAH/IBH.
4. Targets: POC โ VAL.
**News/Impulse**
Aggression spike? Donโt chase. Let it pull back into the aligned FVG; require CVD/Momentum agreement before entry.
---
## Alerts (included)
* **Bull/Bear Confluence โฅ 7/10**
* **Intraday Target Achieved** / **Daily Target Achieved**
* **Session True-Close Retests** (Sydney/Tokyo/London/NY)
*(Keep alerts โOnce per barโ unless you specifically want intrabar triggers.)*
---
## Setup Tips
* **UTC**: Choose the reference that matches how you track sessions (default UTC+2).
* **Volume threshold**: 2.0ร is a strong baseline; raise for noisy alts, lower for majors.
* **CVD smoothing**: 14โ24 for scalps; 24โ34 for slower markets.
* **ATR lengths**: Keep defaults unless your asset has a persistent regime shift.
---
## Why this framework?
Because **timing (sessions)**, **truth (flow)**, and **location (value/FVG)** together beat any single signal. You get *who is trading*, *how strong the push is*, and *where risk lives*โon one screenโso execution is faster and cleaner.
---
**Disclaimer**: Educational use only. Not financial advice. Markets are riskyโbacktest and size responsibly.
ATR Gauge - Audiophile StyleThe ATR Gauge - Audiophile Style indicator is a custom visualization tool. It's designed to give you a quick, retro-inspired snapshot of market volatility using the Average True Range (ATR) metric. Think of it as a dashboard widget styled like the VU meters on old-school audiophile equipment (e.g., vintage stereo amps from brands like McIntosh or Marantz)โsimple, elegant, and functional. It sits in one of the corners of your chart and helps you gauge how "hot" or "cool" the current price action is compared to recent levels.
Why This Gauge?: Standard ATR plots as a line on your chart, but this turns it into a visual "meter" focused on the last 24 hours. It's like a speedometer for volatilityโquick to read at a glance. Useful for day traders, scalpers, or anyone monitoring intraday risk without cluttering the main chart.
Pivot Regime Anchored VWAP [CHE] Pivot Regime Anchored VWAP โ Detects body-based pivot regimes to classify swing highs and lows, anchoring volume-weighted average price lines directly at higher highs and lower lows for adaptive reference levels.
Summary
This indicator identifies shifts between top and bottom regimes through breakouts in candle body highs and lows, labeling swing points as higher highs, lower highs, lower lows, or higher lows. It then draws anchored volume-weighted average price lines starting from the most recent higher high and lower low, providing dynamic support and resistance that evolve with volume flow. These anchored lines differ from standard volume-weighted averages by resetting only at confirmed swing extremes, reducing noise in ranging markets while highlighting momentum shifts in trends.
Motivation: Why this design?
Traders often struggle with static reference lines that fail to adapt to changing market structures, leading to false breaks in volatile conditions or missed continuations in trends. By anchoring volume-weighted average price calculations to body pivot regimesโspecifically at higher highs for resistance and lower lows for supportโthis design creates reference levels tied directly to price structure extremes. This approach addresses the problem of generic moving averages lagging behind swing confirmations, offering a more context-aware tool for intraday or swing trading.
Whatโs different vs. standard approaches?
- Baseline reference: Traditional volume-weighted average price indicators compute a running total from session start or fixed periods, often ignoring price structure.
- Architecture differences:
- Regime detection via body breakout logic switches between high and low focus dynamically.
- Anchoring limited to confirmed higher highs and lower lows, with historical recalculation for accurate line drawing.
- Polyline rendering rebuilds only on the last bar to manage performance.
- Practical effect: Charts show fewer, more meaningful lines that start at swing points, making it easier to spot confluences with structure breaks rather than cluttered overlays from continuous calculations.
How it works (technical)
The indicator first calculates the maximum and minimum of each candle's open and close to define body highs and lows. It then scans a lookback window for the highest body high and lowest body low. A top regime triggers when the body high from the lookback period exceeds the window's highest, and a bottom regime when the body low falls below the window's lowest. These regime shifts confirm pivots only when crossing from one state to the other.
For top pivots, it compares the new body high against the previous swing high: if greater, it marks a higher high and anchors a new line; otherwise, a lower high. The same logic applies inversely for bottom pivots. Anchored lines use cumulative price-volume products and volumes from the anchor bar onward, subtracting prior cumulatives to isolate the segment. On pivot confirmation, it loops backward from the current bar to the anchor, computing and storing points for the line. New points append as bars advance, ensuring the line reflects ongoing volume weighting.
Initialization uses persistent variables to track the last swing values and anchor bars, starting with neutral states. Data flows from regime detection to pivot classification, then to anchoring and point accumulation, with lines rendered globally on the final bar.
Parameter Guide
Pivot Length โ Controls the lookback window for detecting body breakouts, influencing pivot frequency and sensitivity to recent action. Shorter values catch more pivots in choppy conditions; longer smooths for major swings. Default: 30 (bars). Trade-offs/Tips: Min 1; for intraday, try 10โ20 to reduce lag but watch for noise; on daily, 50+ for stability.
Show Pivot Labels โ Toggles display of text markers at swing points, aiding quick identification of higher highs, lower highs, lower lows, or higher lows. Default: true. Trade-offs/Tips: Disable in multi-indicator setups to declutter; useful for backtesting structure.
HH Color โ Sets the line and label color for higher high anchored lines, distinguishing resistance levels. Default: Red (solid). Trade-offs/Tips: Choose contrasting hues for dark/light themes; pair with opacity for fills if added later.
LL Color โ Sets the line and label color for lower low anchored lines, distinguishing support levels. Default: Lime (solid). Trade-offs/Tips: As above; green shades work well for bullish contexts without overpowering candles.
Reading & Interpretation
Higher high labels and red lines indicate potential resistance zones where volume weighting begins at a new swing top, suggesting sellers may defend prior highs. Lower low labels and lime lines mark support from a fresh swing bottom, with the line's slope reflecting buyer commitment via volume. Lower highs or higher lows appear as labels without new anchors, signaling possible range-bound action. Line proximity to price shows overextension; crosses may hint at regime shifts, but confirm with volume spikes.
Practical Workflows & Combinations
- Trend following: Enter longs above a rising lower low anchored line after higher low confirmation; filter with rising higher highs for uptrends. Use line breaks as trailing stops.
- Exits/Stops: In downtrends, exit shorts below a higher high line; set aggressive stops above it for scalps, conservative below for swings. Pair with momentum oscillators for divergence.
- Multi-asset/Multi-TF: Defaults suit forex/stocks on 1Hโ4H; on crypto 15M, shorten length to 15. Scale colors for dark themes; combine with higher timeframe anchors for confluence.
Behavior, Constraints & Performance
Closed-bar logic ensures pivots confirm after the lookback period, with no repainting on historical barsโlive bars may adjust until regime shift. No higher timeframe calls, so minimal repaint risk beyond standard delays. Resources include a 2000-bar history limit, label/polyline caps at 200/50, and loops for historical point filling (up to current bar count from anchor, typically under 500 iterations). Known limits: In extreme gaps or low-volume periods, anchors may skew; lines absent until first pivots.
Sensible Defaults & Quick Tuning
Start with the 30-bar length for balanced pivot detection across most assets. For too-frequent pivots in ranges, increase to 50 for fewer signals. If lines lag in trends, reduce to 20 and enable labels for visual cues. In low-volatility assets, widen color contrasts; test on 100-bar history to verify stability.
What this indicator isโand isnโt
This is a structure-aware visualization layer for anchoring volume-weighted references at swing extremes, enhancing manual analysis of regimes and levels. It is not a standalone signal generator or predictive modelโalways integrate with broader context like order flow or news. Use alongside risk management and position sizing, not as isolated buy/sell triggers.
Many thanks to LuxAlgo for the original script "McDonald's Pattern ". The implementation for body pivots instead of wicks uses a = max(open, close), b = min(open, close) and then highest(a, length) / lowest(b, length). This filters noise from the wicks and detects breakouts over/under bodies. Unusual and targeted, super innovative.
Disclaimer
The content provided, including all code and materials, is strictly for educational and informational purposes only. It is not intended as, and should not be interpreted as, financial advice, a recommendation to buy or sell any financial instrument, or an offer of any financial product or service. All strategies, tools, and examples discussed are provided for illustrative purposes to demonstrate coding techniques and the functionality of Pine Script within a trading context.
Any results from strategies or tools provided are hypothetical, and past performance is not indicative of future results. Trading and investing involve high risk, including the potential loss of principal, and may not be suitable for all individuals. Before making any trading decisions, please consult with a qualified financial professional to understand the risks involved.
By using this script, you acknowledge and agree that any trading decisions are made solely at your discretion and risk.
Do not use this indicator on Heikin-Ashi, Renko, Kagi, Point-and-Figure, or Range charts, as these chart types can produce unrealistic results for signal markers and alerts.
Best regards and happy trading
Chervolino
Dynamic Market Structure (MTF) - Dow TheoryDynamic Market Structure (MTF)
OVERVIEW
This advanced indicator provides a comprehensive and fully customizable solution for analyzing market structure based on classic Dow Theory principles. It automates the identification of key structural points, including Higher Highs (HH), Higher Lows (HL), Lower Lows (LL), and Lower Highs (LH).
Going beyond simple pivot detection, this tool visualizes the flow of the trend by plotting dynamic Breaks of Structure (BOS) and potential reversals with Changes of Character (CHoCH). It is designed to be a flexible and powerful tool for traders who use price action and trend analysis as a core part of their strategy.
CORE CONCEPTS
The indicator is built on the foundational principles of Dow Theory:
Uptrend: A series of Higher Highs and Higher Lows.
Downtrend: A series of Lower Lows and Lower Highs.
Break of Structure (BOS): Occurs when price action continues the current trend by creating a new HH in an uptrend or a new LL in a downtrend.
Change of Character (CHoCH): Occurs when the established trend sequence is broken, signaling a potential reversal. For example, when a Lower Low forms after a series of Higher Highs.
CALCULATION METHODOLOGY
This section explains the indicator's underlying logic:
Pivot Detection: The indicator's core logic is based on TradingView's built-in ta.pivothigh() and ta.pivotlow() functions. The sensitivity of this detection is fully controlled by the user via the Pivot Lookback Left and Pivot Lookback Right settings.
Structure Calculation (BOS/CHoCH): The script identifies market structure by analyzing the sequence of these confirmed pivots.
A bullish BOS is plotted when a new ta.pivothigh is confirmed at a price higher than the previous confirmed ta.pivothigh.
A bearish CHoCH is plotted when a new ta.pivotlow is confirmed at a price lower than the previous confirmed ta.pivotlow , breaking the established sequence of higher lows.
The logic is mirrored for bearish BOS and bullish CHoCH.
Invalidation Levels: This feature identifies the last confirmed pivot before a structure break (e.g., the last ta.pivotlow before a bullish BOS) and plots a dotted line from it to the breakout bar. This level is considered the structural invalidation point for that move.
MTF Confirmation: This unique feature provides confluence by analyzing a second, lower timeframe. When a pivot (e.g., a Higher Low) is confirmed on the main chart, the script requests pivot data from the user-selected lower timeframe. If a corresponding trend reversal is detected on that lower timeframe (e.g., a break of its own minor downtrend), the pivot is labeled "Firm" (FHL); otherwise, it is labeled "Soft" (SHL).
KEY FEATURES
This indicator is packed with advanced features designed to provide a deeper level of market insight:
Dynamic Structure Lines: BOS and CHoCH levels are plotted with clean, dashed lines that dynamically start at the old pivot and terminate precisely at the breakout bar, keeping the chart clean and precise.
Invalidation Levels: For every structure break, the indicator can plot a dotted "Invalidation" line (INV). This marks the critical support or resistance pivot that, if broken, would negate the previous move, providing a clear reference for risk management.
Multi-Timeframe (MTF) Confirmation: Add a layer of confluence to your analysis by confirming pivots on a lower timeframe. The indicator can label Higher Lows and Lower Highs as either "Firm" (FHL/FLH) if confirmed by a reversal on a lower timeframe, or "Soft" (SHL/SLH) if not.
Flexible Pivot Detection: Fully adjustable Pivot Lookback settings for the left and right sides allow you to tune the indicator's sensitivity to match any timeframe or trading style, from long-term investing to short-term scalping.
Full Customization: Take complete control of the indicator's appearance. A dedicated style menu allows you to customize the colors for all bullish, bearish, and reversal elements, including the transparency of the trend-based candle coloring.
HOW TO USE
Trend Identification: Use the sequence of HH/HL and LL/LH, along with the trend-colored candles, to quickly assess the current market direction on any timeframe.
Entry Signals: A confirmed BOS can signal a potential entry in the direction of the trend. A CHoCH can signal a potential reversal, offering an opportunity to enter a new trend early.
Risk Management: Use the automatically plotted "Invalidation" (INV) lines as a logical reference point for placing stop losses. A break of this level indicates that the structure you were trading has failed.
Confluence: Use the "Firm" pivot signals from the MTF analysis to identify high-probability swing points that are supported by price action on multiple timeframes.
SETTINGS BREAKDOWN
Pivot Lookback Left/Right: Controls the sensitivity of pivot detection. Higher numbers find more significant (but fewer) pivots.
MTF Confirmation: Enable/disable the "Firm" vs. "Soft" pivot analysis and select your preferred lower timeframe for confirmation.
Style Settings: Customize all colors and the transparency of the candle coloring to match your chart's theme.
Show Invalidation Levels: Toggle the visibility of the dotted invalidation lines.
This indicator is a powerful tool for visualizing and trading with the trend. Experiment with the settings to find a configuration that best fits your personal trading strategy.
Historical Matrix Analyzer [PhenLabs]๐Historical Matrix Analyzer
Version: PineScriptv6
๐Description
The Historical Matrix Analyzer is an advanced probabilistic trading tool that transforms technical analysis into a data-driven decision support system. By creating a comprehensive 56-cell matrix that tracks every combination of RSI states and multi-indicator conditions, this indicator reveals which market patterns have historically led to profitable outcomes and which have not.
At its core, the indicator continuously monitors seven distinct RSI states (ranging from Extreme Oversold to Extreme Overbought) and eight unique indicator combinations (MACD direction, volume levels, and price momentum). For each of these 56 possible market states, the system calculates average forward returns, win rates, and occurrence counts based on your configurable lookback period. The result is a color-coded probability matrix that shows you exactly where you stand in the historical performance landscape.
The standout feature is the Current State Panel, which provides instant clarity on your active market conditions. This panel displays signal strength classifications (from Strong Bullish to Strong Bearish), the average return percentage for similar past occurrences, an estimated win rate using Bayesian smoothing to prevent small-sample distortions, and a confidence level indicator that warns you when insufficient data exists for reliable conclusions.
๐Points of Innovation
Multi-dimensional state classification combining 7 RSI levels with 8 indicator combinations for 56 unique trackable market conditions
Bayesian win rate estimation with adjustable smoothing strength to provide stable probability estimates even with limited historical samples
Real-time active cell highlighting with โNOWโ marker that visually connects current market conditions to their historical performance data
Configurable color intensity sensitivity allowing traders to adjust heat-map responsiveness from conservative to aggressive visual feedback
Dual-panel display system separating the comprehensive statistics matrix from an easy-to-read current state summary panel
Intelligent confidence scoring that automatically warns traders when occurrence counts fall below reliable thresholds
๐งCore Components
RSI State Classification: Segments RSI readings into 7 distinct zones (Extreme Oversold <20, Oversold 20-30, Weak 30-40, Neutral 40-60, Strong 60-70, Overbought 70-80, Extreme Overbought >80) to capture momentum extremes and transitions
Multi-Indicator Condition Tracking: Simultaneously monitors MACD crossover status (bullish/bearish), volume relative to moving average (high/low), and price direction (rising/falling) creating 8 binary-encoded combinations
Historical Data Storage Arrays: Maintains rolling lookback windows storing RSI states, indicator states, prices, and bar indices for precise forward-return calculations
Forward Performance Calculator: Measures price changes over configurable forward bar periods (1-20 bars) from each historical state, accumulating total returns and win counts per matrix cell
Bayesian Smoothing Engine: Applies statistical prior assumptions (default 50% win rate) weighted by user-defined strength parameter to stabilize estimated win rates when sample sizes are small
Dynamic Color Mapping System: Converts average returns into color-coded heat map with intensity adjusted by sensitivity parameter and transparency modified by confidence levels
๐ฅKey Features
56-Cell Probability Matrix: Comprehensive grid displaying every possible combination of RSI state and indicator condition, with each cell showing average return percentage, estimated win rate, and occurrence count for complete statistical visibility
Current State Info Panel: Dedicated display showing your exact position in the matrix with signal strength emoji indicators, numerical statistics, and color-coded confidence warnings for immediate situational awareness
Customizable Lookback Period: Adjustable historical window from 50 to 500 bars allowing traders to focus on recent market behavior or capture longer-term pattern stability across different market cycles
Configurable Forward Performance Window: Select target holding periods from 1 to 20 bars ahead to align probability calculations with your trading timeframe, whether day trading or swing trading
Visual Heat Mapping: Color-coded cells transition from red (bearish historical performance) through gray (neutral) to green (bullish performance) with intensity reflecting statistical significance and occurrence frequency
Intelligent Data Filtering: Minimum occurrence threshold (1-10) removes unreliable patterns with insufficient historical samples, displaying gray warning colors for low-confidence cells
Flexible Layout Options: Independent positioning of statistics matrix and info panel to any screen corner, accommodating different chart layouts and personal preferences
Tooltip Details: Hover over any matrix cell to see full RSI label, complete indicator status description, precise average return, estimated win rate, and total occurrence count
๐จVisualization
Statistics Matrix Table: A 9-column by 8-row grid with RSI states labeling vertical axis and indicator combinations on horizontal axis, using compact abbreviations (XOverS, OverB, MACDโ, Volโ, Pโ) for space efficiency
Active Cell Indicator: The current market state cell displays โโฆฟ NOW โฆฟโ in yellow text with enhanced color saturation to immediately draw attention to relevant historical performance
Signal Strength Visualization: Info panel uses emoji indicators (๐ฅ Strong Bullish, โ
Bullish, โ๏ธ Weak Bullish, โ Neutral, โ๏ธ Weak Bearish, โ Bearish, โ๏ธ Strong Bearish, โ ๏ธ Insufficient Data) for rapid interpretation
Histogram Plot: Below the price chart, a green/red histogram displays the current cellโs average return percentage, providing a time-series view of how historical performance changes as market conditions evolve
Color Intensity Scaling: Cell background transparency and saturation dynamically adjust based on both the magnitude of average returns and the occurrence count, ensuring visual emphasis on reliable patterns
Confidence Level Display: Info panel bottom row shows โHigh Confidenceโ (green), โMedium Confidenceโ (orange), or โLow Confidenceโ (red) based on occurrence counts relative to minimum threshold multipliers
๐Usage Guidelines
RSI Period
Default: 14
Range: 1 to unlimited
Description: Controls the lookback period for RSI momentum calculation. Standard 14-period provides widely-recognized overbought/oversold levels. Decrease for faster, more sensitive RSI reactions suitable for scalping. Increase (21, 28) for smoother, longer-term momentum assessment in swing trading. Changes affect how quickly the indicator moves between the 7 RSI state classifications.
MACD Fast Length
Default: 12
Range: 1 to unlimited
Description: Sets the faster exponential moving average for MACD calculation. Standard 12-period setting works well for daily charts and captures short-term momentum shifts. Decreasing creates more responsive MACD crossovers but increases false signals. Increasing smooths out noise but delays signal generation, affecting the bullish/bearish indicator state classification.
MACD Slow Length
Default: 26
Range: 1 to unlimited
Description: Defines the slower exponential moving average for MACD calculation. Traditional 26-period setting balances trend identification with responsiveness. Must be greater than Fast Length. Wider spread between fast and slow increases MACD sensitivity to trend changes, impacting the frequency of indicator state transitions in the matrix.
MACD Signal Length
Default: 9
Range: 1 to unlimited
Description: Smoothing period for the MACD signal line that triggers bullish/bearish state changes. Standard 9-period provides reliable crossover signals. Shorter values create more frequent state changes and earlier signals but with more whipsaws. Longer values produce more confirmed, stable signals but with increased lag in detecting momentum shifts.
Volume MA Period
Default: 20
Range: 1 to unlimited
Description: Lookback period for volume moving average used to classify volume as โhighโ or โlowโ in indicator state combinations. 20-period default captures typical monthly trading patterns. Shorter periods (10-15) make volume classification more reactive to recent spikes. Longer periods (30-50) require more sustained volume changes to trigger state classification shifts.
Statistics Lookback Period
Default: 200
Range: 50 to 500
Description: Number of historical bars used to calculate matrix statistics. 200 bars provides substantial data for reliable patterns while remaining responsive to regime changes. Lower values (50-100) emphasize recent market behavior and adapt quickly but may produce volatile statistics. Higher values (300-500) capture long-term patterns with stable statistics but slower adaptation to changing market dynamics.
Forward Performance Bars
Default: 5
Range: 1 to 20
Description: Number of bars ahead used to calculate forward returns from each historical state occurrence. 5-bar default suits intraday to short-term swing trading (5 hours on hourly charts, 1 week on daily charts). Lower values (1-3) target short-term momentum trades. Higher values (10-20) align with position trading and longer-term pattern exploitation.
Color Intensity Sensitivity
Default: 2.0
Range: 0.5 to 5.0, step 0.5
Description: Amplifies or dampens the color intensity response to average return magnitudes in the matrix heat map. 2.0 default provides balanced visual emphasis. Lower values (0.5-1.0) create subtle coloring requiring larger returns for full saturation, useful for volatile instruments. Higher values (3.0-5.0) produce vivid colors from smaller returns, highlighting subtle edges in range-bound markets.
Minimum Occurrences for Coloring
Default: 3
Range: 1 to 10
Description: Required minimum sample size before applying color-coded performance to matrix cells. Cells with fewer occurrences display gray โinsufficient dataโ warning. 3-occurrence default filters out rare patterns. Lower threshold (1-2) shows more data but includes unreliable single-event statistics. Higher thresholds (5-10) ensure only well-established patterns receive visual emphasis.
Table Position
Default: top_right
Options: top_left, top_right, bottom_left, bottom_right
Description: Screen location for the 56-cell statistics matrix table. Position to avoid overlapping critical price action or other indicators on your chart. Consider chart orientation and candlestick density when selecting optimal placement.
Show Current State Panel
Default: true
Options: true, false
Description: Toggle visibility of the dedicated current state information panel. When enabled, displays signal strength, RSI value, indicator status, average return, estimated win rate, and confidence level for active market conditions. Disable to declutter charts when only the matrix table is needed.
Info Panel Position
Default: bottom_left
Options: top_left, top_right, bottom_left, bottom_right
Description: Screen location for the current state information panel (when enabled). Position independently from statistics matrix to optimize chart real estate. Typically placed opposite the matrix table for balanced visual layout.
Win Rate Smoothing Strength
Default: 5
Range: 1 to 20
Description: Controls Bayesian prior weighting for estimated win rate calculations. Acts as virtual sample size assuming 50% win rate baseline. Default 5 provides moderate smoothing preventing extreme win rate estimates from small samples. Lower values (1-3) reduce smoothing effect, allowing win rates to reflect raw data more directly. Higher values (10-20) increase conservatism, pulling win rate estimates toward 50% until substantial evidence accumulates.
โ
Best Use Cases
Pattern-based discretionary trading where you want historical confirmation before entering setups that โlook goodโ based on current technical alignment
Swing trading with holding periods matching your forward performance bar setting, using high-confidence bullish cells as entry filters
Risk assessment and position sizing, allocating larger size to trades originating from cells with strong positive average returns and high estimated win rates
Market regime identification by observing which RSI states and indicator combinations are currently producing the most reliable historical patterns
Backtesting validation by comparing your manual strategy signals against the historical performance of the corresponding matrix cells
Educational tool for developing intuition about which technical condition combinations have actually worked versus those that feel right but lack historical evidence
โ ๏ธLimitations
Historical patterns do not guarantee future performance, especially during unprecedented market events or regime changes not represented in the lookback period
Small sample sizes (low occurrence counts) produce unreliable statistics despite Bayesian smoothing, requiring caution when acting on low-confidence cells
Matrix statistics lag behind rapidly changing market conditions, as the lookback period must accumulate new state occurrences before updating performance data
Forward return calculations use fixed bar periods that may not align with actual trade exit timing, support/resistance levels, or volatility-adjusted profit targets
๐กWhat Makes This Unique
Multi-Dimensional State Space: Unlike single-indicator tools, simultaneously tracks 56 distinct market condition combinations providing granular pattern resolution unavailable in traditional technical analysis
Bayesian Statistical Rigor: Implements proper probabilistic smoothing to prevent overconfidence from limited data, a critical feature missing from most pattern recognition tools
Real-Time Contextual Feedback: The โNOWโ marker and dedicated info panel instantly connect current market conditions to their historical performance profile, eliminating guesswork
Transparent Occurrence Counts: Displays sample sizes directly in each cell, allowing traders to judge statistical reliability themselves rather than hiding data quality issues
Fully Customizable Analysis Window: Complete control over lookback depth and forward return horizons lets traders align the tool precisely with their trading timeframe and strategy requirements
๐ฌHow It Works
1. State Classification and Encoding
Each barโs RSI value is evaluated and assigned to one of 7 discrete states based on threshold levels (0: <20, 1: 20-30, 2: 30-40, 3: 40-60, 4: 60-70, 5: 70-80, 6: >80)
Simultaneously, three binary conditions are evaluated: MACD line position relative to signal line, current volume relative to its moving average, and current close relative to previous close
These three binary conditions are combined into a single indicator state integer (0-7) using binary encoding, creating 8 possible indicator combinations
The RSI state and indicator state are stored together, defining one of 56 possible market condition cells in the matrix
2. Historical Data Accumulation
As each bar completes, the current state classification, closing price, and bar index are stored in rolling arrays maintained at the size specified by the lookback period
When the arrays reach capacity, the oldest data point is removed and the newest added, creating a sliding historical window
This continuous process builds a comprehensive database of past market conditions and their subsequent price movements
3. Forward Return Calculation and Statistics Update
On each bar, the indicator looks back through the stored historical data to find bars where sufficient forward bars exist to measure outcomes
For each historical occurrence, the price change from that bar to the bar N periods ahead (where N is the forward performance bars setting) is calculated as a percentage return
This percentage return is added to the cumulative return total for the specific matrix cell corresponding to that historical barโs state classification
Occurrence counts are incremented, and wins are tallied for positive returns, building comprehensive statistics for each of the 56 cells
The Bayesian smoothing formula combines these raw statistics with prior assumptions (neutral 50% win rate) weighted by the smoothing strength parameter to produce estimated win rates that remain stable even with small samples
๐กNote:
The Historical Matrix Analyzer is designed as a decision support tool, not a standalone trading system. Best results come from using it to validate discretionary trade ideas or filter systematic strategy signals. Always combine matrix insights with proper risk management, position sizing rules, and awareness of broader market context. The estimated win rate feature uses Bayesian statistics specifically to prevent false confidence from limited data, but no amount of smoothing can create reliable predictions from fundamentally insufficient sample sizes. Focus on high-confidence cells (green-colored confidence indicators) with occurrence counts well above your minimum threshold for the most actionable insights.






















