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.
Search in scripts for "scalp"
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.
Luxy Adaptive MA Cloud - Trend Strength & Signal Tracker V2Luxy Adaptive MA Cloud  - Professional Trend Strength & Signal Tracker
Next-generation moving average cloud indicator combining ultra-smooth gradient visualization with intelligent momentum detection. Built for traders who demand clarity, precision, and actionable insights.
 ═══════════════════════════════════════════════ 
  WHAT MAKES THIS INDICATOR SPECIAL? 
 ═══════════════════════════════════════════════ 
Unlike traditional MA indicators that show static lines, Luxy Adaptive MA Cloud creates a  living, breathing visualization  of market momentum. Here's what sets it apart:
 
 Exponential Gradient Technology 
This isn't just a simple fill between two lines. It's a professionally engineered gradient system with 26 precision layers using exponential density distribution. The result? An organic, cloud-like appearance where the center is dramatically darker (15% transparency - where crossovers and price action occur), while edges fade gracefully (75% transparency). Think of it as a visual "heat map" of trend strength.
  Dynamic Momentum Intelligence 
Most MA clouds only show  structure  (which MA is on top). This indicator shows  momentum strength  in real-time through four intelligent states:
- 🟢  Bright Green  = Explosive bullish momentum (both MAs rising strongly)
- 🔵  Blue  = Weakening bullish (structure intact, but momentum fading)
- 🟠  Orange  = Caution zone (bearish structure forming, weak momentum)
- 🔴  Deep Red  = Strong bearish momentum (both MAs falling)
The cloud literally  tells you  when trends are accelerating or losing steam.
  Conditional Performance Architecture 
Every calculation is optimized for speed. Disable a feature? It stops calculating entirely—not just hidden, but  not computed . The 26-layer gradient only renders when enabled. Toggle signals off? Those crossover checks don't run. This makes it one of the most efficient cloud indicators available, even with its advanced visual system.
  Zero Repaint Guarantee 
All signals and momentum states are based on  confirmed bar data only . What you see in historical data is  exactly  what you would have seen trading live. No lookahead bias. No repainting tricks. No signals that "magically" appear perfect in hindsight. If a signal shows in history, it would have triggered in real-time at that exact moment.
  Educational by Design 
Every single input includes comprehensive tooltips with:
- Clear explanations of what each parameter does
- Practical examples of when to use different settings
- Recommended configurations for scalping, day trading, and swing trading
- Real-world trading impact ("This affects entry timing" vs "This is visual only")
You're not just getting an indicator—you're learning  how to use it effectively .
 
  
 ═══════════════════════════════════════════════ 
  THE GRADIENT CLOUD - TECHNICAL DETAILS 
 ═══════════════════════════════════════════════ 
 Architecture: 
 
 26 precision layers  for silk-smooth transitions
 Exponential density curve  - layers packed tightly near center (where crossovers happen), spread wider at edges
 75%-15% transparency range  - center is highly opaque (15%), edges fade gracefully (75%)
 V-Gradient design  - emphasizes the action zone between Fast and Medium MAs
 
 The Four Momentum States: 
🟢  GREEN - Strong Bullish 
 
 Fast MA above Medium MA
 Both MAs rising with momentum > 0.02%
 Action: Enter/hold LONG positions, strong uptrend confirmed
 
🔵  BLUE - Weak Bullish 
 
 Fast MA above Medium MA
 Weak or flat momentum
 Action: Caution - bullish structure but losing strength, consider trailing stops
 
🟠  ORANGE - Weak Bearish 
 
 Medium MA above Fast MA
 Weak or flat momentum  
 Action: Warning - bearish structure developing, consider exits
 
🔴  RED - Strong Bearish 
 
 Medium MA above Fast MA
 Both MAs falling with momentum < -0.02%
 Action: Enter/hold SHORT positions, strong downtrend confirmed
 
 Smooth Transitions:  The momentum score is smoothed using an 8-bar EMA to eliminate noise and prevent whipsaws. You see the  true trend , not every minor fluctuation.
  
 ═══════════════════════════════════════════════ 
  FLEXIBLE MOVING AVERAGE SYSTEM 
 ═══════════════════════════════════════════════ 
 Three Customizable MAs: 
 
 Fast MA  (default: EMA 10) - Reacts quickly to price changes, defines short-term momentum
 Medium MA  (default: EMA 20) - Balances responsiveness with stability, core trend reference
 Slow MA  (default: SMA 200, optional) - Long-term trend filter, major support/resistance
 
 Six MA Types Available: 
 
 EMA  - Exponential; faster response, ideal for momentum and day trading
 SMA  - Simple; smooth and stable, best for swing trading and trend following
 WMA  - Weighted; middle ground between EMA and SMA
 VWMA  - Volume-weighted; reflects market participation, useful for liquid markets
 RMA  - Wilder's smoothing; used in RSI/ADX, excellent for trend filters
 HMA  - Hull; extremely responsive with minimal lag, aggressive option
 
 Recommended Settings by Trading Style: 
 Scalping (1m-5m): 
 
Fast: EMA(5-8)
Medium: EMA(10-15)
Slow: Not needed or EMA(50)
 
 Day Trading (5m-1h): 
 
Fast: EMA(10-12)
Medium: EMA(20-21)
Slow: SMA(200) for bias
 
 Swing Trading (4h-1D): 
 
Fast: EMA(10-20)
Medium: EMA(34-50)
Slow: SMA(200)
 
 Pro Tip:  Start with Fast < Medium < Slow lengths. The gradient works best when there's clear separation between Fast and Medium MAs.
  
 ═══════════════════════════════════════════════ 
  CROSSOVER SIGNALS - CLEAN & RELIABLE 
 ═══════════════════════════════════════════════ 
 Golden Cross  ⬆  LONG Signal 
 
 Fast MA crosses  above  Medium MA
 Classic bullish reversal or trend continuation signal
 Most reliable when accompanied by GREEN cloud (strong momentum)
 
 Death Cross  ⬇  SHORT Signal 
 
 Fast MA crosses  below  Medium MA  
 Classic bearish reversal or trend continuation signal
 Most reliable when accompanied by RED cloud (strong momentum)
 
 Signal Intelligence: 
 
 Anti-spam filter  - Minimum 5 bars between signals prevents noise
 Clean labels  - Placed precisely at crossover points
 Alert-ready  - Built-in ALERTS for automated trading systems
 No repainting  - Signals based on confirmed bars only
 
 Signal Quality Assessment: 
 High-Quality Entry: 
 
Golden Cross + GREEN cloud + Price above both MAs
= Strong bullish setup ✓
 
 Low-Quality Entry (skip or wait): 
 
Golden Cross + ORANGE cloud + Choppy price action
= Weak bullish setup, likely whipsaw ✗
 
  
 ═══════════════════════════════════════════════ 
  REAL-TIME INFO PANEL 
 ═══════════════════════════════════════════════ 
An at-a-glance dashboard showing:
 Trend Strength Indicator: 
 
 Visual display of current momentum state
 Color-coded header matching cloud color
 Instant recognition of market bias
 
 MA Distance Table: 
Shows percentage distance of price from each enabled MA:
 
 Green rows : Price ABOVE MA (bullish)
 Red rows : Price BELOW MA (bearish)
 Gray rows : Price AT MA (rare, decision point)
 
 Distance Interpretation: 
 
+2% to +5%: Healthy uptrend
+5% to +10%: Getting extended, caution
+10%+: Overextended, expect pullback
-2% to -5%: Testing support
-5% to -10%: Oversold zone
-10%+: Deep correction or downtrend
 
 Customization: 
 
 4 corner positions
 5 font sizes (Tiny to Huge)
 Toggle visibility on/off
 
 ═══════════════════════════════════════════════ 
  HOW TO USE - PRACTICAL TRADING GUIDE 
 ═══════════════════════════════════════════════ 
 STRATEGY 1: Trend Following 
 
 Identify trend : Wait for GREEN (bullish) or RED (bearish) cloud
 Enter on signal : Golden Cross in GREEN cloud = LONG, Death Cross in RED cloud = SHORT
 Hold position : While cloud maintains color
 Exit signals :
   • Cloud turns ORANGE/BLUE = momentum weakening, tighten stops
   • Opposite crossover = close position
   • Cloud turns opposite color = full reversal
 
 STRATEGY 2: Pullback Entries 
 
 Confirm trend : GREEN cloud established (bullish bias)
 Wait for pullback : Price touches or crosses below Fast MA
 Enter when : Price rebounds back above Fast MA with cloud still GREEN
 Stop loss : Below Medium MA or recent swing low
 Target : Previous high or when cloud weakens
 
 STRATEGY 3: Momentum Confirmation 
 
 Your setup triggers : (e.g., chart pattern, support/resistance)
 Check cloud color :
   • GREEN = proceed with LONG
   • RED = proceed with SHORT  
   • BLUE/ORANGE = skip or reduce size
 Use gradient as confluence : Not as primary signal, but as momentum filter
 
 Risk Management Tips: 
 
 Never enter against the cloud color (don't LONG in RED cloud)
 Reduce position size during BLUE/ORANGE (transition periods)
 Place stops beyond Medium MA for swing trades
 Use Slow MA (200) as final trend filter - don't SHORT above it in uptrends
 
  
 ═══════════════════════════════════════════════ 
  PERFORMANCE & OPTIMIZATION 
 ═══════════════════════════════════════════════ 
 Tested On: 
 
 Crypto: BTC, ETH, major altcoins
 Stocks: SPY, AAPL, TSLA, QQQ
 Forex: EUR/USD, GBP/USD, USD/JPY
 Indices: S&P 500, NASDAQ, DJI
 
 ═══════════════════════════════════════════════ 
  TRANSPARENCY & RELIABILITY 
 ═══════════════════════════════════════════════ 
 Educational Focus: 
 
 Detailed tooltips on every input
 Clear documentation of methodology
 Practical examples in descriptions
 Teaches you  why , not just  what 
 
 Open Logic: 
 
 Momentum calculation: (Fast slope + Medium slope) / 2
 Smoothing: 8-bar EMA to reduce noise
 Thresholds: ±0.02% for strong momentum classification
 Everything is transparent and explainable
 
 ═══════════════════════════════════════════════ 
  COMPLETE FEATURE LIST 
 ═══════════════════════════════════════════════ 
 Visual Components: 
 
 26-layer exponential gradient cloud
 3 customizable moving average lines
 Golden Cross / Death Cross labels
 Real-time info panel with trend strength
 MA distance table
 
 Calculation Features: 
 
 6 MA types (EMA, SMA, WMA, VWMA, RMA, HMA)
 Momentum-based cloud coloring
 Smoothed trend strength scoring
 Conditional performance optimization
 
 Customization Options: 
 
 All MA lengths adjustable
 All colors customizable (when gradient disabled)
 Panel position (4 corners)
 Font sizes (5 options)
 Toggle any feature on/off
 
 Signal Features: 
 
 Anti-spam filter (configurable gap)
 Clean, non-overlapping labels
 Built-in alert conditions
 No repainting guarantee
 
 ═══════════════════════════════════════════════ 
  IMPORTANT DISCLAIMERS 
 ═══════════════════════════════════════════════ 
 
 This indicator is for  educational and informational purposes only 
 Not financial advice - always do your own research
 Past performance does not guarantee future results
 Use proper risk management - never risk more than you can afford to lose
 Test on paper/demo accounts before using with real money
 Combine with other analysis methods - no single indicator is perfect
 Works best in trending markets; less effective in choppy/sideways conditions
 Signals may perform differently in different timeframes and market conditions
 The indicator uses historical data for MA calculations - allow sufficient lookback period
 
 ═══════════════════════════════════════════════ 
  CREDITS & TECHNICAL INFO 
 ═══════════════════════════════════════════════ 
 Version:  2.0
 Release:  October 2025
 Special Thanks: 
 
 TradingView community for feedback and testing
 Pine Script documentation for technical reference
 
 ═══════════════════════════════════════════════ 
  SUPPORT & UPDATES 
 ═══════════════════════════════════════════════ 
 Found a bug?  Comment below with:
 
 Ticker symbol
 Timeframe
 Screenshot if possible
 Steps to reproduce
 
 Feature requests?  I'm always looking to improve! Share your ideas in the comments.
 Questions?  Check the tooltips first (hover over any input) - most answers are there. If still stuck, ask in comments.
 ═══════════════════════════════════════════════ 
 Happy Trading!  
Remember: The best indicator is the one you understand and use consistently. Take time to learn how the cloud behaves in different market conditions. Practice on paper before going live. Trade smart, manage risk, and may the trends be with you! 🚀
PDB 4 MA + Candle Strength/Weakness Detector
4MA Strength & Reversal Detector
Unlock the power of momentum with this advanced 4 Moving Average system (20, 50, 100, 200) designed to pinpoint market strength and early reversal zones with precision.
How It Works:
- Bearish Reversal: Triggered when all moving averages align (20 < 50 < 100 < 200) and bearish reversal candles appear — highlighting potential tops.
- Bullish Reversal: Triggered when all moving averages align (200 < 100 < 50 < 20) and bullish reversal candles form — marking potential bottoms
:Best For:
⚡ Scalpers and day traders using 1–5 minute timeframes
📈 Identifying momentum shifts and trend exhaustion early
Tip: Combine this with volume or RSI for stronger confirmation and fewer false signals.
Curved Radius Supertrend [BOSWaves]Curved Radius Supertrend — Adaptive Parabolic Trend Framework with Dynamic Acceleration Geometry 
 Overview 
The Curved Radius Supertrend   introduces an evolution of the classic Supertrend indicator - engineered with a dynamic curvature engine that replaces rigid ATR bands with parabolic, radius-based motion. Traditional Supertrend systems rely on static band displacement, reacting linearly to volatility and often lagging behind emerging price acceleration. The Curved Radius Supertend   model redefines this by integrating controlled acceleration and curvature geometry, allowing the trend bands to adapt fluidly to both velocity and duration of price movement.
  
The result is a smoother, more organic trend flow that visually captures the momentum curve of price action - not just its direction. Instead of sharp pivots or whipsaws, traders experience a structurally curved trajectory that mirrors real market inertia. This makes it particularly effective for identifying sustained directional phases, detecting early trend rotations, and filtering out noise that plagues standard Supertrend methodologies.
Unlike conventional band-following systems, the Curved Radius framework is time-reactive and velocity-aware, providing a nuanced signal structure that blends geometric precision with volatility sensitivity.
 Theoretical Foundation 
The Curved Radius Supertrend   draws from the intersection of mathematical curvature dynamics and adaptive volatility processing. Standard Supertrend algorithms extend from Average True Range (ATR) envelopes - a linear measure of volatility that moves proportionally with price deviation. However, markets do not expand or contract linearly. Trend velocity typically accelerates and decelerates in nonlinear arcs, forming natural parabolas across price phases.
By embedding a radius-based acceleration function, the indicator models this natural behavior. The core variable, radiusStrength, controls how aggressively curvature accelerates over time. Instead of simply following price distance, the band now evolves according to temporal acceleration - each bar contributes incremental velocity, bending the trend line into a radius-like curve.
This structural design allows the indicator to anticipate rather than just respond to price action, capturing momentum transitions as curved accelerations rather than binary flips. In practice, this eliminates the stutter effect typical of standard Supertrends and replaces it with fluid directional motion that better reflects actual trend geometry.
 How It Works 
The Curved Radius Supertrend is constructed through a multi-stage process designed to balance price responsiveness with geometric stability:
 1. Baseline Supertrend Core 
The framework begins with a standard ATR-derived upper and lower band calculation. These define the volatility envelope that constrains potential price zones. Directional bias is determined through crossover logic - prices above the lower band confirm an uptrend, while prices below the upper band confirm a downtrend.
 2. Curvature Acceleration Engine 
Once a trend direction is established, a curvature engine is activated. This system uses radiusStrength as a coefficient to simulate acceleration per bar, incrementally increasing velocity over time. The result is a parabolic displacement from the anchor price (the price level at trend change), creating a curved motion path that dynamically widens or tightens as the trend matures.
Mathematically, this acceleration behaves quadratically - each new bar compounds the previous velocity, forming an exponential rate of displacement that resembles curved inertia.
 3. Adaptive Smoothing Layer 
After the radius curve is applied, a smoothing stage (defined by the smoothness parameter) uses a simple moving average to regulate curve noise. This ensures visual coherence without sacrificing responsiveness, producing flowing arcs rather than jagged band steps.
 4. Directional Visualization and Outer Envelope 
Directional state (bullish or bearish) dictates both the color gradient and band displacement. An outer envelope is plotted one ATR beyond the curved band, creating a layered trend visualization that shows the extent of volatility expansion.
 5. Signal Events and Alerts 
Each directional transition triggers a 'BUY' or 'SELL' signal, clearly labeling phase shifts in market structure. Alerts are built in for automation and backtesting.
 Interpretation 
The Curved Radius Supertrend reframes how traders visualize and confirm trends. Instead of simply plotting a trailing stop, it maps the dynamic curvature of trend development.
 
 Uptrend Phases : The band curves upward with increasing acceleration, reflecting the market’s growing directional velocity. As curvature steepens, conviction strengthens.
 Downtrend Phases : The band bends downward in a mirrored acceleration pattern, indicating sustained bearish momentum.
 Trend Change Points : When the direction flips and a new anchor point forms, the curve resets - providing a clean, early visual confirmation of structural reversal.
 Smoothing and Radius Interplay : A lower radius strength produces a tighter, more reactive curve ideal for scalping or short timeframes. Higher values generate broad, sweeping arcs optimized for swing or positional analysis.
 
Visually, this curvature system translates market inertia into shape - revealing how trends bend, accelerate, and ultimately exhaust.
 Strategy Integration 
The Curved Radius Supertrend is versatile enough to integrate seamlessly into multiple trading frameworks:
 
 Trend Following : Use BUY/SELL flips to identify emerging directional bias. Strong curvature continuation confirms sustained momentum.
 Momentum Entry Filtering : Combine with oscillators or volume tools to filter entries only when the curve slope accelerates (high momentum conditions).
 Pullback and Re-entry Timing : The smooth curvature of the radius band allows traders to identify shallow retracements without premature exits. The band acts as a dynamic, self-adjusting support/resistance arc.
 Volatility Compression and Expansion : Flattening curvature indicates volatility compression - a potential pre-breakout zone. Rapid re-steepening signals expansion and directional conviction.
 Stop Placement Framework : The curved band can serve as a volatility-adjusted trailing stop. Because the curve reflects acceleration, it adapts naturally to market rhythm - widening during momentum surges and tightening during stagnation.
 
 Technical Implementation Details 
 
 Curved Radius Engine : Parabolic acceleration algorithm that applies quadratic velocity based on bar count and radiusStrength.
 Anchor Logic : Resets curvature at each trend change, establishing a new reference base for directional acceleration.
 Smoothing Layer : SMA-based curve smoothing for noise reduction.
 Outer Envelope : ATR-derived band offset visualizing volatility extension.
 Directional Coloring : Candle and band coloration tied to current trend state.
 Signal Engine : Built-in BUY/SELL markers and alert conditions for automation or script integration.
 
 Optimal Application Parameters 
 Timeframe Guidance :
 
 1-5 min (Scalping) : 0.08–0.12 radius strength, minimal smoothing for rapid responsiveness.
 15 min : 0.12–0.15 radius strength for intraday trends.
 1H : 0.15–0.18 radius strength for structured short-term swing setups.
 4H : 0.18–0.22 radius strength for macro-trend shaping.
 Daily : 0.20–0.25 radius strength for broad directional curves.
 Weekly : 0.25–0.30 radius strength for smooth macro-level cycles.
 
The suggested radius strength ranges provide general structural guidance. Optimal values may vary across assets and volatility regimes, and should be refined through empirical testing to account for instrument-specific behavior and prevailing market conditions.
 Asset Guidance :
 
 Cryptocurrency : Higher radius and multiplier values to stabilize high-volatility environments.
 Forex : Midrange settings (0.12-0.18) for clean curvature transitions.
 Equities : Balanced curvature for trending sectors or momentum rotation setups.
 Indices/Futures : Moderate radius values (0.15-0.22) to capture cyclical macro swings.
 
 Performance Characteristics 
 High Effectiveness :
 
 Trending environments with directional expansion.
 Markets exhibiting clean momentum arcs and low structural noise.
 
 Reduced Effectiveness :
 
 Range-bound or low-volatility conditions with repeated false flips.
 Ultra-short-term timeframes (<1m) where curvature acceleration overshoots.
 
 Integration Guidelines 
 
 Confluence Framework : Combine with structure tools (order blocks, BOS, liquidity zones) for entry validation.
 Risk Management : Trail stops along the curved band rather than fixed points to align with adaptive market geometry.
 Multi-Timeframe Confirmation : Use higher timeframe curvature as a trend filter and lower timeframe curvature for execution timing.
 Curve Compression Awareness : Treat flattening arcs as potential exhaustion zones - ideal for scaling out or reducing exposure.
 
 Disclaimer 
The Curved Radius Supertrend   is a geometric trend model designed for professional traders and analysts. It is not a predictive system or a guaranteed profit method. Its performance depends on correct parameter calibration and sound risk management. BOSWaves recommends using it as part of a comprehensive analytical framework, incorporating volume, liquidity, and structural context to validate directional signals.
Aktien Spike Detector by DavidDescription:
This indicator marks the daily high and low on the chart and provides a visual and audible alert whenever the current price touches either of these levels. Additionally, the indicator highlights the candlestick that reaches the daily high or low to quickly identify significant market movements or potential reversal points.
Features:
📈 Daily high and low are automatically calculated and displayed as lines on the chart.
🔔 Alert notification when the price touches the daily high or low.
🕯️ Highlighting of the touch candlestick (e.g., color-coded) for better visual orientation.
💡 Ideal for traders trading breakouts, rejections, or intraday reversals.
Areas of application:
Perfect for day traders, scalpers, and intraday analysts who want to see precisely when the market reaches key daily levels.
Aktien Spike Detector by DavidDescription:
This indicator marks the daily high and low on the chart and provides a visual and audible alert whenever the current price touches either of these levels. Additionally, the indicator highlights the candlestick that reaches the daily high or low to quickly identify significant market movements or potential reversal points.
Features:
📈 Daily high and low are automatically calculated and displayed as lines on the chart.
🔔 Alert notification when the price touches the daily high or low.
🕯️ Highlighting of the touch candlestick (e.g., color-coded) for better visual orientation.
💡 Ideal for traders trading breakouts, rejections, or intraday reversals.
Areas of application:
Perfect for day traders, scalpers, and intraday analysts who want to see precisely when the market reaches key daily levels.






















