Open Interest Profile (OI)- By LeviathanThis script implements the concept of Open Interest Profile, which can help you analyze the activity of traders and identify the price levels where they are opening/closing their positions. This data can serve as a confluence for finding the areas of support and resistance , targets and placing stop losses. OI profiles can be viewed in the ranges of days, weeks, months, Tokyo sessions, London sessions and New York sessions.
A short introduction to Open Interest
Open Interest is a metric that measures the total amount of open derivatives contracts in a specific market at a given time. A valid contract is formed by both a buyer who opens a long position and a seller who opens a short position. This means that OI represents the total value of all open longs and all open shorts, divided by two. For example, if Open Interest is showing a value of $1B, it means that there is $1B worth of long and $1B worth of short contracts currently open/unsettled in a given market.
OI increasing = new long and short contracts are entering the market
OI decreasing = long and short contracts are exiting the market
OI unchanged = the net amount of positions remains the same (no new entries/exits or just a transfer of contracts occurring)
About this indicator
*This script is basically a modified version of my previous "Market Sessions and Volume Profile by @LeviathanCapital" indicator but this time, profiles are generated from Tradingview Open Interest data instead of volume (+ some other changes).
The usual representation of OI shows Open Interest value and its change based on time (for a particular day, time frame or each given candle). This indicator takes the data and plots it in a way where you can see the OI activity (change in OI) based on price levels. To put it simply, instead of observing WHEN (time) positions are entering/exiting the market, you can now see WHERE (price) positions are entering/exiting the market. This is the same concept as when it comes to Volume and Volume profile and therefore, similar strategies and ways of understanding the given data can be applied here. You can even combine the two to gain an edge (eg. high OI increase + Volume Profile showing dominant market selling = possible aggressive shorts taking place)
Green nodes = OI increase
Red nodes = OI decrease
A cluster of large green nodes can be used for support and resistance levels (*trapped traders theory) or targets (lots of liquidations and stop losses above/below), OI Profile gaps can present an objective for the price to fill them (liquidity gaps, imbalances, inefficiencies, etc), and more.
Indicator settings
1. Session/Lookback - Choose the range from where the OI Profile will be generated
2. OI Profile Mode - Mode 1 (shows only OI increase), Mode 2 (shows both OI increase and decrease), Mode 3 (shows OI decrease on left side and OI increase on the right side).
3. Show OI Value Area - Shows the area where most OI activity took place (useful as a range or S/R level )
4. Show Session Box - Shows the box around chosen sessions/lookback
5. Show Profile - Show/hide OI Profile
6. Show Current Session - Show/hide the ongoing session
7. Show Session Labels - Show/hide the text labels for each session
8. Resolution - The higher the value, the more refined a profile is, but fewer profiles are shown on the chart
9. OI Value Area % - Choose the percentage of VA (same as in Volume Profile's VA)
10. Smooth OI Data - Useful for assets that have very large spikes in OI over large bars, helps create better profiles
11. OI Increase - Pick the color of OI increase nodes in the profile
12. OI Decrease - Pick the color of OI decrease nodes in the profile
13. Value Area Box - Pick the color of the Value Area Box
14. Session Box Thickness - Pick the thickness of the lines surrounding the chosen sessions
Advice
The indicator calculates the profile based on candles - the more candles you can show, the better profile will be formed. This means that it's best to view most sessions on timeframes like 15min or lower. The only exception is the Monthly profile, where timeframes above 15min should be used. Just take a few minutes and switch between timeframes and sessions and you will figure out the optimal settings.
This is the first version of Open Interest Profile script so please understand that it will be improved in future updates.
Thank you for your support.
** Some profile generation elements are inspired by @LonesomeTheBlue's volume profile script
Search in scripts for "sessions"
Adaptive Market Wave TheoryAdaptive Market Wave Theory
🌊 CORE INNOVATION: PROBABILISTIC PHASE DETECTION WITH MULTI-AGENT CONSENSUS
Adaptive Market Wave Theory (AMWT) represents a fundamental paradigm shift in how traders approach market phase identification. Rather than counting waves subjectively or drawing static breakout levels, AMWT treats the market as a hidden state machine —using Hidden Markov Models, multi-agent consensus systems, and reinforcement learning algorithms to quantify what traditional methods leave to interpretation.
The Wave Analysis Problem:
Traditional wave counting methodologies (Elliott Wave, harmonic patterns, ABC corrections) share fatal weaknesses that AMWT directly addresses:
1. Non-Falsifiability : Invalid wave counts can always be "recounted" or "adjusted." If your Wave 3 fails, it becomes "Wave 3 of a larger degree" or "actually Wave C." There's no objective failure condition.
2. Observer Bias : Two expert wave analysts examining the same chart routinely reach different conclusions. This isn't a feature—it's a fundamental methodology flaw.
3. No Confidence Measure : Traditional analysis says "This IS Wave 3." But with what probability? 51%? 95%? The binary nature prevents proper position sizing and risk management.
4. Static Rules : Fixed Fibonacci ratios and wave guidelines cannot adapt to changing market regimes. What worked in 2019 may fail in 2024.
5. No Accountability : Wave methodologies rarely track their own performance. There's no feedback loop to improve.
The AMWT Solution:
AMWT addresses each limitation through rigorous mathematical frameworks borrowed from speech recognition, machine learning, and reinforcement learning:
• Non-Falsifiability → Hard Invalidation : Wave hypotheses die permanently when price violates calculated invalidation levels. No recounting allowed.
• Observer Bias → Multi-Agent Consensus : Three independent analytical agents must agree. Single-methodology bias is eliminated.
• No Confidence → Probabilistic States : Every market state has a calculated probability from Hidden Markov Model inference. "72% probability of impulse state" replaces "This is Wave 3."
• Static Rules → Adaptive Learning : Thompson Sampling multi-armed bandits learn which agents perform best in current conditions. The system adapts in real-time.
• No Accountability → Performance Tracking : Comprehensive statistics track every signal's outcome. The system knows its own performance.
The Core Insight:
"Traditional wave analysis asks 'What count is this?' AMWT asks 'What is the probability we are in an impulsive state, with what confidence, confirmed by how many independent methodologies, and anchored to what liquidity event?'"
🔬 THEORETICAL FOUNDATION: HIDDEN MARKOV MODELS
Why Hidden Markov Models?
Markets exist in hidden states that we cannot directly observe—only their effects on price are visible. When the market is in an "impulse up" state, we see rising prices, expanding volume, and trending indicators. But we don't observe the state itself—we infer it from observables.
This is precisely the problem Hidden Markov Models (HMMs) solve. Originally developed for speech recognition (inferring words from sound waves), HMMs excel at estimating hidden states from noisy observations.
HMM Components:
1. Hidden States (S) : The unobservable market conditions
2. Observations (O) : What we can measure (price, volume, indicators)
3. Transition Matrix (A) : Probability of moving between states
4. Emission Matrix (B) : Probability of observations given each state
5. Initial Distribution (π) : Starting state probabilities
AMWT's Six Market States:
State 0: IMPULSE_UP
• Definition: Strong bullish momentum with high participation
• Observable Signatures: Rising prices, expanding volume, RSI >60, price above upper Bollinger Band, MACD histogram positive and rising
• Typical Duration: 5-20 bars depending on timeframe
• What It Means: Institutional buying pressure, trend acceleration phase
State 1: IMPULSE_DN
• Definition: Strong bearish momentum with high participation
• Observable Signatures: Falling prices, expanding volume, RSI <40, price below lower Bollinger Band, MACD histogram negative and falling
• Typical Duration: 5-20 bars (often shorter than bullish impulses—markets fall faster)
• What It Means: Institutional selling pressure, panic or distribution acceleration
State 2: CORRECTION
• Definition: Counter-trend consolidation with declining momentum
• Observable Signatures: Sideways or mild counter-trend movement, contracting volume, RSI returning toward 50, Bollinger Bands narrowing
• Typical Duration: 8-30 bars
• What It Means: Profit-taking, digestion of prior move, potential accumulation for next leg
State 3: ACCUMULATION
• Definition: Base-building near lows where informed participants absorb supply
• Observable Signatures: Price near recent lows but not making new lows, volume spikes on up bars, RSI showing positive divergence, tight range
• Typical Duration: 15-50 bars
• What It Means: Smart money buying from weak hands, preparing for markup phase
State 4: DISTRIBUTION
• Definition: Top-forming near highs where informed participants distribute holdings
• Observable Signatures: Price near recent highs but struggling to advance, volume spikes on down bars, RSI showing negative divergence, widening range
• Typical Duration: 15-50 bars
• What It Means: Smart money selling to late buyers, preparing for markdown phase
State 5: TRANSITION
• Definition: Regime change period with mixed signals and elevated uncertainty
• Observable Signatures: Conflicting indicators, whipsaw price action, no clear momentum, high volatility without direction
• Typical Duration: 5-15 bars
• What It Means: Market deciding next direction, dangerous for directional trades
The Transition Matrix:
The transition matrix A captures the probability of moving from one state to another. AMWT initializes with empirically-derived values then updates online:
From/To IMP_UP IMP_DN CORR ACCUM DIST TRANS
IMP_UP 0.70 0.02 0.20 0.02 0.04 0.02
IMP_DN 0.02 0.70 0.20 0.04 0.02 0.02
CORR 0.15 0.15 0.50 0.10 0.10 0.00
ACCUM 0.30 0.05 0.15 0.40 0.05 0.05
DIST 0.05 0.30 0.15 0.05 0.40 0.05
TRANS 0.20 0.20 0.20 0.15 0.15 0.10
Key Insights from Transition Probabilities:
• Impulse states are sticky (70% self-transition): Once trending, markets tend to continue
• Corrections can transition to either impulse direction (15% each): The next move after correction is uncertain
• Accumulation strongly favors IMP_UP transition (30%): Base-building leads to rallies
• Distribution strongly favors IMP_DN transition (30%): Topping leads to declines
The Viterbi Algorithm:
Given a sequence of observations, how do we find the most likely state sequence? This is the Viterbi algorithm—dynamic programming to find the optimal path through the state space.
Mathematical Formulation:
δ_t(j) = max_i × B_j(O_t)
Where:
δ_t(j) = probability of most likely path ending in state j at time t
A_ij = transition probability from state i to state j
B_j(O_t) = emission probability of observation O_t given state j
AMWT Implementation:
AMWT runs Viterbi over a rolling window (default 50 bars), computing the most likely state sequence and extracting:
• Current state estimate
• State confidence (probability of current state vs alternatives)
• State sequence for pattern detection
Online Learning (Baum-Welch Adaptation):
Unlike static HMMs, AMWT continuously updates its transition and emission matrices based on observed market behavior:
f_onlineUpdateHMM(prev_state, curr_state, observation, decay) =>
// Update transition matrix
A *= decay
A += (1.0 - decay)
// Renormalize row
// Update emission matrix
B *= decay
B += (1.0 - decay)
// Renormalize row
The decay parameter (default 0.85) controls adaptation speed:
• Higher decay (0.95): Slower adaptation, more stable, better for consistent markets
• Lower decay (0.80): Faster adaptation, more reactive, better for regime changes
Why This Matters for Trading:
Traditional indicators give you a number (RSI = 72). AMWT gives you a probabilistic state assessment :
"There is a 78% probability we are in IMPULSE_UP state, with 15% probability of CORRECTION and 7% distributed among other states. The transition matrix suggests 70% chance of remaining in IMPULSE_UP next bar, 20% chance of transitioning to CORRECTION."
This enables:
• Position sizing by confidence : 90% confidence = full size; 60% confidence = half size
• Risk management by transition probability : High correction probability = tighten stops
• Strategy selection by state : IMPULSE = trend-follow; CORRECTION = wait; ACCUMULATION = scale in
🎰 THE 3-BANDIT CONSENSUS SYSTEM
The Multi-Agent Philosophy:
No single analytical methodology works in all market conditions. Trend-following excels in trending markets but gets chopped in ranges. Mean-reversion excels in ranges but gets crushed in trends. Structure-based analysis works when structure is clear but fails in chaotic markets.
AMWT's solution: employ three independent agents , each analyzing the market from a different perspective, then use Thompson Sampling to learn which agents perform best in current conditions.
Agent 1: TREND AGENT
Philosophy : Markets trend. Follow the trend until it ends.
Analytical Components:
• EMA Alignment: EMA8 > EMA21 > EMA50 (bullish) or inverse (bearish)
• MACD Histogram: Direction and rate of change
• Price Momentum: Close relative to ATR-normalized movement
• VWAP Position: Price above/below volume-weighted average price
Signal Generation:
Strong Bull: EMA aligned bull AND MACD histogram > 0 AND momentum > 0.3 AND close > VWAP
→ Signal: +1 (Long), Confidence: 0.75 + |momentum| × 0.4
Moderate Bull: EMA stack bull AND MACD rising AND momentum > 0.1
→ Signal: +1 (Long), Confidence: 0.65 + |momentum| × 0.3
Strong Bear: EMA aligned bear AND MACD histogram < 0 AND momentum < -0.3 AND close < VWAP
→ Signal: -1 (Short), Confidence: 0.75 + |momentum| × 0.4
Moderate Bear: EMA stack bear AND MACD falling AND momentum < -0.1
→ Signal: -1 (Short), Confidence: 0.65 + |momentum| × 0.3
When Trend Agent Excels:
• Trend days (IB extension >1.5x)
• Post-breakout continuation
• Institutional accumulation/distribution phases
When Trend Agent Fails:
• Range-bound markets (ADX <20)
• Chop zones after volatility spikes
• Reversal days at major levels
Agent 2: REVERSION AGENT
Philosophy: Markets revert to mean. Extreme readings reverse.
Analytical Components:
• Bollinger Band Position: Distance from bands, percent B
• RSI Extremes: Overbought (>70) and oversold (<30)
• Stochastic: %K/%D crossovers at extremes
• Band Squeeze: Bollinger Band width contraction
Signal Generation:
Oversold Bounce: BB %B < 0.20 AND RSI < 35 AND Stochastic < 25
→ Signal: +1 (Long), Confidence: 0.70 + (30 - RSI) × 0.01
Overbought Fade: BB %B > 0.80 AND RSI > 65 AND Stochastic > 75
→ Signal: -1 (Short), Confidence: 0.70 + (RSI - 70) × 0.01
Squeeze Fire Bull: Band squeeze ending AND close > upper band
→ Signal: +1 (Long), Confidence: 0.65
Squeeze Fire Bear: Band squeeze ending AND close < lower band
→ Signal: -1 (Short), Confidence: 0.65
When Reversion Agent Excels:
• Rotation days (price stays within IB)
• Range-bound consolidation
• After extended moves without pullback
When Reversion Agent Fails:
• Strong trend days (RSI can stay overbought for days)
• Breakout moves
• News-driven directional moves
Agent 3: STRUCTURE AGENT
Philosophy: Market structure reveals institutional intent. Follow the smart money.
Analytical Components:
• Break of Structure (BOS): Price breaks prior swing high/low
• Change of Character (CHOCH): First break against prevailing trend
• Higher Highs/Higher Lows: Bullish structure
• Lower Highs/Lower Lows: Bearish structure
• Liquidity Sweeps: Stop runs that reverse
Signal Generation:
BOS Bull: Price breaks above prior swing high with momentum
→ Signal: +1 (Long), Confidence: 0.70 + structure_strength × 0.2
CHOCH Bull: First higher low after downtrend, breaking structure
→ Signal: +1 (Long), Confidence: 0.75
BOS Bear: Price breaks below prior swing low with momentum
→ Signal: -1 (Short), Confidence: 0.70 + structure_strength × 0.2
CHOCH Bear: First lower high after uptrend, breaking structure
→ Signal: -1 (Short), Confidence: 0.75
Liquidity Sweep Long: Price sweeps below swing low then reverses strongly
→ Signal: +1 (Long), Confidence: 0.80
Liquidity Sweep Short: Price sweeps above swing high then reverses strongly
→ Signal: -1 (Short), Confidence: 0.80
When Structure Agent Excels:
• After liquidity grabs (stop runs)
• At major swing points
• During institutional accumulation/distribution
When Structure Agent Fails:
• Choppy, structureless markets
• During news events (structure becomes noise)
• Very low timeframes (noise overwhelms structure)
Thompson Sampling: The Bandit Algorithm
With three agents giving potentially different signals, how do we decide which to trust? This is the multi-armed bandit problem —balancing exploitation (using what works) with exploration (testing alternatives).
Thompson Sampling Solution:
Each agent maintains a Beta distribution representing its success/failure history:
Agent success rate modeled as Beta(α, β)
Where:
α = number of successful signals + 1
β = number of failed signals + 1
On Each Bar:
1. Sample from each agent's Beta distribution
2. Weight agent signals by sampled probabilities
3. Combine weighted signals into consensus
4. Update α/β based on trade outcomes
Mathematical Implementation:
// Beta sampling via Gamma ratio method
f_beta_sample(alpha, beta) =>
g1 = f_gamma_sample(alpha)
g2 = f_gamma_sample(beta)
g1 / (g1 + g2)
// Thompson Sampling selection
for each agent:
sampled_prob = f_beta_sample(agent.alpha, agent.beta)
weight = sampled_prob / sum(all_sampled_probs)
consensus += agent.signal × agent.confidence × weight
Why Thompson Sampling?
• Automatic Exploration : Agents with few samples get occasional chances (high variance in Beta distribution)
• Bayesian Optimal : Mathematically proven optimal solution to exploration-exploitation tradeoff
• Uncertainty-Aware : Small sample size = more exploration; large sample size = more exploitation
• Self-Correcting : Poor performers naturally get lower weights over time
Example Evolution:
Day 1 (Initial):
Trend Agent: Beta(1,1) → samples ~0.50 (high uncertainty)
Reversion Agent: Beta(1,1) → samples ~0.50 (high uncertainty)
Structure Agent: Beta(1,1) → samples ~0.50 (high uncertainty)
After 50 Signals:
Trend Agent: Beta(28,23) → samples ~0.55 (moderate confidence)
Reversion Agent: Beta(18,33) → samples ~0.35 (underperforming)
Structure Agent: Beta(32,19) → samples ~0.63 (outperforming)
Result: Structure Agent now receives highest weight in consensus
Consensus Requirements by Mode:
Aggressive Mode:
• Minimum 1/3 agents agreeing
• Consensus threshold: 45%
• Use case: More signals, higher risk tolerance
Balanced Mode:
• Minimum 2/3 agents agreeing
• Consensus threshold: 55%
• Use case: Standard trading
Conservative Mode:
• Minimum 2/3 agents agreeing
• Consensus threshold: 65%
• Use case: Higher quality, fewer signals
Institutional Mode:
• Minimum 2/3 agents agreeing
• Consensus threshold: 75%
• Additional: Session quality >0.65, mode adjustment +0.10
• Use case: Highest quality signals only
🌀 INTELLIGENT CHOP DETECTION ENGINE
The Chop Problem:
Most trading losses occur not from being wrong about direction, but from trading in conditions where direction doesn't exist . Choppy, range-bound markets generate false signals from every methodology—trend-following, mean-reversion, and structure-based alike.
AMWT's chop detection engine identifies these low-probability environments before signals fire, preventing the most damaging trades.
Five-Factor Chop Analysis:
Factor 1: ADX Component (25% weight)
ADX (Average Directional Index) measures trend strength regardless of direction.
ADX < 15: Very weak trend (high chop score)
ADX 15-20: Weak trend (moderate chop score)
ADX 20-25: Developing trend (low chop score)
ADX > 25: Strong trend (minimal chop score)
adx_chop = (i_adxThreshold - adx_val) / i_adxThreshold × 100
Why ADX Works: ADX synthesizes +DI and -DI movements. Low ADX means price is moving but not directionally—the definition of chop.
Factor 2: Choppiness Index (25% weight)
The Choppiness Index measures price efficiency using the ratio of ATR sum to price range:
CI = 100 × LOG10(SUM(ATR, n) / (Highest - Lowest)) / LOG10(n)
CI > 61.8: Choppy (range-bound, inefficient movement)
CI < 38.2: Trending (directional, efficient movement)
CI 38.2-61.8: Transitional
chop_idx_score = (ci_val - 38.2) / (61.8 - 38.2) × 100
Why Choppiness Index Works: In trending markets, price covers distance efficiently (low ATR sum relative to range). In choppy markets, price oscillates wildly but goes nowhere (high ATR sum relative to range).
Factor 3: Range Compression (20% weight)
Compares recent range to longer-term range, detecting volatility squeezes:
recent_range = Highest(20) - Lowest(20)
longer_range = Highest(50) - Lowest(50)
compression = 1 - (recent_range / longer_range)
compression > 0.5: Strong squeeze (potential breakout imminent)
compression < 0.2: No compression (normal volatility)
range_compression_score = compression × 100
Why Range Compression Matters: Compression precedes expansion. High compression = market coiling, preparing for move. Signals during compression often fail because the breakout hasn't occurred yet.
Factor 4: Channel Position (15% weight)
Tracks price position within the macro channel:
channel_position = (close - channel_low) / (channel_high - channel_low)
position 0.4-0.6: Center of channel (indecision zone)
position <0.2 or >0.8: Near extremes (potential reversal or breakout)
channel_chop = abs(0.5 - channel_position) < 0.15 ? high_score : low_score
Why Channel Position Matters: Price in the middle of a range is in "no man's land"—equally likely to go either direction. Signals in the channel center have lower probability.
Factor 5: Volume Quality (15% weight)
Assesses volume relative to average:
vol_ratio = volume / SMA(volume, 20)
vol_ratio < 0.7: Low volume (lack of conviction)
vol_ratio 0.7-1.3: Normal volume
vol_ratio > 1.3: High volume (conviction present)
volume_chop = vol_ratio < 0.8 ? (1 - vol_ratio) × 100 : 0
Why Volume Quality Matters: Low volume moves lack institutional participation. These moves are more likely to reverse or stall.
Combined Chop Intensity:
chopIntensity = (adx_chop × 0.25) + (chop_idx_score × 0.25) +
(range_compression_score × 0.20) + (channel_chop × 0.15) +
(volume_chop × i_volumeChopWeight × 0.15)
Regime Classifications:
Based on chop intensity and component analysis:
• Strong Trend (0-20%): ADX >30, clear directional momentum, trade aggressively
• Trending (20-35%): ADX >20, moderate directional bias, trade normally
• Transitioning (35-50%): Mixed signals, regime change possible, reduce size
• Mid-Range (50-60%): Price trapped in channel center, avoid new positions
• Ranging (60-70%): Low ADX, price oscillating within bounds, fade extremes only
• Compression (70-80%): Volatility squeeze, expansion imminent, wait for breakout
• Strong Chop (80-100%): Multiple chop factors aligned, avoid trading entirely
Signal Suppression:
When chop intensity exceeds the configurable threshold (default 80%), signals are suppressed entirely. The dashboard displays "⚠️ CHOP ZONE" with the current regime classification.
Chop Box Visualization:
When chop is detected, AMWT draws a semi-transparent box on the chart showing the chop zone. This visual reminder helps traders avoid entering positions during unfavorable conditions.
💧 LIQUIDITY ANCHORING SYSTEM
The Liquidity Concept:
Markets move from liquidity pool to liquidity pool. Stop losses cluster at predictable locations—below swing lows (buy stops become sell orders when triggered) and above swing highs (sell stops become buy orders when triggered). Institutions know where these clusters are and often engineer moves to trigger them before reversing.
AMWT identifies and tracks these liquidity events, using them as anchors for signal confidence.
Liquidity Event Types:
Type 1: Volume Spikes
Definition: Volume > SMA(volume, 20) × i_volThreshold (default 2.8x)
Interpretation: Sudden volume surge indicates institutional activity
• Near swing low + reversal: Likely accumulation
• Near swing high + reversal: Likely distribution
• With continuation: Institutional conviction in direction
Type 2: Stop Runs (Liquidity Sweeps)
Definition: Price briefly exceeds swing high/low then reverses within N bars
Detection:
• Price breaks above recent swing high (triggering buy stops)
• Then closes back below that high within 3 bars
• Signal: Bullish stop run complete, reversal likely
Or inverse for bearish:
• Price breaks below recent swing low (triggering sell stops)
• Then closes back above that low within 3 bars
• Signal: Bearish stop run complete, reversal likely
Type 3: Absorption Events
Definition: High volume with small candle body
Detection:
• Volume > 2x average
• Candle body < 30% of candle range
• Interpretation: Large orders being filled without moving price
• Implication: Accumulation (at lows) or distribution (at highs)
Type 4: BSL/SSL Pools (Buy-Side/Sell-Side Liquidity)
BSL (Buy-Side Liquidity):
• Cluster of swing highs within ATR proximity
• Stop losses from shorts sit above these highs
• Breaking BSL triggers short covering (fuel for rally)
SSL (Sell-Side Liquidity):
• Cluster of swing lows within ATR proximity
• Stop losses from longs sit below these lows
• Breaking SSL triggers long liquidation (fuel for decline)
Liquidity Pool Mapping:
AMWT continuously scans for and maps liquidity pools:
// Detect swing highs/lows using pivot function
swing_high = ta.pivothigh(high, 5, 5)
swing_low = ta.pivotlow(low, 5, 5)
// Track recent swing points
if not na(swing_high)
bsl_levels.push(swing_high)
if not na(swing_low)
ssl_levels.push(swing_low)
// Display on chart with labels
Confluence Scoring Integration:
When signals fire near identified liquidity events, confluence scoring increases:
• Signal near volume spike: +10% confidence
• Signal after liquidity sweep: +15% confidence
• Signal at BSL/SSL pool: +10% confidence
• Signal aligned with absorption zone: +10% confidence
Why Liquidity Anchoring Matters:
Signals "in a vacuum" have lower probability than signals anchored to institutional activity. A long signal after a liquidity sweep below swing lows has trapped shorts providing fuel. A long signal in the middle of nowhere has no such catalyst.
📊 SIGNAL GRADING SYSTEM
The Quality Problem:
Not all signals are created equal. A signal with 6/6 factors aligned is fundamentally different from a signal with 3/6 factors aligned. Traditional indicators treat them the same. AMWT grades every signal based on confluence.
Confluence Components (100 points total):
1. Bandit Consensus Strength (25 points)
consensus_str = weighted average of agent confidences
score = consensus_str × 25
Example:
Trend Agent: +1 signal, 0.80 confidence, 0.35 weight
Reversion Agent: 0 signal, 0.50 confidence, 0.25 weight
Structure Agent: +1 signal, 0.75 confidence, 0.40 weight
Weighted consensus = (0.80×0.35 + 0×0.25 + 0.75×0.40) / (0.35 + 0.40) = 0.77
Score = 0.77 × 25 = 19.25 points
2. HMM State Confidence (15 points)
score = hmm_confidence × 15
Example:
HMM reports 82% probability of IMPULSE_UP
Score = 0.82 × 15 = 12.3 points
3. Session Quality (15 points)
Session quality varies by time:
• London/NY Overlap: 1.0 (15 points)
• New York Session: 0.95 (14.25 points)
• London Session: 0.70 (10.5 points)
• Asian Session: 0.40 (6 points)
• Off-Hours: 0.30 (4.5 points)
• Weekend: 0.10 (1.5 points)
4. Energy/Participation (10 points)
energy = (realized_vol / avg_vol) × 0.4 + (range / ATR) × 0.35 + (volume / avg_volume) × 0.25
score = min(energy, 1.0) × 10
5. Volume Confirmation (10 points)
if volume > SMA(volume, 20) × 1.5:
score = 10
else if volume > SMA(volume, 20):
score = 5
else:
score = 0
6. Structure Alignment (10 points)
For long signals:
• Bullish structure (HH + HL): 10 points
• Higher low only: 6 points
• Neutral structure: 3 points
• Bearish structure: 0 points
Inverse for short signals
7. Trend Alignment (10 points)
For long signals:
• Price > EMA21 > EMA50: 10 points
• Price > EMA21: 6 points
• Neutral: 3 points
• Against trend: 0 points
8. Entry Trigger Quality (5 points)
• Strong trigger (multiple confirmations): 5 points
• Moderate trigger (single confirmation): 3 points
• Weak trigger (marginal): 1 point
Grade Scale:
Total Score → Grade
85-100 → A+ (Exceptional—all factors aligned)
70-84 → A (Strong—high probability)
55-69 → B (Acceptable—proceed with caution)
Below 55 → C (Marginal—filtered by default)
Grade-Based Signal Brightness:
Signal arrows on the chart have transparency based on grade:
• A+: Full brightness (alpha = 0)
• A: Slight fade (alpha = 15)
• B: Moderate fade (alpha = 35)
• C: Significant fade (alpha = 55)
This visual hierarchy helps traders instantly identify signal quality.
Minimum Grade Filter:
Configurable filter (default: C) sets the minimum grade for signal display:
• Set to "A" for only highest-quality signals
• Set to "B" for moderate selectivity
• Set to "C" for all signals (maximum quantity)
🕐 SESSION INTELLIGENCE
Why Sessions Matter:
Markets behave differently at different times. The London open is fundamentally different from the Asian lunch hour. AMWT incorporates session-aware logic to optimize signal quality.
Session Definitions:
Asian Session (18:00-03:00 ET)
• Characteristics: Lower volatility, range-bound tendency, fewer institutional participants
• Quality Score: 0.40 (40% of peak quality)
• Strategy Implications: Fade extremes, expect ranges, smaller position sizes
• Best For: Mean-reversion setups, accumulation/distribution identification
London Session (03:00-12:00 ET)
• Characteristics: European institutional activity, volatility pickup, trend initiation
• Quality Score: 0.70 (70% of peak quality)
• Strategy Implications: Watch for trend development, breakouts more reliable
• Best For: Initial trend identification, structure breaks
New York Session (08:00-17:00 ET)
• Characteristics: Highest liquidity, US institutional activity, major moves
• Quality Score: 0.95 (95% of peak quality)
• Strategy Implications: Best environment for directional trades
• Best For: Trend continuation, momentum plays
London/NY Overlap (08:00-12:00 ET)
• Characteristics: Peak liquidity, both European and US participants active
• Quality Score: 1.0 (100%—maximum quality)
• Strategy Implications: Highest probability for successful breakouts and trends
• Best For: All signal types—this is prime time
Off-Hours
• Characteristics: Thin liquidity, erratic price action, gaps possible
• Quality Score: 0.30 (30% of peak quality)
• Strategy Implications: Avoid new positions, wider stops if holding
• Best For: Waiting
Smart Weekend Detection:
AMWT properly handles the Sunday evening futures open:
// Traditional (broken):
isWeekend = dayofweek == saturday OR dayofweek == sunday
// AMWT (correct):
anySessionActive = not na(asianTime) or not na(londonTime) or not na(nyTime)
isWeekend = calendarWeekend AND NOT anySessionActive
This ensures Sunday 6pm ET (when futures open) correctly shows "Asian Session" rather than "Weekend."
Session Transition Boosts:
Certain session transitions create trading opportunities:
• Asian → London transition: +15% confidence boost (volatility expansion likely)
• London → Overlap transition: +20% confidence boost (peak liquidity approaching)
• Overlap → NY-only transition: -10% confidence adjustment (liquidity declining)
• Any → Off-Hours transition: Signal suppression recommended
📈 TRADE MANAGEMENT SYSTEM
The Signal Spam Problem:
Many indicators generate signal after signal, creating confusion and overtrading. AMWT implements a complete trade lifecycle management system that prevents signal spam and tracks performance.
Trade Lock Mechanism:
Once a signal fires, the system enters a "trade lock" state:
Trade Lock Duration: Configurable (default 30 bars)
Early Exit Conditions:
• TP3 hit (full target reached)
• Stop Loss hit (trade failed)
• Lock expiration (time-based exit)
During lock:
• No new signals of same type displayed
• Opposite signals can override (reversal)
• Trade status tracked in dashboard
Target Levels:
Each signal generates three profit targets based on ATR:
TP1 (Conservative Target)
• Default: 1.0 × ATR
• Purpose: Quick partial profit, reduce risk
• Action: Take 30-40% off position, move stop to breakeven
TP2 (Standard Target)
• Default: 2.5 × ATR
• Purpose: Main profit target
• Action: Take 40-50% off position, trail stop
TP3 (Extended Target)
• Default: 5.0 × ATR
• Purpose: Runner target for trend days
• Action: Close remaining position or continue trailing
Stop Loss:
• Default: 1.9 × ATR from entry
• Purpose: Define maximum risk
• Placement: Below recent swing low (longs) or above recent swing high (shorts)
Invalidation Level:
Beyond stop loss, AMWT calculates an "invalidation" level where the wave hypothesis dies:
invalidation = entry - (ATR × INVALIDATION_MULT × 1.5)
If price reaches invalidation, the current market interpretation is wrong—not just the trade.
Visual Trade Management:
During active trades, AMWT displays:
• Entry arrow with grade label (▲A+, ▼B, etc.)
• TP1, TP2, TP3 horizontal lines in green
• Stop Loss line in red
• Invalidation line in orange (dashed)
• Progress indicator in dashboard
Persistent Execution Markers:
When targets or stops are hit, permanent markers appear:
• TP hit: Green dot with "TP1"/"TP2"/"TP3" label
• SL hit: Red dot with "SL" label
These persist on the chart for review and statistics.
💰 PERFORMANCE TRACKING & STATISTICS
Tracked Metrics:
• Total Trades: Count of all signals that entered trade lock
• Winning Trades: Signals where at least TP1 was reached before SL
• Losing Trades: Signals where SL was hit before any TP
• Win Rate: Winning / Total × 100%
• Total R Profit: Sum of R-multiples from winning trades
• Total R Loss: Sum of R-multiples from losing trades
• Net R: Total R Profit - Total R Loss
Currency Conversion System:
AMWT can display P&L in multiple formats:
R-Multiple (Default)
• Shows risk-normalized returns
• "Net P&L: +4.2R | 78 trades" means 4.2 times initial risk gained over 78 trades
• Best for comparing across different position sizes
Currency Conversion (USD/EUR/GBP/JPY/INR)
• Converts R-multiples to currency based on:
- Dollar Risk Per Trade (user input)
- Tick Value (user input)
- Selected currency
Example Configuration:
Dollar Risk Per Trade: $100
Display Currency: USD
If Net R = +4.2R
Display: Net P&L: +$420.00 | 78 trades
Ticks
• For futures traders who think in ticks
• Converts based on tick value input
Statistics Reset:
Two reset methods:
1. Toggle Reset
• Turn "Reset Statistics" toggle ON then OFF
• Clears all statistics immediately
2. Date-Based Reset
• Set "Reset After Date" (YYYY-MM-DD format)
• Only trades after this date are counted
• Useful for isolating recent performance
🎨 VISUAL FEATURES
Macro Channel:
Dynamic regression-based channel showing market boundaries:
• Upper/lower bounds calculated from swing pivot linear regression
• Adapts to current market structure
• Shows overall trend direction and potential reversal zones
Chop Boxes:
Semi-transparent overlay during high-chop periods:
• Purple/orange coloring indicates dangerous conditions
• Visual reminder to avoid new positions
Confluence Heat Zones:
Background shading indicating setup quality:
• Darker shading = higher confluence
• Lighter shading = lower confluence
• Helps identify optimal entry timing
EMA Ribbon:
Trend visualization via moving average fill:
• EMA 8/21/50 with gradient fill between
• Green fill when bullish aligned
• Red fill when bearish aligned
• Gray when neutral
Absorption Zone Boxes:
Marks potential accumulation/distribution areas:
• High volume + small body = absorption
• Boxes drawn at these levels
• Often act as support/resistance
Liquidity Pool Lines:
BSL/SSL levels with labels:
• Dashed lines at liquidity clusters
• "BSL" label above swing high clusters
• "SSL" label below swing low clusters
Six Professional Themes:
• Quantum: Deep purples and cyans (default)
• Cyberpunk: Neon pinks and blues
• Professional: Muted grays and greens
• Ocean: Blues and teals
• Matrix: Greens and blacks
• Ember: Oranges and reds
🎓 PROFESSIONAL USAGE PROTOCOL
Phase 1: Learning the System (Week 1)
Goal: Understand AMWT concepts and dashboard interpretation
Setup:
• Signal Mode: Balanced
• Display: All features enabled
• Grade Filter: C (see all signals)
Actions:
• Paper trade ONLY—no real money
• Observe HMM state transitions throughout the day
• Note when agents agree vs disagree
• Watch chop detection engage and disengage
• Track which grades produce winners vs losers
Key Learning Questions:
• How often do A+ signals win vs B signals? (Should see clear difference)
• Which agent tends to be right in current market? (Check dashboard)
• When does chop detection save you from bad trades?
• How do signals near liquidity events perform vs signals in vacuum?
Phase 2: Parameter Optimization (Week 2)
Goal: Tune system to your instrument and timeframe
Signal Mode Testing:
• Run 5 days on Aggressive mode (more signals)
• Run 5 days on Conservative mode (fewer signals)
• Compare: Which produces better risk-adjusted returns?
Grade Filter Testing:
• Track A+ only for 20 signals
• Track A and above for 20 signals
• Track B and above for 20 signals
• Compare win rates and expectancy
Chop Threshold Testing:
• Default (80%): Standard filtering
• Try 70%: More aggressive filtering
• Try 90%: Less filtering
• Which produces best results for your instrument?
Phase 3: Strategy Development (Weeks 3-4)
Goal: Develop personal trading rules based on system signals
Position Sizing by Grade:
• A+ grade: 100% position size
• A grade: 75% position size
• B grade: 50% position size
• C grade: 25% position size (or skip)
Session-Based Rules:
• London/NY Overlap: Take all A/A+ signals
• NY Session: Take all A+ signals, selective on A
• Asian Session: Only A+ signals with extra confirmation
• Off-Hours: No new positions
Chop Zone Rules:
• Chop >70%: Reduce position size 50%
• Chop >80%: No new positions
• Chop <50%: Full position size allowed
Phase 4: Live Micro-Sizing (Month 2)
Goal: Validate paper trading results with minimal risk
Setup:
• 10-20% of intended full position size
• Take ONLY A+ signals initially
• Follow trade management religiously
Tracking:
• Log every trade: Entry, Exit, Grade, HMM State, Chop Level, Agent Consensus
• Calculate: Win rate by grade, by session, by chop level
• Compare to paper trading (should be within 15%)
Red Flags:
• Win rate diverges significantly from paper trading: Execution issues
• Consistent losses during certain sessions: Adjust session rules
• Losses cluster when specific agent dominates: Review that agent's logic
Phase 5: Scaling Up (Months 3-6)
Goal: Gradually increase to full position size
Progression:
• Month 3: 25-40% size (if micro-sizing profitable)
• Month 4: 40-60% size
• Month 5: 60-80% size
• Month 6: 80-100% size
Scale-Up Requirements:
• Minimum 30 trades at current size
• Win rate ≥50%
• Net R positive
• No revenge trading incidents
• Emotional control maintained
💡 DEVELOPMENT INSIGHTS
Why HMM Over Simple Indicators:
Early versions used standard indicators (RSI >70 = overbought, etc.). Win rates hovered at 52-55%. The problem: indicators don't capture state. RSI can stay "overbought" for weeks in a strong trend.
The insight: markets exist in states, and state persistence matters more than indicator levels. Implementing HMM with state transition probabilities increased signal quality significantly. The system now knows not just "RSI is high" but "we're in IMPULSE_UP state with 70% probability of staying in IMPULSE_UP."
The Multi-Agent Evolution:
Original version used a single analytical methodology—trend-following. Performance was inconsistent: great in trends, destroyed in ranges. Added mean-reversion agent: now it was inconsistent the other way.
The breakthrough: use multiple agents and let the system learn which works . Thompson Sampling wasn't the first attempt—tried simple averaging, voting, even hard-coded regime switching. Thompson Sampling won because it's mathematically optimal and automatically adapts without manual regime detection.
Chop Detection Revelation:
Chop detection was added almost as an afterthought. "Let's filter out obviously bad conditions." Testing revealed it was the most impactful single feature. Filtering chop zones reduced losing trades by 35% while only reducing total signals by 20%. The insight: avoiding bad trades matters more than finding good ones.
Liquidity Anchoring Discovery:
Watched hundreds of trades. Noticed pattern: signals that fired after liquidity events (stop runs, volume spikes) had significantly higher win rates than signals in quiet markets. Implemented liquidity detection and anchoring. Win rate on liquidity-anchored signals: 68% vs 52% on non-anchored signals.
The Grade System Impact:
Early system had binary signals (fire or don't fire). Adding grading transformed it. Traders could finally match position size to signal quality. A+ signals deserved full size; C signals deserved caution. Just implementing grade-based sizing improved portfolio Sharpe ratio by 0.3.
🚨 LIMITATIONS & CRITICAL ASSUMPTIONS
What AMWT Is NOT:
• NOT a Holy Grail : No system wins every trade. AMWT improves probability, not certainty.
• NOT Fully Automated : AMWT provides signals and analysis; execution requires human judgment.
• NOT News-Proof : Exogenous shocks (FOMC surprises, geopolitical events) invalidate all technical analysis.
• NOT for Scalping : HMM state estimation needs time to develop. Sub-minute timeframes are not appropriate.
Core Assumptions:
1. Markets Have States : Assumes markets transition between identifiable regimes. Violation: Random walk markets with no regime structure.
2. States Are Inferable : Assumes observable indicators reveal hidden states. Violation: Market manipulation creating false signals.
3. History Informs Future : Assumes past agent performance predicts future performance. Violation: Regime changes that invalidate historical patterns.
4. Liquidity Events Matter : Assumes institutional activity creates predictable patterns. Violation: Markets with no institutional participation.
Performs Best On:
• Liquid Futures : ES, NQ, MNQ, MES, CL, GC
• Major Forex Pairs : EUR/USD, GBP/USD, USD/JPY
• Large-Cap Stocks : AAPL, MSFT, TSLA, NVDA (>$5B market cap)
• Liquid Crypto : BTC, ETH on major exchanges
Performs Poorly On:
• Illiquid Instruments : Low volume stocks, exotic pairs
• Very Low Timeframes : Sub-5-minute charts (noise overwhelms signal)
• Binary Event Days : Earnings, FDA approvals, court rulings
• Manipulated Markets : Penny stocks, low-cap altcoins
Known Weaknesses:
• Warmup Period : HMM needs ~50 bars to initialize properly. Early signals may be unreliable.
• Regime Change Lag : Thompson Sampling adapts over time, not instantly. Sudden regime changes may cause short-term underperformance.
• Complexity : More parameters than simple indicators. Requires understanding to use effectively.
⚠️ RISK DISCLOSURE
Trading futures, stocks, options, forex, and cryptocurrencies involves substantial risk of loss and is not suitable for all investors. Adaptive Market Wave Theory, while based on rigorous mathematical frameworks including Hidden Markov Models and multi-armed bandit algorithms, does not guarantee profits and can result in significant losses.
AMWT's methodologies—HMM state estimation, Thompson Sampling agent selection, and confluence-based grading—have theoretical foundations but past performance is not indicative of future results.
Hidden Markov Model assumptions may not hold during:
• Major news events disrupting normal market behavior
• Flash crashes or circuit breaker events
• Low liquidity periods with erratic price action
• Algorithmic manipulation or spoofing
Multi-agent consensus assumes independent analytical perspectives provide edge. Market conditions change. Edges that existed historically can diminish or disappear.
Users must independently validate system performance on their specific instruments, timeframes, and broker execution environment. Paper trade extensively before risking capital. Start with micro position sizing.
Never risk more than you can afford to lose completely. Use proper position sizing. Implement stop losses without exception.
By using this indicator, you acknowledge these risks and accept full responsibility for all trading decisions and outcomes.
"Elliott Wave was a first-order approximation of market phase behavior. AMWT is the second—probabilistic, adaptive, and accountable."
Initial Public Release
Core Engine:
• True Hidden Markov Model with online Baum-Welch learning
• Viterbi algorithm for optimal state sequence decoding
• 6-state market regime classification
Agent System:
• 3-Bandit consensus (Trend, Reversion, Structure)
• Thompson Sampling with true Beta distribution sampling
• Adaptive weight learning based on performance
Signal Generation:
• Quality-based confluence grading (A+/A/B/C)
• Four signal modes (Aggressive/Balanced/Conservative/Institutional)
• Grade-based visual brightness
Chop Detection:
• 5-factor analysis (ADX, Choppiness Index, Range Compression, Channel Position, Volume)
• 7 regime classifications
• Configurable signal suppression threshold
Liquidity:
• Volume spike detection
• Stop run (liquidity sweep) identification
• BSL/SSL pool mapping
• Absorption zone detection
Trade Management:
• Trade lock with configurable duration
• TP1/TP2/TP3 targets
• ATR-based stop loss
• Persistent execution markers
Session Intelligence:
• Asian/London/NY/Overlap detection
• Smart weekend handling (Sunday futures open)
• Session quality scoring
Performance:
• Statistics tracking with reset functionality
• 7 currency display modes
• Win rate and Net R calculation
Visuals:
• Macro channel with linear regression
• Chop boxes
• EMA ribbon
• Liquidity pool lines
• 6 professional themes
Dashboards:
• Main Dashboard: Market State, Consensus, Trade Status, Statistics
📋 AMWT vs AMWT-PRO:
This version includes all core AMWT functionality:
✓ Full Hidden Markov Model state estimation
✓ 3-Bandit Thompson Sampling consensus system
✓ Complete 5-factor chop detection engine
✓ All four signal modes
✓ Full trade management with TP/SL tracking
✓ Main dashboard with complete statistics
✓ All visual features (channels, zones, pools)
✓ Identical signal generation to PRO
✓ Six professional themes
✓ Full alert system
The PRO version adds the AMWT Advisor panel—a secondary dashboard providing:
• Real-time Market Pulse situation assessment
• Agent Matrix visualization (individual agent votes)
• Structure analysis breakdown
• "Watch For" upcoming setups
• Action Command coaching
Both versions generate identical signals . The Advisor provides additional guidance for interpreting those signals.
Taking you to school. - Dskyz, Trade with probability. Trade with consensus. Trade with AMWT.
Futures Psychological Levels PROFutures Psychological Levels PRO – Professional Usage Guide
Indicator Overview
This elite psychological levels tool dynamically plots the most institutionally relevant round-number clusters across futures markets (ES, NQ, YM, CL, GC, SI, BTC, and custom instruments). It separates levels into three hierarchical tiers — Major, Tradable, and Sniper — while intelligently filtering distant levels using an ATR-based proximity engine. The result is a clean, adaptive overlay that scales perfectly from scalping precision on 1-minute charts to big-picture context on daily/weekly timeframes.
Core Philosophy
Psychological levels are where order flow clusters: stops, limits, and institutional positioning accumulate around round numbers. This indicator turns static round numbers into a dynamic decision framework by:
Prioritizing confluence zones
Reducing clutter in ranging or low-volatility environments
Highlighting only price-relevant levels in real time
Key Features
Instrument Presets – One-click optimized spacing for major futures contracts
Three-Tier Hierarchy – Major (institutional anchors), Tradable (active defense zones), Sniper (precise entry/exit triggers)
ATR Proximity Filter – Automatically hides irrelevant distant levels
Zones or Lines – Visual magnet areas or clean horizontal lines
Price Labels & Summary Table – Instant reference for next major levels above/below
Full Customization – Colors, thickness, styles, and manual overrides
How to Best Use This Indicator (Professional Workflow)
Select the Correct Instrument Preset
Start with the built-in preset matching your chart (e.g., "ES (S&P 500)" for /ES or MES). This instantly applies battle-tested increments. Use "Custom" only for non-standard assets (forex pairs, micros with different tick values, or crypto alts).
Match Settings to Your Trading Style & Timeframe
Reading the Levels – Decision Framework
Major Levels (thick red by default): Highest probability reaction zones. Expect strong reversals, breakouts with volume, or liquidity sweeps. Treat as primary support/resistance.
Tradable Levels (orange): Active trader defense zones. Excellent for limit order placement, partial profit taking, or fading weak moves.
Sniper Levels (thin gray): Precision entries/exits, stop runs, and scalping targets. Confluence with order blocks or volume profile nodes dramatically increases edge.
Trade Setup Examples
Rejection Play: Price approaches a Major level from below → long wick rejection + close back inside → enter in direction of rejection with stop beyond wick extremity.
Break & Retest: Clean breakout through Tradable/Major → retest as new support/resistance → enter on confirmation candle.
Liquidity Sweep: Price briefly breaches Sniper/Major (stop hunt) → rapid reclaim → aggressive counter-trend entry.
Confluence Boost: When a level aligns with daily/weekly open, VWAP, or prior high/low volume node → dramatically increase position size or conviction.
Risk Management Integration
Always place stops just beyond the next logical level (typically a Sniper or Tradable beyond your entry zone). Use the summary table to quickly identify invalidation points. Target the next level in the direction of your bias for minimum 1:2 risk-reward (often 1:3–1:5 achievable at Major levels).
Pro Optimization Tips
High-volatility sessions (NY open, FOMC, NFP): Increase ATR Multiplier slightly to avoid excessive clutter.
Low-volatility Asian/range sessions: Decrease ATR Multiplier for tighter precision.
Combine with Volume Profile (Fixed Range or Session) to confirm high-volume nodes at psych levels.
Pair with anchored/session VWAP for additional confluence layers.
On higher timeframes, disable Sniper levels and zones entirely for minimalist structural analysis.
Important Disclaimer
This indicator is a professional decision-support tool, not a standalone trading system. All trading involves substantial risk of loss. Past performance is not indicative of future results. Always conduct your own analysis, manage risk appropriately, and consider your financial situation before placing trades.
Mastering psychological levels is one of the highest-edge concepts in institutional trading. Used correctly, this indicator gives you the same reference framework that prop desks and market makers watch every day. Trade smart, stay disciplined, and let price action at these levels guide your executions.
FX Session High/Low Bands - Last 5 EST Days
FX Session High/Low Bands - Last 5 Days
Description:
This indicator plots horizontal bands representing the high and low price levels from the major forex trading sessions over the last 5 days. It helps traders identify key support and resistance zones based on recent session activity.
Features:
Multiple Session Tracking: Displays high/low levels for major FX sessions:
Asian Session (Tokyo)
European Session (London)
US Session (New York)
5-Day Lookback: Captures the highest high and lowest low from each session over the previous 5 trading days
Visual Bands: Clear horizontal lines or filled zones showing session boundaries
Dynamic Updates: Automatically recalculates as new session data becomes available
How to Use:
Support/Resistance: Previous session highs/lows often act as key price levels
Breakout Trading: Watch for price breaking above/below session bands
Range Trading: Trade within the bands during consolidation periods
Session Overlap: Pay attention to multiple session bands converging
Ideal For:
Forex day traders
Session-based trading strategies
Support/resistance identification
Multi-timeframe analysis
Midnight Lines for Tokyo, London, New Yorkممتاز 👌 إليك **تعريفًا محدثًا وكاملًا للمؤشر باللغتين العربية والإنجليزية**، مع إدراج توضيح دقيق لتعامل المؤشر مع **تغيّر التوقيت الصيفي والشتوي (DST)** في لندن ونيويورك:
---
## 🇬🇧 **English Description (with DST behavior)**
**Indicator name:** *Midnight Lines for Tokyo, London, and New York*
**Purpose:**
This indicator automatically draws **vertical lines** on the chart at **midnight (00:00)** for the three major global trading sessions:
* **Tokyo**
* **London**
* **New York**
### 🔹 How it works:
1. The script checks each candle’s time using the built-in TradingView time zone function:
* `"Asia/Tokyo"`
* `"Europe/London"`
* `"America/New_York"`
2. When it detects **00:00** in any of these zones, it draws:
* A **vertical dotted line** that extends from the top to the bottom of the chart.
* A **label** at the top with the session name (e.g., “Tokyo Midnight”).
3. Each session has its own color for clarity:
* **Blue** → Tokyo Midnight
* **Green** → London Midnight
* **Red** → New York Midnight
### 🕒 Automatic Daylight Saving Time (DST) Adjustment:
The indicator automatically adapts to **Daylight Saving Time changes** in both **London** and **New York**:
* When London switches between **GMT and GMT+1**, the midnight line shifts automatically to remain accurate.
* When New York switches between **EST and EDT**, the script also updates accordingly.
* Tokyo does **not** observe DST, so its timing stays constant year-round.
### 🎯 Purpose:
Helps traders visually track the start of each new trading day in the major sessions and analyze:
* Session overlaps (e.g., London–New York overlap)
* Session-based trading strategies
* Price movement behavior at each new day open
---
## 🇸🇦 **الوصف بالعربية (مع إدراج تغير التوقيت)**
**اسم المؤشر:** خطوط منتصف الليل لجلسات طوكيو، لندن، ونيويورك
**الهدف:**
يقوم هذا المؤشر تلقائيًا برسم **خطوط عمودية** على الرسم البياني عند **منتصف الليل (00:00)** لكل من الجلسات الثلاث الرئيسية:
* **جلسة طوكيو**
* **جلسة لندن**
* **جلسة نيويورك**
### 🔹 كيفية العمل:
1. يستخدم المؤشر دوال TradingView لحساب الوقت الفعلي لكل مدينة:
* `"Asia/Tokyo"` لطوكيو
* `"Europe/London"` للندن
* `"America/New_York"` لنيويورك
2. عند وصول الساعة إلى **00:00** بتوقيت أي مدينة، يرسم المؤشر:
* **خطًا عموديًا متقطعًا** يمتد من أعلى إلى أسفل الرسم البياني.
* **تسمية (Label)** أعلى الخط باسم الجلسة (مثل “Tokyo Midnight”).
3. كل جلسة لها لون مختلف:
* **أزرق** → منتصف طوكيو
* **أخضر** → منتصف لندن
* **أحمر** → منتصف نيويورك
### 🕒 التعامل مع تغيّر التوقيت الصيفي والشتوي (DST):
يتكيّف المؤشر تلقائيًا مع تغيّر التوقيت في لندن ونيويورك:
* عندما تنتقل لندن بين **التوقيت الشتوي (GMT)** و**التوقيت الصيفي (GMT+1)**، يتحرك الخط تلقائيًا ليبقى في الساعة 00:00 المحلية.
* وعندما تنتقل نيويورك بين **EST** و**EDT**، يتم تعديل الخط كذلك تلقائيًا.
* أما طوكيو فلا تعتمد التوقيت الصيفي، لذا يبقى وقتها ثابتًا دائمًا على الساعة **00:00 JST**.
### 🎯 الفائدة:
يساعد المتداولين على تحديد **بداية كل جلسة تداول رئيسية**، ومراقبة:
* **تداخل الجلسات** مثل لندن ونيويورك
* **تحركات السعر عند بداية اليوم الجديد**
* **استراتيجيات التداول الزمنية حسب الجلسة**
---
Squeeze Hour Frequency [CHE]Squeeze Hour Frequency (ATR-PR) — Standalone — Tracks daily squeeze occurrences by hour to reveal time-based volatility patterns
Summary
This indicator identifies periods of unusually low volatility, defined as squeezes, and tallies their frequency across each hour of the day over historical trading sessions. By aggregating counts into a sortable table, it helps users spot hours prone to these conditions, enabling better scheduling of trading activity to avoid or target specific intraday regimes. Signals gain robustness through percentile-based detection that adapts to recent volatility history, differing from fixed-threshold methods by focusing on relative lowness rather than absolute levels, which reduces false positives in varying market environments.
Motivation: Why this design?
Traders often face uneven intraday volatility, with certain hours showing clustered low-activity phases that precede or follow breakouts, leading to mistimed entries or overlooked calm periods. The core idea of hourly squeeze frequency addresses this by binning low-volatility events into 24 hourly slots and counting distinct daily occurrences, providing a historical profile of when squeezes cluster. This reveals time-of-day biases without relying on real-time alerts, allowing proactive adjustments to session focus.
What’s different vs. standard approaches?
- Reference baseline: Classical volatility tools like simple moving average crossovers or fixed ATR thresholds, which flag squeezes uniformly across the day.
- Architecture differences:
- Uses persistent arrays to track one squeeze per hour per day, preventing overcounting within sessions.
- Employs custom sorting on ratio arrays for dynamic table display, prioritizing top or bottom performers.
- Handles timezones explicitly to ensure consistent binning across global assets.
- Practical effect: Charts show a persistent table ranking hours by squeeze share, making intraday patterns immediately visible—such as a top hour capturing over 20 percent of total events—unlike static overlays that ignore temporal distribution, which matters for avoiding low-liquidity traps in crypto or forex.
How it works (technical)
The indicator first computes a rolling volatility measure over a specified lookback period. It then derives a relative ranking of the current value against recent history within a window of bars. A squeeze is flagged when this ranking falls below a user-defined cutoff, indicating the value is among the lowest in the recent sample.
On each bar, the local hour is extracted using the selected timezone. If a squeeze occurs and the bar has price data, the count for that hour increments only if no prior mark exists for the current day, using a persistent array to store the last marked day per hour. This ensures one tally per unique trading day per slot.
At the final bar, arrays compile counts and ratios for all 24 hours, where the ratio represents each hour's share of total squeezes observed. These are sorted ascending or descending based on display mode, and the top or bottom subset populates the table. Background shading highlights live squeezes in red for visual confirmation. Initialization uses zero-filled arrays for counts and negative seeds for day tracking, with state persisting across bars via variable declarations.
No higher timeframe data is pulled, so there is no repaint risk from external fetches; all logic runs on confirmed bars.
Parameter Guide
ATR Length — Controls the lookback for the volatility measure, influencing sensitivity to short-term fluctuations; shorter values increase responsiveness but add noise, longer ones smooth for stability — Default: 14 — Trade-offs/Tips: Use 10-20 for intraday charts to balance quick detection with fewer false squeezes; test on historical data to avoid over-smoothing in trending markets.
Percentile Window (bars) — Sets the history depth for ranking the current volatility value, affecting how "low" is defined relative to past; wider windows emphasize long-term norms — Default: 252 — Trade-offs/Tips: 100-300 bars suit daily cycles; narrower for fast assets like crypto to catch recent regimes, but risks instability in sparse data.
Squeeze threshold (PR < x) — Defines the cutoff for flagging low relative volatility, where values below this mark a squeeze; lower thresholds tighten detection for rarer events — Default: 10.0 — Trade-offs/Tips: 5-15 percent for conservative signals reducing false positives; raise to 20 for more frequent highlights in high-vol environments, monitoring for increased noise.
Timezone — Specifies the reference for hourly binning, ensuring alignment with market sessions — Default: Exchange — Trade-offs/Tips: Set to "America/New_York" for US assets; mismatches can skew counts, so verify against chart timezone.
Show Table — Toggles the results display, essential for reviewing frequencies — Default: true — Trade-offs/Tips: Disable on mobile for performance; pair with position tweaks for clean overlays.
Pos — Places the table on the chart pane — Default: Top Right — Trade-offs/Tips: Bottom Left avoids candle occlusion on volatile charts.
Font — Adjusts text readability in the table — Default: normal — Trade-offs/Tips: Tiny for dense views, large for emphasis on key hours.
Dark — Applies high-contrast colors for visibility — Default: true — Trade-offs/Tips: Toggle false in light themes to prevent washout.
Display — Filters table rows to focus on extremes or full list — Default: All — Trade-offs/Tips: Top 3 for quick scans of risky hours; Bottom 3 highlights safe low-squeeze periods.
Reading & Interpretation
Red background shading appears on bars meeting the squeeze condition, signaling current low relative volatility. The table lists hours as "H0" to "H23", with columns for daily squeeze counts, percentage share of total squeezes (summing to 100 percent across hours), and an arrow marker on the top hour. A summary row above details the peak count, its share, and the leading hour. A label at the last bar recaps total days observed, data-valid days, and top hour stats. Rising shares indicate clustering, suggesting regime persistence in that slot.
Practical Workflows & Combinations
- Trend following: Scan for hours with low squeeze shares to enter during stable regimes; confirm with higher highs or lower lows on the 15-minute chart, avoiding top-share hours post-news like tariff announcements.
- Exits/Stops: Tighten stops in high-share hours to guard against sudden vol spikes; use the table to shift to conservative sizing outside peak squeeze times.
- Multi-asset/Multi-TF: Defaults work across crypto pairs on 5-60 minute timeframes; for stocks, widen percentile window to 500 bars. Combine with volume oscillators—enter only if squeeze count is below average for the asset.
Behavior, Constraints & Performance
Logic executes on closed bars, with live bars updating counts provisionally but finalizing on confirmation; table refreshes only at the last bar, avoiding intrabar flicker. No security calls or higher timeframes, so no repaint from external data. Resources include a 5000-bar history limit, loops up to 24 iterations for sorting and totals, and arrays sized to 24 elements; labels and table are capped at 500 each for efficiency. Known limits: Skips hours without bars (e.g., weekends), assumes uniform data availability, and may undercount in sparse sessions; timezone shifts can alter profiles without warning.
Sensible Defaults & Quick Tuning
Start with ATR Length at 14, Percentile Window at 252, and threshold at 10.0 for broad crypto use. If too many squeezes flag (noisy table), raise threshold to 15.0 and narrow window to 100 for stricter relative lowness. For sluggish detection in calm markets, drop ATR Length to 10 and threshold to 5.0 to capture subtler dips. In high-vol assets, widen window to 500 and threshold to 20.0 for stability.
What this indicator is—and isn’t
This is a historical frequency tracker and visualization layer for intraday volatility patterns, best as a filter in multi-tool setups. It is not a standalone signal generator, predictive model, or risk manager—pair it with price action, news filters, and position sizing rules.
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
Thanks to Duyck
for the ma sorter
Chart-prepFxxDanny Chart-Prep
A practical multi-tool script for clean and structured chart preparation.
✨ Features
Weekly Close Levels
Automatically plots the previous week’s close and the week before that, with clear styling to distinguish current and past levels.
Trading Sessions
Colored session boxes for the three key market sessions:
Asia (20:00–23:00 UTC-4)
Europe (02:00–05:00 UTC-4)
New York (08:00–11:00 UTC-4)
Each session box automatically adapts to the session’s high/low range and only keeps the last 5 visible to avoid clutter.
Previous Day’s High & Low
Plots the prior day’s high and low with lines that extend into the current session. Up to 10 days are kept on the chart.
Daily & Weekly Separators
Vertical lines to visually separate days (dotted) and weeks (solid, colored).
Anchored to a rolling price window so the Y-axis scaling stays clean and unaffected.
✅ Benefits
Stay focused with key price levels and session ranges marked automatically.
No need for manual drawing or constant adjustments.
Optimized performance – old objects are automatically removed.
No axis distortion from “infinite” lines or boxes.
Candlestick Themes NYSE Pro [GPXalgo]The Critical Role of Color in Trading Performance
Professional trading environments demand visual systems that support rapid decision-making while
minimizing cognitive load and visual fatigue. The NYSE trading desk color schemes have evolved
through decades of refinement, incorporating feedback from over 10,000 active traders and
quantitative performance analysis.
Key Design Principles
1. Contrast Optimization
Minimum contrast ratio of 7:1 for critical data elements against dark backgrounds (#0A0A0A to
#1C1C1C).
2. Semantic Consistency
Universal color language across all trading platforms and instruments.
3. Fatigue Mitigation
Spectral distribution optimized for extended viewing periods without degradation in pattern
recognition.
4. Information Hierarchy
Clear visual prioritization of price action, volume, and technical indicators.
Scientific Foundation
Visual Perception in Trading Contexts
Neurological Processing
The human visual cortex processes color information 60,000 times faster than text. In trading
contexts, this translates to:
• 0.13 seconds average recognition time for color-coded signals
• 0.45 seconds for text-based information
• 72% improvement in pattern recognition with optimized color schemes
Circadian Rhythm Consideration
Trading desk colors are calibrated to minimize melatonin suppression during extended sessions:
• Blue light emission reduced by 65% compared to standard displays
• Warm-spectrum alternatives for overnight sessions
• Adaptive brightness curves aligned with natural circadian cycles
Eye Strain Metrics
Laboratory studies (n=500 traders, 6-month period) demonstrate:
• 43% reduction in reported eye strain
• 31% decrease in headache frequency• 28% improvement in focus duration
• 17% increase in profitable trade execution
Implementation Standards
Display Calibration Requirements
Monitor Specifications
Minimum 1000:1 contrast ratio
sRGB coverage ≥ 99%
Delta E < 2.0 color accuracy
Brightness: 120-150 cd/m² (dark environment)
Color temperature: 5800K ± 200K
Multi-Monitor Consistency
• Maximum ΔE variance between displays: 1.5
• Synchronized brightness across array
• Uniform color profiles (ICC v4)
Accessibility Compliance
WCAG 2.1 Level AA Standards
Normal text: 4.5:1 contrast minimum
Large text: 3:1 contrast minimum
Interactive elements: 3:1 contrast minimum
Focus indicators: 3:1 contrast minimum
Colorblind Accommodation All critical information maintains distinguishability under:
• Protanopia (red-blind)
• Deuteranopia (green-blind)
• Tritanopia (blue-blind)
FU + SMI Validator (Proper FU, 30m)Overview
The FU + SMI Validator is a sophisticated technical analysis indicator designed to detect Proper FU (Fakeouts or Liquidity Sweeps) on the 30-minute timeframe. This tool aims to help traders identify high-probability reversal setups that occur when price briefly breaks key levels (sweeping liquidity), then reverses with momentum confirmation.
Fakeouts are common market events where price action “hunts stops” before reversing direction. Correctly identifying these events can offer excellent entry points with defined risk. This indicator combines price action logic with momentum and volatility filters to provide reliable signals.
Core Concepts
Proper FU (Fakeout) Detection
At its core, the script identifies proper fakeouts by checking if the current bar’s price:
For bullish fakeouts: dips below the previous bar’s low (sweeping stops) and then closes above the previous bar’s high
For bearish fakeouts: spikes above the previous bar’s high and then closes below the previous bar’s low
This ensures that the breakout is a true sweep rather than just a one-sided close.
Optionally, the script can require one additional confirmation bar after the FU, ensuring that the momentum is sustained and reducing false signals.
SMI-style Momentum Validation
To improve the quality of signals, the indicator uses a proxy for the Stochastic Momentum Index (SMI) by calculating the difference between current and past linear regression slopes of price. This momentum check helps ensure that fakeouts occur alongside actual directional strength.
Key points:
Momentum must be increasing in the direction of the FU signal.
Momentum filters can be enabled or disabled based on user preference.
Squeeze Condition to Avoid Low-Volatility Traps
The script includes a volatility filter based on a squeeze-like condition:
It compares Bollinger Bands (BB) and Keltner Channels (KC).
When BB bands contract inside KC bands, the market is in a squeeze state, signaling low volatility.
Fakeouts during squeeze conditions are often unreliable; the script can filter these out to reduce false alarms.
Killzone Session Timing Filter
Recognizing that liquidity and volatility vary by session, this tool supports optional filtering for:
London Killzone: 09:00 to 10:30 (UK time)
New York Killzone: 13:00 to 14:30 (UK time)
Signals only trigger during these high-activity windows if enabled, helping traders focus on periods with the best liquidity and market participation.
Note: For Killzone filtering to work accurately, your TradingView chart must be set to the UK timezone.
Features & Benefits
Robust FU detection ensures the breakout price action is meaningful, reducing noise.
Momentum filter via linear regression slope captures trend strength in a smooth, mathematically sound way.
Low-volatility squeeze avoidance helps reduce false signals in choppy or range-bound markets.
Killzone timing filter focuses your attention on the most liquid and active market hours.
Optional confirmation bar increases signal reliability.
Raw FU markers allow visualization of all detected fakeouts for pattern recognition and manual analysis.
Alerts built-in for both valid buy and sell FU setups, enabling real-time notification and quicker decision-making.
Customization Options
Killzone usage: Enable or disable the session timing filter.
Sessions: Configure London and New York killzone time ranges.
Momentum alignment: Enable or disable momentum filter based on SMI proxy.
Volatility filter: Avoid signals during squeeze or low-volatility conditions.
FU confirmation: Option to require one additional confirming candle after the initial FU.
Squeeze and momentum parameters: Adjust Bollinger Bands length and multiplier, Keltner Channel length and ATR multiplier.
Raw FU markers: Show or hide all detected fakeouts regardless of filters.
How to Use This Indicator
Apply to 30-minute charts for forex pairs, indices, cryptocurrencies, or other instruments.
Set your chart timezone to UK time if using Killzone filters.
Adjust input parameters based on your preferred sessions and risk tolerance.
Look for green “VALID BUY FU” labels below bars for bullish fakeout entries.
Look for red “VALID SELL FU” labels above bars for bearish fakeout entries.
Use the alert system to receive notifications on setups.
Combine with your existing analysis or risk management strategy for entries, stops, and profit targets.
Why Use FU + SMI Validator?
Fakeouts are some of the most lucrative but tricky setups for many traders. Without proper filters, they can lead to false entries and losses. This script integrates price action, momentum, volatility, and session timing into one package, providing a robust tool to spot high-quality fakeout opportunities and improve trading confidence.
Limitations
Requires chart to be set to UK timezone for session filters.
Designed specifically for 30-minute timeframe — performance on other timeframes may vary.
Momentum is a proxy, not a direct SMI calculation.
Like all indicators, best used in conjunction with sound risk management and other analysis tools.
Potential Enhancements
Conversion into a full strategy script for backtesting entries and exits.
Addition of other momentum indicators (RSI, MACD) or volume filters.
Customizable time zones or auto time zone detection.
Multi-timeframe analysis capabilities.
Visual dashboard for summary of signal stats.
Time Based Range CandleThis indicator creates a visual candle representation from price action during a specified time period.
Key Features:
Configurable Sessions: Set any calculation period (when range is measured) and display period (when visualization appears)
Candle Visualization: Draws a large candle showing open, close, high, low with proper body coloring
Wick/Tail Analysis: Displays wicks and tails with quarter-level subdivisions based on candle type (bullish vs bearish)
End Marker: Vertical line marks exactly when the calculation period ends
Quarter Lines: Optional dotted/dashed lines showing 25%, 50%, 75% levels within body, wicks, and tails
Common Use Cases:
Overnight range analysis (18:00 - 6:00 ET) displayed during regular hours
Session-based range trading (Asian, London, NY sessions)
Custom time period analysis for any market
The indicator follows proper candle terminology where wicks and tails are measured differently for bullish vs bearish candles, making it useful for precise level analysis and range trading strategies.
Prev D/W/M + Asia & London Levels [Oeditrades]Prev D/W/M + Asia & London Levels
Author: Oeditrades
Platform: Pine Script® v6
What it does
Plots only the most recent, fully completed:
Previous Day / Week / Month highs & lows
Asia and London session highs & lows
Levels are drawn as true horizontal lines from the period/session start and extended to the right for easy confluence reading. The script is non-repainting.
How it works
Prev Day/Week/Month: Uses completed HTF candles (high / low ) so values are fixed for the entire next period.
Sessions (NY time): Asia (default 20:00–03:00) and London (default 03:00–08:00) are tracked in America/New_York time. High/low are locked when the session ends, and the line is anchored at that session’s start.
Inputs & customization
Visibility: toggle Previous Day/Week/Month, Asia, London, and labels.
Colors: highs default red; lows default green (user-configurable). Session highs default pink, lows aqua (also editable).
Style: line style (solid/dotted/dashed) and width.
Sessions: editable time windows for Asia and London (still interpreted in New York time).
Disclaimer: optional on-chart disclaimer panel with editable text.
Notes
Works on any timeframe. For intraday charts, the HTF values remain constant until the next HTF bar completes.
If your market’s overnight hours differ, simply adjust the session windows in Inputs.
Lines intentionally show only the latest completed period/session to keep charts clean.
Use cases
Quick view of PDH/PDL, PWH/PWL, PMH/PML for bias and liquidity.
Intraday planning around Asia/London range breaks, retests, and overlaps with prior levels.
Disclaimer
This tool is for educational purposes only and is not financial advice. Markets involve risk; past performance does not guarantee future results.
Trading session High/Low (Lumiere)Trading session High/Low
What it does:
Plots the High and Low for each session (Asia, London, New York) as horizontal zones that “snap” to the first true extreme of the session and then extend right.
Key points:
Snap‑to‑extreme only: Lines don’t draw at the open; they appear only once price makes a new session high or low, and anchor exactly at that bar.
Persistent until next session: Once drawn, each session’s lines stay on the chart after the session ends, and are cleared only when that same session next opens (or when you hide it).
Three configurable sessions:
Asia: 18:00–03:00 (UTC‑4)
London: 03:00–09:30 (UTC‑4)
New York: 09:30–16:00 (UTC‑4)
Customizable appearance:
You can toggle each session on/off, choose its color, and set line width.
The time that is already set on the different sessions is based on the standard session open/close. If you want to change it, it will refer to the NY time, UTC -4.
Session VWAPsThis indicator plots volume-weighted average price (VWAP) lines for three major trading sessions: Tokyo, London, and New York. Each VWAP resets at the start of its session and tracks the average price weighted by volume during that window. You can choose the exact session times, turn individual sessions on or off, and optionally extend each VWAP line until the end of the trading day.
It’s designed to give you a clear view of how price is behaving relative to session-specific value areas. This can help in identifying session overlaps, shifts in price control, or whether price is holding above or below a particular session’s average. The indicator supports futures-style day rollovers and works across markets.
Delta Volume BubblesDelta Volume Bubbles
Overview
The Delta Volume Bubbles indicator is an advanced order flow visualization tool that displays buying and selling pressure through dynamic bubble representations on your chart. Unlike traditional volume indicators that only show total volume, this indicator calculates the net delta volume (difference between buying and selling volume) and presents it as color-coded bubbles of varying sizes.
How It Works
Core Calculation Method
The indicator uses a sophisticated approach to estimate delta volume from standard OHLCV data:
1. Price Action Analysis: Analyzes the relationship between open, high, low, and close prices to determine market aggression
2. Body Ratio Calculation: body_ratio = |close - open| / (high - low)
3. Aggressive Factor: Applies multipliers based on price action:
- Strong moves (body_ratio > 0.7): 1.5x multiplier
- Moderate moves (body_ratio > 0.4): 1.2x multiplier
- Weak moves: 1.0x multiplier
4. Delta Volume Estimation:
- Buy Volume: price_change > 0 ? volume × aggressive_factor : 0
- Sell Volume: price_change < 0 ? volume × aggressive_factor : 0
- Net Delta: buy_volume - sell_volume
5. Delta Strength Normalization: delta_strength = |net_delta| / sma(volume, 20)
Percentile-Based Filtering
The indicator uses percentile filtering instead of fixed thresholds, making it adaptive to market conditions:
- Bubble Filter: Only shows bubbles when volume exceeds the specified percentile (default: 60%)
- Label Filter: Only displays numbers when volume exceeds a higher percentile (default: 90%)
- Dynamic Adaptation: Automatically adjusts to changing market volatility
Visual Elements
Bubble Sizes
- Tiny: Delta strength < 0.3
- Small: Delta strength 0.3 - 0.7
- Normal: Delta strength 0.7 - 1.2
- Large: Delta strength 1.2 - 2.0
- Huge: Delta strength > 2.0
Color Coding
- Aggressive Buy (Bright Green): Strong buying pressure with high body ratio
- Aggressive Sell (Bright Red): Strong selling pressure with high body ratio
- Passive Buy (Light Green): Moderate buying pressure
- Passive Sell (Light Red): Moderate selling pressure
Intensity Mode
Alternative coloring based on delta strength rather than flow direction:
- Gray: Low intensity (< 0.5)
- Blue: Medium intensity (0.5 - 1.0)
- Orange: High intensity (1.0 - 2.0)
- Red: Extreme intensity (> 2.0)
Parameters
Order Flow Settings
- Show Bubbles: Toggle bubble display on/off
- Bubble Volume %ile: Percentile threshold for bubble display (0-100%)
- Intensity Mode: Switch between flow-based and intensity-based coloring
Bubble Labels
- Show Numbers in Bubbles: Toggle numerical labels on/off
- Label Volume %ile: Higher percentile threshold for label display (0-100%)
Numbers are displayed in K-notation (e.g., 25000 → 25K, 1500000 → 1.5M) for better readability.
Ideal Usage Scenarios
Best Market Conditions
- High volume sessions: More accurate delta calculations
- Trending markets: Clear directional flow identification
- Breakout scenarios: Spot aggressive buying/selling at key levels
- Support/resistance testing: Identify accumulation vs distribution
Trading Applications
1. Entry Timing: Look for aggressive flow in your trade direction
2. Exit Signals: Watch for opposing aggressive flow
3. Trend Confirmation: Consistent flow direction confirms trends
4. Volume Climax: Huge bubbles may indicate exhaustion points
Optimization Tips
Parameter Adjustment
- Lower percentiles (40-60%): More bubbles, good for active markets
- Higher percentiles (70-90%): Fewer bubbles, focus on significant events
- Label percentile: Set 20-30% higher than bubble percentile for clarity
Visual Optimization
- Intensity mode: Better for identifying unusual volume spikes
- Flow mode: Better for directional bias analysis
- Label toggle: Turn off in crowded markets, on for key levels
Limitations
- Estimation-based: Uses approximation algorithms, not true order flow data
- Volume dependency: Requires accurate volume data to function properly
- Timeframe sensitivity: Works best on intraday timeframes with active volume
- Market hours: Most effective during high-volume trading sessions
Technical Notes
The indicator implements advanced Pine Script features including:
- Dynamic percentile calculations using ta.percentile_linear_interpolation()
- Conditional plotting with multiple size categories
- Custom number formatting functions
- Efficient label management to prevent display limits
This tool is designed for traders who want to understand the underlying buying and selling pressure beyond simple volume analysis, providing insights into market sentiment and potential turning points.
Multi-Session MarkerMulti-Session Marker is a flexible visual tool for traders who want to highlight up to 10 custom trading sessions directly on their chart’s background.
Custom Sessions: Enter up to 10 time ranges (in HHMM-HHMM format) to mark any market session, news window, or personal focus period.
Visual Clarity: For each session, toggle the highlight on or off and select a unique background color and opacity, making it easy to distinguish active trading windows at a glance.
Universal Time Handling: Session times automatically follow your chart’s time zone—no manual adjustment required.
Efficient and Fast: Utilizes TradingView’s bgcolor() for smooth performance, even on fast timeframes like 1-second charts.
Clean Interface: All session controls are grouped for easy editing in the indicator’s settings panel.
How to use:
In the indicator settings, enter your desired session times (e.g., 0930-1130) for each session you want to highlight.
Toggle “Show Session” and pick a color for each session.
The background will automatically highlight those periods on your chart.
This indicator is ideal for day traders, futures traders, or anyone who wants to visually segment their trading day for better focus and analysis.
Multi-Timeline 1.0Multi-TimeLines 1.0 - Comprehensive Description
WHAT IT DOES:
This indicator creates dynamic horizontal support/resistance lines based on opening prices captured at user-defined New York times. Unlike static horizontal lines, these levels automatically appear and disappear based on sophisticated session logic, providing traders with time-sensitive reference levels that adapt to market sessions.
HOW IT WORKS - TECHNICAL IMPLEMENTATION:
1.
Timezone Conversion Engine:
The script uses Pine Script's "America/New_York" timezone functions to ensure all time calculations are based on NY time, regardless of the user's chart timezone. This eliminates confusion and provides consistent behavior across global markets.
2.
Dual-Category Time Classification System:
The indicator employs a unique two-category classification system:
Category A (16:00-23:59 NY): Evening times that extend overnight until next day 15:59 NY
Category B (00:00-15:59 NY): Day times that extend until same day 15:59 NY
This classification handles the complex logic of overnight sessions and prevents lines from incorrectly resetting at midnight for evening times.
3. Price Capture Mechanism:
Uses precise time-hit detection with backup systems for edge cases (especially midnight 00:00). When a specified time occurs, the script captures the bar's opening price and stores it in persistent variables using Pine Script's var declarations.
4. Session-Aware Display Logic:
Lines only appear during their designated "display windows" - periods when the captured price level is relevant. The script uses conditional plotting with plot.style_linebr to create clean breaks when lines are inactive.
5. Smart Reset System:
Different reset behaviors based on time classification:
Category A times persist across midnight (for overnight analysis)
Category B times reset on day changes (except 00:00 which captures AT day change)
Automatic cleanup when display windows close
ORIGINALITY & UNIQUE FEATURES:
1. Overnight Session Handling:
Unlike basic horizontal line tools, this script properly handles overnight spans for evening times, making it invaluable for analyzing gaps and overnight price action.
2. Automatic Session Management:
No manual line drawing required - the script automatically manages when lines appear/disappear based on NY market sessions (15:59 close, 18:00 after-hours start).
3. Time-Window Display Logic:
Lines only show during relevant periods, reducing chart clutter and focusing attention on currently active levels.
TRADING CONCEPTS & APPLICATIONS:
1. Session-Based Analysis:
Capture opening prices at key session times:
00:00 NY: Sydney/Asian session start
03:00 NY: London pre-market
08:00 NY: London session open
09:30 NY: NYSE opening bell
18:00 NY: After-hours start
2. Gap Analysis:
Evening times (20:00-23:59) that extend overnight are particularly useful for:
Identifying potential gap-fill levels
Tracking overnight high/low breaks
Setting reference points for next-day trading
3. Support/Resistance Framework:
Opening prices at significant times often act as:
Intraday support/resistance levels
Reference points for breakout/breakdown analysis
Pivot levels for mean reversion strategies
HOW TO USE:
1. Time Input:
Enter times in "HH:MM" format using 24-hour NY time:
"09:30" for NYSE open
"15:30" for late-day reference
"20:00" for evening level (extends overnight)
2. Line Behavior:
Blue/Green/Cyan/Red lines: Your custom times
Yellow line: After-hours day open (18:00 NY start)
Lines appear with breaks during inactive periods
3. Strategic Setup:
Use 2-3 key session times for your trading style
Combine morning times (immediate reference) with evening times (overnight analysis)
Toggle after-hours line based on your market focus
CALCULATION METHOD:
The script uses direct opening price capture (no smoothing or averaging) at precise time hits, ensuring the most accurate representation of actual market levels at specified times. This raw price approach maintains the integrity of actual market opening prices rather than manipulated or calculated values.
This method is particularly effective because opening prices at significant times often represent institutional order flow and can act as magnetic levels throughout subsequent sessions.
yatofxDescription: "Ramon Coto's 3 Session Bar Color" Indicator
This TradingView Pine Script indicator colors candlestick bars based on three custom trading sessions. It allows traders to visually distinguish different market timeframes on their charts.
Features:
Three configurable trading sessions with user-defined time ranges.
Customizable session colors:
Session A → Blue
Session B → Red
Session C → Lime
Enable/disable sessions independently using input toggles.
Automatic session detection: Bars are colored based on the active session.
Optimized for TradingView Mobile & Desktop with clear and efficient logic.
How It Works:
1. User Inputs: The script takes session time ranges and enables/disables each session.
2. Session Detection: The script checks whether the current time falls within any of the defined sessions.
3. Bar Coloring: If a session is active, the corresponding color is applied to the bars.
This indicator helps traders quickly recognize which market session they are in, improving decision-making for session-based strategies.
Crypto Market Session Guide with Local TimeMaster the Markets with the Ultimate Trading Session Indicator
Timing is everything in trading. Knowing when liquidity is at its peak and when market sessions overlap can make all the difference in your strategy. This Market Session Guide Indicator helps you navigate the trading day with real-time session tracking, countdown timers, and local time adjustments—giving you a clear edge in the market.
Key Features
Live Session Tracking – Instantly see which trading session is active: Asian, European, US, or the high-volatility EU-US overlap.
Automatic Local Time Conversion – No need to convert UTC manually—session times adjust automatically based on your TradingView exchange settings.
Daylight Saving Time Adjustments – The US market opening and closing times are automatically adjusted for summer and winter shifts.
Countdown Timer for Session Close – Know exactly when the current session will end so you can time your trades effectively.
Next Market Opening Display – Always be prepared by knowing which market opens next and at what exact time in your local timezone.
Clear Visual Guide – A structured table in the top-right of your chart provides all essential session details without cluttering your screen.
How It Works
This indicator tracks the three main trading sessions:
Asian Session (Tokyo, Sydney): 00:00 - 09:00 UTC
European Session (London, Frankfurt): 07:00 - 16:00 UTC
US Session (New York, Chicago): 13:30 - 22:00 UTC (adjusts automatically for Daylight Saving Time)
EU-US Overlap: 12:00 - 16:00 UTC, the most volatile period of the trading day
It also highlights when a session is about to close and when the next one will begin, ensuring you are always aware of liquidity shifts in the market.
Why You Need This Indicator
Optimized for Forex, Crypto, and Indices – Helps traders align their strategies with the most active market hours.
Ideal for Scalping and Day Trading – Enter trades during peak volatility to maximize opportunities.
Eliminates Guesswork – Stop manually tracking time zones and market schedules—everything updates dynamically for you.
Upgrade Your Trading Strategy Today
This indicator simplifies market timing, ensuring you're always trading when liquidity and volatility are at their highest. Whether you're trading Forex, Crypto, or Stocks, knowing when markets open and close is essential for making informed decisions.
Try it out, and if you find it useful, consider sharing it with other traders. Your feedback is always welcome!
Dynamic Time Zone EMA with Candle Trend AnalysisCandleTrend TZ is a powerful analytical tool that integrates time zones, exponential moving averages (EMA), and custom candle coloring based on trend direction. This indicator is ideal for traders looking to analyze market trends within specific time sessions effectively.
Key Features:
Time Zones:
Divides the chart into four distinct time intervals, each highlighted with a unique background color.
Fully customizable start and end times for each interval, allowing for adaptation to various trading schedules.
Exponential Moving Averages (EMA):
Displays three EMAs with user-defined lengths:
EMA 200 (blue) for long-term trends.
EMA 50 (green) for medium-term trends.
EMA 20 (red) for short-term trends.
Helps identify trend direction and strength.
Custom Candle Coloring:
Utilizes smoothed Heiken Ashi and Triple EMA (TEMA) calculations for enhanced candle coloring:
Green candles indicate an upward trend.
Red candles signal a downward trend.
Filters out market noise, providing a clear visual representation of market dynamics.
Customization Options:
Time Zones:
Adjustable start and end times for each of the four sessions:
Input hour and minute for start and end times (e.g., Interval 1 Start/End Hour/Minute).
Background colors are pre-defined but can be modified in the code.
EMAs:
User-defined lengths for each EMA:
EMA 200 Length (default: 200)
EMA 50 Length (default: 50)
EMA 20 Length (default: 20)
TEMA Settings:
Parameters for trend smoothing:
TEMA Length (default: 55)
EMA Length (default: 60)
Use Cases:
Intraday Session Analysis:
Use time zones to differentiate between morning, afternoon, and evening market activity.
The background colors make it easy to track session-specific trends.
Trend Trading:
Analyze EMA crossings and their slopes to confirm market direction.
Green candles indicate buying opportunities, while red candles highlight selling signals.
Noise Reduction:
TEMA smoothing removes market noise, allowing you to focus on the primary market trend.
Adaptation to Custom Strategies:
By adjusting time intervals, you can tailor the indicator to specific trading styles or market conditions.
Benefits:
Versatility for both trending and sideways markets.
Intuitive and user-friendly setup.
Suitable for traders of all skill levels, from beginners to professionals.
CandleTrend TZ is an indispensable tool for understanding market dynamics, enhancing your trading precision, and making well-informed decisions. 🚀
90 Minute Cycles Full90-Minute Cycles Indicator for London and NY Sessions
This is a more streamlined version of the 90-minute cycle indicator by sunwoo101.
The 90-Minute Cycles Indicator is built to help traders easily follow and trade around key market cycles during the London and New York sessions. Marking important 90-minute intervals and highlighting the True Cycle Open Price provides clear visual cues to help you make more informed trading decisions.
Key Features:
90-Minute Cycles for London and NY: The indicator automatically draws vertical lines marking every 90-minute cycle for the London and NY sessions. These lines are great for timing your trades and spotting potential shifts in market momentum.
True Cycle Open Price: A horizontal line is drawn at the True Cycle Open Price, which stays visible throughout the session. This gives you a key reference point for price levels that tend to act as support or resistance.
Customizable Visuals: You can fully personalize the indicator’s appearance - adjusting the colors and line styles and even controlling when the lines appear - so it blends perfectly with your existing charts.
All Cycles Drawn from the Start: Unlike other indicators, this one draws all the 90-minute cycles right when the session begins, so you can see the full day’s potential market moves as soon as the first cycle starts.
What’s Different About This Indicator:
London Session Support: In addition to the NY session, you now have 90-minute cycles for the London session, complete with its own True Cycle Open Price.
Better Customization: You have more control over the visual aspects of the indicator, so it can be tailored to fit your specific charting preferences.
Complete Cycle Visibility: All cycles are drawn immediately when the session starts, providing a full view of the day’s key moments right from the opening.
How to Use:
This indicator is perfect for scalping and short-term trading. Whether trading Forex or Indices and following SMT concepts, the cycle timing can help you pinpoint the best times for entering and exiting trades. The True Cycle Open Price is a crucial level of support or resistance throughout the session, making it a key marker to watch.
Scalpers: Use the 90-minute cycle lines to time your trades with the market's rhythm.
Day Traders: This indicator tracks the London and NY sessions, making it an excellent tool for day trading strategies where timing is critical.
Multi-Session Support:
Whether you're trading the London or New York session, the indicator will automatically adjust to your time zone and align the cycles to the relevant session. This helps you stay on top of key market activity across major trading hubs without changing anything manually.
Depth of Market (DOM) [LuxAlgo]The Depth Of Market (DOM) tool allows traders to look under the hood of any market, taking price and volume analysis to the next level. The following features are included: DOM, Time & Sales, Volume Profile, Depth of Market, Imbalances, Buying Pressure, and up to 24 key intraday levels (it really packs a punch).
As a disclaimer, this tool does not use tick data, it is a DOM reconstruction from the provided real-time time series data (price and volume). So the volume you see is from filled orders only, this tool does not show unfilled limit orders.
Traders can enable or disable any of the features at will to avoid being overwhelmed with too much information and to make the tool perform faster.
The features that have the biggest impact on performance are Historical Data Collection, Key Levels (POC & VWAP), Time & Sales, Profile, and Imbalances. Disable these features to improve the indicator computational performance.
🔶 DOM
This is the simplest form of the tool, a simple DOM or ladder that displays the following columns:
PRICE: Price level
BID: Total number of market sell orders filled or limit buy orders filled.
SELL: Sell market orders
BUY: Buy market orders
ASK: Total number of market buy orders filled or limit sell orders filled.
The DOM only collects historical data from the last 24 hours and real-time data.
Traders can select a reset period for the DOM with two options:
DAILY: Resets at the beginning of each trading day
SESSIONS: Resets twice, as DAILY and 15.5 hours later, to coincide with the start of the RTH session for US tickers.
The DOM has two main modes, it can display price levels as ticks or points. The default is automatic based on the current daily volatility, but traders can manually force one mode or the other if they wish.
For convenience, traders have the option to set the number of lines (price levels), and the size of the text and to display only real-time data.
By default, the top price is set to 0 so that the DOM automatically adjusts the price levels to be displayed, but traders can set the top price manually so that the tool displays only the desired price levels in a fixed manner.
🔹 Volume Profile
As additional features to the basic DOM, traders have access to the volume profile histogram and the total volume per price level.
This helps traders identify at a glance key price areas where volume is accumulating (high volume nodes) or areas where volume is lacking (low volume nodes) - these areas are important to some traders who base their decision-making process on them.
🔹 Imbalances
Other added features are imbalances and buying pressure:
Interlevel Imbalance: volume delta between two different price levels
Intralevel Imbalance: delta between buy and sell volume at the same price level
Buying Pressure Percent: percentage of buy volume compared to total volume
Imbalances can help traders identify areas of interest in the price for possible support or resistance.
🔹 Depth
Depth allows traders to see at a glance how much supply is above the current price level or how much demand is below the current price level.
Above the current price level shows the cumulative ask volume (filled sell limit orders) and below the current price level shows the cumulative bid volume (filled buy limit orders).
🔶 KEY LEVELS
The tool includes up to 24 different key intraday levels of particular relevance:
Previous Week Levels
PWH: Previous week high
PWL: Previous week low
PWM: Previous week middle
PWS: Previous week settlement (close)
Previous Day Levels
PDH: Previous day high
PDL: Previous day low
PDM: Previous day middle
PDS: Previous day settlement (close)
Current Day Levels
OPEN: Open of day (or session)
HOD: High of day (or session)
LOD: Low of day (or session)
MOD: Middle of day (or session)
Opening Range
ORH: Open range high
ORL: Open range low
Initial Balance
IBH: Initial balance high
IBL: Initial balance low
VWAP
+3SD: Volume weighted average price plus 3 standard deviations
+2SD: Volume weighted average price plus 2 standard deviations
+1SD: Volume weighted average price plus 1 standard deviation
VWAP: Volume weighted average price
-1SD: Volume weighted average price minus 1 standard deviation
-2SD: Volume weighted average price minus 2 standard deviations
-3SD: Volume weighted average price minus 3 standard deviations
POC: Point of control
Different traders look at different levels, the key levels shown here are objective and specific areas of interest that traders can act on, providing us with potential areas of support or resistance in the price.
🔶 TIME & SALES
The tool also features a full-time and sales panel with time, price, and size columns, a size filter, and the ability to set the timezone to display time in the trader's local time.
The information shown here is what feeds the DOM and it can be useful in several ways, for example in detecting absorption. If a large number of orders are coming into the market but the price is barely moving, this indicates that there is enough liquidity at these levels to absorb all these orders, so if these orders stop coming into the market, the price may turn around.
🔶 SETTINGS
Period: Select the anchoring period to start data collection, DAILY will anchor at the start of the trading day, and SESSIONS will start as DAILY and 15.5 hours later (RTH for US tickers).
Mode: Select between AUTO and MANUAL modes for displaying TICKS or POINTS, in AUTO mode the tool will automatically select TICKS for tickers with a daily average volatility below 5000 ticks and POINTS for the rest of the tickers.
Rows: Select the number of price levels to display
Text Size: Select the text size
🔹 DOM
DOM: Enable/Disable DOM display
Realtime only: Enable/Disable real-time data only, historical data will be collected if disabled
Top Price: Specify the price to be displayed on the top row, set to 0 to enable dynamic DOM
Max updates: Specify how many times the values on the SELL and BUY columns are accumulated until reset.
Profile/Depth size: Maximum size of the histograms on the PROFILE and DEPTH columns.
Profile: Enable/Disable Profile column. High impact on performance.
Volume: Enable/Disable Volume column. Total volume traded at price level.
Interlevel Imbalance: Enable/Disable Interlevel Imbalance column. Total volume delta between the current price level and the price level above. High impact on performance.
Depth: Enable/Disable Depth, showing the cumulative supply above the current price and the cumulative demand below. Impact on performance.
Intralevel Imbalance: Enable/Disable Intralevel Imbalance column. Delta between total buy volume and total sell volume. High impact on performance.
Buying Pressure Percent: Enable/Disable Buy Percent column. Percentage of total buy volume compared to total volume.
Imbalance Threshold %: Threshold for highlighting imbalances. Set to 90 to highlight the top 10% of interlevel imbalances and the top and bottom 10% of intra-level imbalances.
Crypto volume precision: Specify the number of decimals to display on the volume of crypto assets
🔹 Key Levels
Key Levels: Enable/Disable KEY column. Very high performance impact.
Previous Week: Enable/Disable High, Low, Middle, and Close of the previous trading week.
Previous Day: Enable/Disable High, Low, Middle, and Settlement of the previous trading day.
Current Day/Session: Enable/Disable Open, High, Low and Middle of the current period.
Open Range: Enable/Disable High and Low of the first candle of the period.
Initial Balance: Enable/Disable High and Low of the first hour of the period.
VWAP: Enable/Disable Volume-weighted average price of the period with 1, 2, and 3 standard deviations.
POC: Enable/Disable Point of Control (price level with the highest volume traded) of the period.
🔹 Time & Sales
Time & Sales: Enable/Disable time and sales panel.
Timezone offset (hours): Enter your time zone\'s offset (+ or −), including a decimal fraction if needed.
Order Size: Set order size filter. Orders smaller than the value are not displayed.
🔶 THANKS
Hi, I'm makit0 coder of this tool and proud member of the LuxAlgo Opensource team, it's an honor to be part of the LuxAlgo family doing something I love as it's writing opensource code and sharing it with the world. I'd like to thank all of you who use, comment on, and vote for all of our open-source tools, and all of you who give us your support.
And of course thanks to the PineCoders family for all the work in front of and behind the scenes that makes the PineScript community what it is, simply the best.
Peace, Love & PineScript!
Session-Conditioned Regime ATRWhy this exists
Classic ATR is great—until the open. The first few bars often inherit overnight gaps and 24-hour noise that have nothing to do with the intraday regime you actually trade. That inflates early ATR, scrambles thresholds, and invites hyper-recency bias (“today is crazy!”) when it’s just the open being the open.
This tool was built to:
Separate session reality from 24h noise. Measure volatility only inside your defined session (e.g., NYSE 09:30–16:00 ET).
Judge candles against the current regime, not the last 2–3 bars. A rolling statistic from the last N completed sessions defines what “typical” means right now.
Label “large” and “small” objectively. Bars are colored only when True Range meaningfully departs from the session regime—no gut feel, no open-bar distortion (gap inclusion optional).
Overview
Purpose: objectively identify unusually big or small candles within the active trading session, compared to the recent session regime.
Use cases: volatility filters, entry/exit confirmation, session bias detection, adaptive sizing.
This indicator replaces generic ATR with a session-conditioned, regime-aware measure. It colors candles only when their True Range (TR) is abnormally large/small versus the last N completed sessions of the same session window.
How it works
Session gating: Only bars inside the selected session are evaluated (presets for NYSE, CME RTH, FX NY; custom supported).
Per-bar TR: TR = max(high, prevRef) − min(low, prevRef).
prevRef is the prior close for in-session bars.
First bar of the session can include the overnight gap (optional; default off).
Regime statistic: For any bar in session k, aggregate all in-session TRs from the previous N completed sessions (k−N … k−1), then compute Median (default) or Mean.
Today’s anchor: Running statistic from today’s session start → current bar (for context and the on-chart ratio).
Color logic:
Big if TR ≥ bigMult × RegimeStat
Small if TR ≤ smallMult × RegimeStat
Colored states: big bull, big bear, small bull, small bear.
Non-triggering bars retain the chart’s native colors.
Panel (top-right by default)
Regime ATR (Nd): session-conditioned statistic over the past N completed sessions.
Today ATR (anchored): running statistic for the current session.
Ratio (Today/Regime): intraday volatility vs regime.
Sample size n: number of bars used in the regime calculation.
Inputs
Session Preset: NYSE (09:30–16:00 ET), CME RTH (08:30–15:00 CT), FX NY (08:00–17:00 ET), Custom (session + IANA timezone).
Regime Window: number of completed sessions (default 5).
Statistic: Median (robust) or Mean.
Include Open Gap: include overnight gap in the first in-session bar’s TR (default off).
Big/Small thresholds: multipliers relative to RegimeStat (defaults: Big=1.5×, Small=0.67×).
Colors: four independent colors for big/small × bull/bear.
Panel position & text size.
Hidden outputs: expose RegimeStat, TodayStat, Ratio, and Z-score to other scripts.
Alerts
RegimeATR: BIG bar — triggers when a bar meets the “Big” condition.
RegimeATR: SMALL bar — triggers when a bar meets the “Small” condition.
Hidden outputs (for strategies/screeners)
RegimeATR_stat, TodayATR_stat, Today_vs_Regime_Ratio, BarTR_Zscore.
Notes & limitations
No look-ahead: calculations only use information available up to that bar. Historical colors reflect what would have been known then.
Warm-up: colors begin once there are at least N completed sessions; before that, regime is undefined by design.
Changing inputs (session window, multipliers, median/mean, gap toggle) recomputes the full series using the same rolling regime logic per bar.
Designed for standard candles. Styling respects existing chart colors when no condition triggers.
Practical tips
For a broader or tighter notion of “unusual,” adjust Big/Small multipliers.
Prefer Median in markets prone to outliers; use Mean if you want Z-score alignment with the panel’s regime mean/std.
Use the Ratio readout to spot compression/expansion days quickly (e.g., <0.7× = compressed session, >1.3× = expanded).
Roadmap
More session presets:
24h continuous (crypto, index CFDs).
23h/Globex futures (CME ETH with a 60-minute maintenance break).
Regional equities (LSE, Xetra, TSE), Asia/Europe/NY overlaps for FX.
Half-day/holiday templates and dynamic calendars.
Multi-regime comparison: track multiple overlapping regimes (e.g., RTH vs ETH for futures) and show separate stats/ratios.
Robust stats options: trimmed mean, MAD/Huber alternatives; optional percentile thresholds instead of fixed multipliers.
Subpanel visuals: rolling TodayATR and Ratio plots; optional Z-score ribbon.
Screener/strategy hooks: export boolean series for BIG/SMALL, plus a lightweight strategy template for backtesting entries/exits conditioned on regime volatility.
Performance/QOL: per-symbol presets, smarter warm-up, and finer control over sample caps for ultra-low TF charts.
Changelog
v0.9b (Beta)
Session presets (NYSE/CME RTH/FX NY/Custom) with timezone handling.
Panel enhancements: ratio + sample size n.
Four-state bar coloring (big/small × bull/bear).
Alerts for BIG/SMALL bars.
Hidden Z-score stream for downstream use.
Gap-in-TR toggle for the first in-session bar.
Disclaimer
For educational purposes only. Not investment advice. Validate thresholds and session settings across symbols/timeframes before live use.
Transformer Flux DashboardHere’s a practical guide to what your Transformer Flux Dashboard does and how to use it.
What it is
A compact, two-column trading dashboard + signal pack that blends trend, MACD, and OBV into one view (“Flux Score”) and adds session awareness (pre-sessions and main sessions in Eastern time). It’s designed for regular candles by default and avoids repaint by letting you confirm on bar close.
Core pieces it calculates
Moving Averages
Two MAs: Fast (HMA/EMA) and Slow (HMA/EMA).
You choose length, line width, color, and transparency.
Trend engine (Strict/Lenient)
Uses the relation between Fast/Slow MA and a debounced fast-MA slope filter (slope > ATR×buffer).
Strict: requires fast>slow and slow rising (or the inverse for down).
Lenient: fast>slow or slow rising (or the inverse).
A confirmation window (bars) must hold true before trend flips. That window can be auto-tuned by session (Asia/London/NY) or set globally.
OBV confirmation (optional)
OBV smoothed by SMA; needs to be rising/falling for N bars (also session-aware if you enable presets).
MACD
Standard MACD Fast/Slow/Signal; the dashboard shows Bull ▲, Bear ▼ or Flat based on line vs signal.
Flux Score (top row)
A composite, smoothed gauge from 0–100:
40% Trend, 30% MACD, 30% OBV → EMA(3) smoothed.
Labels: Bullish ≥ 70, Bearish ≤ 30, otherwise Neutral.
Summary line explains why (e.g., “MACD↑, OBV↑, Trend up”).
Sessions & zones (Eastern/NY time)
Recognizes Asia / London / New York main sessions and pre-sessions using your chart’s Eastern time.
Session label (top of chart): text is white; background auto-matches the current session color (or your manual color).
Zone backgrounds (optional): off by default; when on, default transparency ≈ 95% (very light), with separate colors for each session and pre-session. A toggle lets you draw pre-session on top or beneath main sessions.
Signals & markers
Two strength tiers: Strong (Trend + OBV + MACD aligned) and Weak (2 of the 3 agree).
To reduce clutter, markers only appear on direction shifts (from last visible direction to a new one), and you can enforce a minimum bar gap.
Marker style:
Default Icons with LabelUp/LabelDown (tiny).
Colors: strong long = bright white by default; others configurable.
Weak markers are slightly offset from price using ATR so they don’t overlap wicks.
Dashboard (2-column)
Left column = label, right column = value:
Flux Score: numeric + Bullish/Neutral/Bearish tag.
Summary: short reason of the score.
Trend: UP / DOWN / FLAT (cell tinted green/red/gray).
MACD: Bull ▲ / Bear ▼ / Flat (tinted).
Signal: last printed signal + bar age (fresh signals get a lighter tint).
MA: slow MA type/length and up/down arrow.
Sess: current session label (e.g., “Pre-London”, “New York”).
VIX / VXN (optional): shows current value.
Auto tint: based on calm/watch/elevated thresholds (you control levels and colors).
Manual tint: fixed BG color if you prefer consistency.
Params: “P”=trend bars, “O”=OBV bars, mode (Strict/Lenient), and “Candles”.
You can set a global Default Transparency for the dashboard cells.
Key settings to know
Confirm On Close: when on (default), trend/OBV/MACD states use the last confirmed bar; this avoids mid-bar flicker and reduces repaint risk.
Session presets: when enabled, the number of bars required for confirmations tightens/loosens per session (e.g., Asia uses more bars than NY).
Colors & Opacity:
MA lines have their own transparency (default 0 = fully opaque).
Dashboard cells use a single global transparency (default 40%).
Session zones default to very light (95%) and are off by default.
VIX/VXN cells can auto-color by regime or use a manual background.
Markers:
“Icons” vs “Ticks.” Default is Icons with tiny labels up/down.
“Shift only” display reduces noise; you can also set min bar spacing.
How to read it (quick workflow)
Flux Score row: a fast “risk-on/off” gauge.
≥70 with green Trend/MACD cells → higher-conviction long context.
≤30 with red Trend/MACD cells → higher-conviction short context.
Summary explains why the score is what it is.
Signal row: tells you the last official signal and how many bars ago it fired. Fresh signals tint lighter.
MA row: aligns your slow baseline; arrow helps spot slow-turns early.
Sess row + label: know which market is active; behavior and your confirmation bars adapt by session if presets are on.
VIX/VXN (if enabled): extra context for risk regime (values and color band).
Good practices & caveats
It’s confirmation-based to reduce false flips; you’ll get signals slightly later, by design.
All signals are informational; there’s no position management or stops in this build (we removed the stop visuals by request).
If you switch to exotic chart types or extreme resolutions, re-tune lengths and confirmation bars (and potentially disable session presets).
For scalping, consider reducing confirmation bars and OBV smoothing; for higher timeframes, increase them.
Quick customization ideas
Want faster flips? Lower confirmBars and obvBars, increase slope buffer a bit to retain quality.
Want fewer weak signals? Show only strong markers (toggle off weak via colors/visibility or increase min bar gap).
Prefer EMA stacking? Set both Fast/Slow to EMA.
Don’t care about OBV? Turn OBV confirm off; Trend + MACD will drive






















