Adaptive Trend Envelope [BackQuant]Adaptive Trend Envelope
Overview
Adaptive Trend Envelope is a volatility-aware trend-following overlay designed to stay responsive in fast markets while remaining stable during slower conditions. It builds a dynamic trend spine from two exponential moving averages and surrounds it with an adaptive envelope whose width expands and contracts based on realized return volatility. The result is a clean, self-adjusting trend structure that reacts to market conditions instead of relying on fixed parameters.
This indicator is built to answer three core questions directly on the chart:
Is the market trending or neutral?
If trending, in which direction is the dominant pressure?
Where is the dynamic trend boundary that price should respect?
Core trend spine
At the heart of the indicator is a blended trend spine:
A fast EMA captures short-term responsiveness.
A slow EMA captures structural direction.
A volatility-based blend weight dynamically shifts influence between the two.
When short-term volatility is low relative to long-term volatility, the fast EMA has more influence, keeping the trend responsive. When volatility rises, the blend shifts toward the slow EMA, reducing noise and preventing overreaction. This blended output is then smoothed again to form the final trend spine, which acts as the structural backbone of the system.
Volatility-adaptive envelope
The envelope surrounding the trend spine is not based on ATR or fixed percentages. Instead, it is derived from:
Log returns of price.
An exponentially weighted variance estimate.
A configurable multiplier that scales envelope width.
This creates bands that automatically widen during volatile expansions and tighten during compression. The envelope therefore reflects the true statistical behavior of price rather than an arbitrary distance.
Inner hysteresis band
Inside the main envelope, an inner band is constructed using a hysteresis fraction. This inner zone is used to stabilize regime transitions:
It prevents rapid flipping between bullish and bearish states.
It allows trends to persist unless price meaningfully invalidates them.
It reduces whipsaws in sideways conditions.
Trend regime logic
The indicator operates with three regime states:
Bullish
Bearish
Neutral
Regime changes are confirmed using a configurable number of bars outside the adaptive envelope:
A bullish regime is confirmed when price closes above the upper envelope for the required number of bars.
A bearish regime is confirmed when price closes below the lower envelope for the required number of bars.
A trend exits back to neutral when price reverts through the trend spine.
This structure ensures that trends are confirmed by sustained pressure rather than single-bar spikes.
Active trend line
Once a regime is active, the indicator plots a single dominant trend line:
In a bullish regime, the lower envelope becomes the active trend support.
In a bearish regime, the upper envelope becomes the active trend resistance.
In neutral conditions, price itself is used as a placeholder.
This creates a simple, actionable visual reference for trend-following decisions.
Directional energy visualization
The indicator uses layered fills to visualize directional pressure:
Bullish energy fills appear when price holds above the active trend line.
Bearish energy fills appear when price holds below the active trend line.
Opacity gradients communicate strength and persistence rather than binary states.
A subtle “rim” effect is added using ATR-based offsets to give depth and reinforce the active side of the trend without cluttering the chart.
Signals and trend starts
Discrete signals are generated only when a new trend regime begins:
Buy signals appear at the first confirmed transition into a bullish regime.
Sell signals appear at the first confirmed transition into a bearish regime.
Signals are intentionally sparse. They are designed to mark regime shifts, not every pullback or continuation, making them suitable for higher-quality trend entries rather than frequent trading.
Candle coloring
Optional candle coloring reinforces regime context:
Bullish regimes tint candles toward the bullish color.
Bearish regimes tint candles toward the bearish color.
Neutral states remain visually muted.
This allows the chart to communicate trend state even when the envelope itself is partially hidden or de-emphasized.
Alerts
Built-in alerts are provided for key trend events:
Bull trend start.
Bear trend start.
Transition from trend to neutral.
Price crossing the trend spine.
These alerts support hands-off trend monitoring across multiple instruments and timeframes.
How to use it for trend following
Trend identification
Only trade in the direction of the active regime.
Ignore counter-trend signals during confirmed trends.
Entry alignment
Use the first regime signal as a structural entry.
Use pullbacks toward the active trend line as continuation opportunities.
Trend management
As long as price respects the active envelope boundary, the trend remains valid.
A move back through the spine signals loss of trend structure.
Market filtering
Periods where the indicator remains neutral highlight non-trending environments.
This helps avoid forcing trades during chop or compression.
Adaptive Trend Envelope is designed to behave like a living trend structure. Instead of forcing price into static rules, it adapts to volatility, confirms direction through sustained pressure, and presents trend information in a clean, readable form that supports disciplined trend-following workflows.
ความผันผวน
Percentile-Based BB% Trend - MattesOverview
The Percentile-Based BB% Trend is a robust momentum oscillator that reimagines the classic Bollinger %B indicator using percentile-based bands and median absolute deviation (MAD). Instead of relying on a simple moving average and standard deviation (which can be heavily influenced by outliers), this version builds dynamic bands from the 25th and 75th percentiles of price, creating a noise-resistant framework for measuring where the current price sits relative to its recent distribution.
How It’s Calculated
Percentile Smoothing : 25th percentile (lower boundary) and 75th percentile (upper boundary) of the selected source.
Basis Line : Midpoint between the 25th and 75th percentiles as a robust central measure.
Robust Volatility : Median Absolute Deviation (MAD) multiplied by a user-defined factor to set band width.
PBB% Value : (Price - Lower Band) / (Band Width), then shifted so the midline is at 0.
Trend Line : Light EMA smoothing applied to the raw value and displayed as colored columns.
How It Differs From Traditional %B
Uses 25th/75th percentiles + MAD instead of SMA + standard deviation → far less sensitive to outliers.
More adaptive to real-world skewed price distributions.
Stronger noise filtering while staying responsive to genuine momentum.
Why It’s Useful
Reduced false signals in choppy or spiky markets
Clear view of momentum strength and price extension
Persistent readings above/below 0 indicate sustained bullish/bearish control
Excellent as a trend-strength filter across all asset classes and timeframes
Application Examples
Trend Confirmation – Midline (0) crossovers confirm direction when paired with trend-following tools.
Overextension Warnings – Extreme readings signal potential exhaustion.
Momentum Filtering – Avoid entries when oscillator shows weak or overstretched conditions.
Divergence Hunting – Spot price making new highs/lows while oscillator fails to confirm.
Great inventions require greate care!
Not a Standalone Strategy: This indicator is designed as a complementary tool and should always be combined with other forms of analysis (price action, volume, higher-timeframe trend, or additional indicators).Potential Lags in Explosive Moves: The robust calculations and smoothing can slightly delay signals during very strong trends.Parameter Sensitivity: Optimal length and multiplier vary by market and timeframe — backtesting is essential.No indicator guarantees profits; past performance is not indicative of future results.
This indicator builds directly on the foundation of the Percentile-Based Bollinger Bands - Mattes, extending its robust methodology into oscillator form for deeper momentum analysis.Shoutout to all my Masterclass Brothers and L4 Gs!
Volatility Regimes | GainzAlgo📊 OVERVIEW:
=========
This is a comprehensive ATR-based trading system designed for professional
traders who need advanced volatility analysis, precise trade management, and
intelligent market regime detection. The indicator combines multiple proven
volatility concepts into one powerful, customizable tool.
⭐ WHY THIS SYSTEM IS UNIQUE AND WORTHY OF PUBLICATION:
====================================================
This is not simply a collection of ATR-based indicators placed together.
It represents a unified volatility analysis framework where each component
is specifically designed to work in concert with the others, creating a
complete trading workflow that cannot be replicated by using multiple
separate indicators.
🔗 SYNERGISTIC INTEGRATION - How Components Work Together:
🧠 1. CONTEXT-AWARE ANALYSIS
The Volatility Regime Detection acts as the "brain" of the system,
classifying market conditions into 4 distinct phases. Every other
component then adapts its behavior based on this regime classification:
- ATR Bands expand/contract with regime changes
- Stop Loss distances automatically adjust (tighter in compression,
wider in high volatility)
- Take Profit targets scale proportionally to current regime
- Signal sensitivity filters itself based on market phase
📐 2. UNIFIED VOLATILITY FOUNDATION
All calculations share a single ATR baseline calculation, ensuring
internal consistency across the entire system. When ATR changes, every
element updates in perfect synchronization:
- Bands recalculate from the same ATR value
- Risk management levels use the same volatility measurement
- Regime classification and signals reference identical data
🛡️ 3. INTEGRATED RISK MANAGEMENT
The system doesn't just show WHERE to enter - it calculates HOW MUCH
to risk:
- Dynamic Stop Loss adapts to current ATR automatically
- Position Size Calculator uses the dynamic stop to compute exact quantities
- Take Profit levels scale proportionally, maintaining optimal risk:reward
✅ 4. TWO-STAGE SIGNAL CONFIRMATION
The alert system creates a logical progression:
Step 1: Volatility Breakout → Market energy is building
Step 2: Trend Confirmation → Direction confirmed with volatility support
This prevents false breakouts by requiring both volatility AND direction.
🏦 5. PROFESSIONAL WORKFLOW INTEGRATION
The system mirrors how institutional traders analyze markets:
Phase 1: Assess regime → What's the market doing?
Phase 2: Identify setup → Where's the opportunity?
Phase 3: Calculate risk → What's my exposure?
Phase 4: Set targets → Where do I take profit?
Phase 5: Monitor regime → When do conditions change?
❌ WHY NOT USE SEPARATE INDICATORS?
- Separate ATR Bands: Don't know about regime changes, remain static
- Separate Regime Indicator: Doesn't automatically adjust stop/targets
- Separate Position Calculator: Doesn't know your actual ATR-based stop
- Manual Integration: Requires constant mental calculation and cross-referencing
🧮 DETAILED CALCULATION METHODOLOGY:
=================================
📏 ATR (AVERAGE TRUE RANGE) CALCULATION:
- True Range = Maximum of:
1. Current High - Current Low
2. Absolute value of (Current High - Previous Close)
3. Absolute value of (Current Low - Previous Close)
- ATR = Simple Moving Average of True Range over specified period (default: 14)
📊 DYNAMIC ATR BANDS:
- Upper Band = Current Close + (ATR × Band Multiplier)
- Lower Band = Current Close - (ATR × Band Multiplier)
- Band 1: 1.0× ATR (closest support/resistance)
- Band 2: 2.0× ATR (intermediate zone)
- Band 3: 3.0× ATR (extended zone)
🌡️ VOLATILITY REGIME CLASSIFICATION:
Step 1: Calculate ATR Baseline
- Baseline ATR = SMA or EMA of ATR over long period (default: 50 bars)
- This represents "normal" volatility for the instrument
Step 2: Calculate ATR Ratio
- ATR Ratio = Current ATR ÷ Baseline ATR
- Example: If current ATR = 70 and baseline = 50, ratio = 1.40
Step 3: Classify Regime Based on Ratio
- COMPRESSION: Ratio < 0.70 (ATR is 30% below normal)
Market consolidating, volatility contracting, energy building
- EXPANSION: Ratio between 1.15 and 1.40 (ATR is 15-40% above normal)
Volatility breaking out, early phase of directional movement
- HIGH VOLATILITY: Ratio > 1.40 (ATR is 40%+ above normal)
Strong sustained trend with high participation
- EXHAUSTION: ATR declining after high volatility period
Requires: Previous high ratio + declining ATR over X bars (default: 5)
Trend maturity, potential reversal or consolidation approaching
🛑 DYNAMIC STOP LOSS CALCULATION:
- For Long Positions: Stop Loss = Entry Price - (ATR × SL Multiplier)
- For Short Positions: Stop Loss = Entry Price + (ATR × SL Multiplier)
- Default Multiplier: 2.0× ATR
- Adjusts automatically: Wider in high volatility, tighter in compression
🎯 TAKE PROFIT LEVELS:
- TP1 = Entry Price ± (ATR × TP1 Multiplier)
- TP2 = Entry Price ± (ATR × TP2 Multiplier)
- TP3 = Entry Price ± (ATR × TP3 Multiplier)
- Direction (+ or -) depends on trade direction
📦 POSITION SIZE CALCULATION:
Formula: Position Size = Account Risk Amount ÷ Stop Loss Distance
Step-by-step:
1. Risk Amount = Account Size × (Risk Percentage ÷ 100)
2. Stop Distance = |Entry Price - Stop Loss Price|
3. Position Size = Risk Amount ÷ Stop Distance
📈 ATR PERCENTILE RANKING:
- >80% = Extremely high volatility
- 20-80% = Normal volatility range
- <20% = Extremely low volatility
🌀 VOLATILITY CONTRACTION PATTERN:
Detects extended low-volatility periods indicating imminent breakout.
🧭 TREND DETECTION SIGNALS:
Bullish: Price > MA AND Current ATR > ATR MA
Bearish: Price < MA AND Current ATR > ATR MA
⚡ VOLATILITY BREAKOUT SIGNALS:
Triggered when ATR exceeds its moving average by a defined threshold.
🧩 CORE FEATURES:
==============
1. ATR BANDS (Dynamic Support/Resistance)
2. VOLATILITY REGIME DETECTION
3. DYNAMIC STOP LOSS SYSTEM
4. MULTIPLE TAKE PROFIT LEVELS
5. SUPPORT & RESISTANCE LEVELS
6. RISK MANAGEMENT CALCULATOR
7. ATR PERCENTILE RANKING
8. VOLATILITY CONTRACTION PATTERN
9. TREND DETECTION SIGNALS
10. VOLATILITY BREAKOUT SIGNALS
⚙️ RECOMMENDED SETTINGS BY TRADING STYLE:
======================================
DAY TRADING • SWING TRADING • POSITION TRADING • SCALPING
📘 HOW TO USE THIS INDICATOR:
==========================
STEP 1: Identify Market Regime
STEP 2: Wait for Entry Signal
STEP 3: Set Stop Loss
STEP 4: Set Take Profits
STEP 5: Position Sizing
STEP 6: Monitor & Manage
🔔 ALERT SYSTEM:
=============
Alerts for volatility breakouts, trend changes, regime transitions,
ATR band crossings, contraction completion, and percentile extremes.
🎨 CUSTOMIZATION:
==============
All visuals, thresholds, multipliers, colors, alerts, and risk parameters
can be fully customized.
⚠️ IMPORTANT DISCLAIMER:
=====================
This indicator is a volatility analysis tool and does NOT provide financial advice.
Past performance does not guarantee future results.
All trading involves substantial risk.
All trading decisions are the sole responsibility of the user.
Cosmic Volume Analyzer [JOAT]
Cosmic Volume Analyzer - Astrophysics Edition
Overview
Cosmic Volume Analyzer is an open-source oscillator indicator that applies astrophysics-inspired concepts to volume analysis. It classifies volume into buy/sell categories, calculates volume flow, detects accumulation/distribution phases, identifies climax volume events, and uses gravitational and stellar mass analogies to visualize volume dynamics.
What This Indicator Does
The indicator calculates and displays:
Volume Classification - Categorizes each bar as CLIMAX_BUY, CLIMAX_SELL, HIGH_BUY, HIGH_SELL, NORMAL_BUY, or NORMAL_SELL
Volume Flow - Percentage showing buy vs sell pressure over a lookback period
Buy/Sell Volume - Separated volume based on candle direction
Accumulation/Distribution - Phase detection using Money Flow Multiplier
Volume Oscillator - Fast vs slow volume EMA comparison
Gravitational Pull - Volume-weighted price attraction metric
Stellar Mass Index - Volume ratio combined with price momentum
Black Hole Detection - Identifies extremely low volume periods (liquidity voids)
Supernova Events - Detects extreme volume with extreme price movement
Orbital Cycles - Sine-wave based cyclical visualization
How It Works
Volume classification uses volume ratio and candle direction:
classifyVolume(series float vol, series float close, series float open) =>
float avgVol = ta.sma(vol, 20)
float volRatio = avgVol > 0 ? vol / avgVol : 1.0
if volRatio > 1.5
if close > open
classification := "CLIMAX_BUY"
else
classification := "CLIMAX_SELL"
else if volRatio > 1.2
// HIGH_BUY or HIGH_SELL
else
// NORMAL_BUY or NORMAL_SELL
Volume flow separates buy and sell volume over a period:
calculateVolumeFlow(series float vol, series float close, simple int period) =>
float currentBuyVol = close > open ? vol : 0.0
float currentSellVol = close < open ? vol : 0.0
// Accumulate in buffers
float flow = (buyVolume - sellVolume) / totalVol * 100
Accumulation/Distribution uses the Money Flow Multiplier:
float mfm = ((close - low) - (high - close)) / (high - low)
float mfv = mfm * vol
float adLine = ta.cum(mfv)
if adLine > adEMA and ta.rising(adLine, 3)
phase := "ACCUMULATION"
else if adLine < adEMA and ta.falling(adLine, 3)
phase := "DISTRIBUTION"
Gravitational pull uses volume-weighted price distance:
gravitationalPull(series float vol, series float price, simple int period) =>
float massCenter = ta.vwma(price, period)
float distance = math.abs(price - massCenter)
float mass = vol / ta.sma(vol, period)
float gravity = distance > 0 ? mass / (distance * distance) : 0.0
Signal Generation
Signals are generated based on volume conditions:
Buy Climax: Volume exceeds 2 standard deviations above average on bullish candle
Sell Climax: Volume exceeds 2 standard deviations above average on bearish candle
Strong Buy Flow: Volume flow exceeds positive threshold (default 45%)
Strong Sell Flow: Volume flow exceeds negative threshold (default -45%)
Supernova: Volume 3x average AND price change 3x average
Black Hole: Volume 2 standard deviations below average
Dashboard Panel (Top-Right)
Volume Class - Current volume classification
Volume Flow - Buy/sell flow percentage
Buy Volume - Accumulated buy volume
Sell Volume - Accumulated sell volume
A/D Phase - ACCUMULATION/DISTRIBUTION/NEUTRAL
Volume Strength - Normalized volume strength
Gravity Pull - Current gravitational metric
Stellar Mass - Current stellar mass index
Cosmic Field - Combined cosmic field strength
Black Hole - Detection status and void strength
Signal - Current actionable status
Visual Elements
Volume Ratio Columns - Colored bars showing normalized volume
Volume Flow Line - Main oscillator showing flow direction
Flow EMA - Smoothed flow for trend reference
Volume Oscillator - Area plot showing fast/slow comparison
Gravity Field - Area plot showing gravitational pull
Orbital Cycle - Circle plots showing cyclical pattern
Stellar Mass Line - Line showing mass index
Climax Markers - Fire emoji for buy climax, snowflake for sell climax
Supernova Markers - Diamond shapes for extreme events
Black Hole Markers - X-cross for liquidity voids
A/D Phase Background - Subtle background color based on phase
Input Parameters
Volume Period (default: 20) - Period for volume calculations
Distribution Levels (default: 5) - Granularity of distribution analysis
Flow Threshold (default: 1.5) - Multiplier for flow significance
Accumulation Period (default: 14) - Period for A/D calculation
Gravitational Analysis (default: true) - Enable gravity metrics
Black Hole Detection (default: true) - Enable void detection
Stellar Mass Calculation (default: true) - Enable mass index
Orbital Cycles (default: true) - Enable cyclical visualization
Supernova Detection (default: true) - Enable extreme event detection
Suggested Use Cases
Identify accumulation phases for potential long entries
Watch for distribution phases as potential exit signals
Use climax volume as potential exhaustion indicators
Monitor volume flow for directional bias
Avoid trading during black hole (low liquidity) periods
Watch for supernova events as potential trend acceleration
Timeframe Recommendations
Best on 15m to Daily charts. Volume analysis requires sufficient trading activity for meaningful readings.
Limitations
Volume data quality varies by exchange and instrument
Buy/sell separation is based on candle direction, not actual order flow
Astrophysics concepts are analogies, not literal physics
A/D phase detection may lag during rapid transitions
Open-Source and Disclaimer
This script is published as open-source under the Mozilla Public License 2.0 for educational purposes. It does not constitute financial advice. Past performance does not guarantee future results. Always use proper risk management.
- Made with passion by officialjackofalltrades
Supertrend BUY Only - Optimized for Gold M15 TimeframeOverview
The Supertrend BUY Only - Production Optimized is a high-performance trend-following indicator specifically tuned for XAUUSD (Gold) on the 15-minute timeframe. Unlike standard Supertrend scripts, this version focuses exclusively on bullish cycles to align with long-term upward bias and uses parameters discovered through deep data analysis of over 20,000 bars of historical market data.
Key Features
Data-Optimized Parameters: Defaults are set to ATR Period 7 and Multiplier 2.1, which backtesting has shown to provide a superior balance between sensitivity and noise reduction for Gold.
Production-Ready Alerts: Includes built-in alertcondition triggers for both BUY (Trend Flip) and STOP BUY (Trend Exit), complete with dynamic messages that include price and interval.
Trailing Support Band: Uses a trailing logic that locks in support levels during upward moves, preventing the band from dropping until the trend officially reverses.
Clean Visuals: Focuses on chart clarity by only plotting the support line during active uptrends and utilizing clean shape labels for entries and exits.
How to Use
Entry (BUY): When the Supertrend line flips from Red to Green and a "BUY" label appears. This indicates bullish momentum has overcome recent volatility.
Exit (STOP BUY): When the price closes below the Green support line. The indicator will plot a red "X" and clear the green background.
Setting Alerts: * Click the Alerts icon in TradingView.
Select this indicator under "Condition."
Choose "BUY Signal" for entries and "STOP BUY / EXIT" for managing your trade or taking profit.
Technical Details
The script allows users to toggle between the TradingView (RMA) ATR calculation and the Standard (SMA) method. For production and live trading, the RMA method is recommended as it provides a smoother response to volatility spikes common in the Gold market.
Asian and London Session High-Low (Auto UK DST) + PDH/PDLThis indicator automatically plots Asian session (7:00am–2:00pm MYT) and London session high/low using Malaysian time, with London adjusting automatically for UK Daylight Saving Time (4:00pm–9:00pm MYT in winter, 3:00pm–8:00pm MYT during DST).
It also shows Previous Day High/Low (PDH/PDL) and a 7:00am MYT daily reset line, while No-Trade zones are available but turned OFF by default and can be enabled when needed.
ORB W/ Custom time FramesRelease Notes: Simplified ORB (Opening Range Breakout)
This indicator is a streamlined, high-performance tool designed to identify the Opening Range—one of the most widely used concepts by professional floor traders and institutional scalpers. It marks the high, low, and midpoint of the initial balance of the market, providing you with a "map" for the rest of the trading session.
Key Features
Customizable Timeframes: Define your opening range window (e.g., the first 5, 15, or 30 minutes) regardless of what timeframe you are currently viewing.
Custom Session Support: Choose between standard market hours (09:30–16:00) or define your own custom window (e.g., the London Open or the first hour of "Power Hour").
Real-Time Midpoint Calculation: Automatically plots the 50% Equilibrium level between the high and low, serving as a pivot point for intraday bias.
Dynamic Updating: During the ORB window, the lines adjust in real-time as new highs or lows are set. Once the window expires, the levels lock in place to act as support and resistance.
Clean Visuals: Utilizes a lightweight line drawing system that is easy on your GPU and keeps the chart clutter-free.
Why This is Essential for Scalping
Scalpers rely on volatility and clear "lines in the sand." The Opening Range Breakout (ORB) provides exactly that:
The "Opening Drive": If price breaks the ORB High with high volume, scalpers look for quick "long" momentum plays. Conversely, a break below the ORB Low signals a bearish trend.
The Midpoint Pivot: The 50% level (Mid) is often treated as the "Fair Value" of the morning. If price is above the mid, the bias is bullish; if below, the bias is bearish.
Stop Loss / Take Profit Anchor: The ORB High and Low act as natural areas for placing stops or targets. A failed breakout that returns inside the range often targets the opposite side of the box.
Session Anchored OIWAP [Arjo]The Session Anchored OIWAP (Open Interest Weighted Average Price) indicator shows you a weighted average price that uses Open Interest (OI) changes during different trading sessions . It divides the day into four clear sessions: Opening Hour , Morning Session , Mid-Day Session , and Closing Session .
For each session , it calculates a weighted average price using both market price and open interest data from futures . This line updates as the session progresses and resets when a new session starts .
You can also see optional deviation bands that you visually compare to how far the market price is moving away from the session’s weighted average. This indicator also helps you watch how Open Interest changes connect with price movements during specific market hours.
Concepts
This tool works on a few simple ideas:
Session anchoring
Each session starts fresh. The indicator resets and begins a new calculation when a new time block begins. This allows users to visually study each session independently.
Open-interest weighting
Instead of treating all price moves equally, price changes linked to higher open-interest activity have more influence on the OIWAP. This gives a weighted reflection of where the market has been trading during the session.
Averaging and smoothing
The OIWAP line blends many price data points into one smooth curve, making it easier to follow than raw price movement.
Volatility display with bands
The upper and lower bands are placed at ±0.5 standard deviation from the OIWAP line. These bands simply help you see when price stretches further away than usual from the session average.
Features
Four Independent Session Calculations: Shows separate OIWAP lines for Opening Hour (default: 09:15-10:15), Morning (10:15-11:30), Mid-Day (11:30-14:00), and Closing (14:00-15:30) sessions
Open Interest Weighting: Uses absolute OI change as the weight instead of traditional volume
Customizable Session Times: You can change the time ranges for each session to match your market or what you need
Optional Deviation Bands: You can turn ±0.5 standard deviation bands on or off around each OIWAP line
Color-Coded Sessions: Each session has its own color so you can tell them apart easily
Selective Display: You can turn individual sessions and bands on or off
Data Availability Check: Shows you a notification when Open Interest data isn't available for your symbol
Adjustable Position Timeframe: You can calculate OI changes on different timeframes (Chart, Daily, 15min, 30min, 60min, 120min)
How to use
Add this indicator to a chart of any symbol that has Open Interest data ( from futures or derivatives contracts). Once you add it, you'll see colored lines showing the OIWAP for each session you enable, along with optional deviation bands.
Adjusting Settings:
Turn individual sessions on or off using the checkboxes in the " Sessions " section
Change session colors to match your chart or what looks good to you
Turn deviation bands on or off using the " Show Bands " option in the Display settings
Change session time ranges in the " Session Times " section to match your market hours or what you want to analyze
Change the Position Timeframe if you want to see OI changes calculated on a different time period
Visual Interpretation:
Each OIWAP line shows you the OI-weighted average price for that session
The deviation bands show you how much prices spread out, weighted by OI changes
You can watch how price interacts with these levels to see where significant OI activity happened
Different sessions may show different OIWAP levels, showing you how the OI-price relationship changes throughout the trading day
Note:
This indicator needs Open Interest data to work. If OI data isn't available for your symbol, you'll see a message in the center of your chart. This indicator works only with derivatives markets like futures and options in the Indian Market where OI data is publicly available.
Conclusion
The Session Anchored OIWAP indicator is designed to support structured market observation by combining price, open interest, and session anchoring into a clear visual format. It helps users study market behavior during different parts of the day without generating trading instructions or outcomes.
Disclaimer
This indicator is for educational and visual-analysis purposes only. It does not provide trading signals , financial advice, or guaranteed outcomes . You should perform your own research and consult a licensed financial professional when needed. All trading decisions are solely the responsibility of the user.
Happy Trading
RONBO red candle without wick - early BUY signalthis indicator puts an arrow and smiley below the red candle without a wick. This can be a premature BUY signal. Look for the conformation after the arrow and do your research
Hamazaki-Style Scalping SystemOverview: hmzk-Style Scalping System
This system is designed to identify high-probability entries in the 1-minute time frame while strictly filtering out low-efficiency market noise. It focuses on the concept of "Gensen" (Strict Selection)—only trading when volatility and trend alignment provide a clear statistical edge.
1. Visual Filtering (Background Colors)
The system uses background colors to provide instant environmental awareness:
Green Zone (High Probability):
Condition: ATR is above the 1.5-pip threshold and the price is diverging from the Kernel line.
Meaning: High volatility and momentum are present. This is the optimal "War Zone" for scalping.
Gray Zone (Avoidance):
Condition: Price is overlapping with the Kernel line.
Meaning: A "sideways" or "ranging" market. hmzk labels this as the "Death Point" where traders lose money due to spreads and lack of direction.
2. Technical Components
Calix Kernel Regression (h=21, r=34, x_0=55):
Serves as the primary trend filter. When the line is horizontal and price is tangled with it, stay out.
When the line slants and price moves away ("Gator opening"), follow the trend.
ATR Break-Out (1.5 Pips Threshold):
Ensures there is enough "meat" in the move to cover spreads and generate profit.
Fractal Arrows (▲/▼):
Indicates potential turning points or breakout levels. These are most effective when they appear in a Green Zone.
3. Execution & Discipline
The 40-Trade Rule: Limit yourself to roughly 40 high-quality trades per day to avoid overtrading and maintain focus.
0.4-Second Stop Loss: If the price action does not immediately follow your hypothesis, exit within a fraction of a second to minimize "expenses" (losses).
Pattern Over Instinct: Only enter when your predefined "form" or "pattern" appears. hmzk teaches that "waiting is the ultimate skill".
Market Context: Prioritize trades during high-liquidity windows like the London/NY open or specific time transitions (e.g., the 24:00 winter time shift).
Q# ML Logistic Regression Indicator [Lite]
Q TechLabs MLLR Lite — Machine Learning Logistic Regression Trading Indicator
© Q# Tech Labs 2025 Developed by Team Q TechLabs
Overview
Q# MLLR Lite is an open-source, lightweight TradingView indicator implementing a logistic regression model to generate buy/sell signals based on engineered price features. This “lite” version is designed for broad community access and serves as a foundation for the upcoming Pro version with advanced features and integration.
Features
Logistic Regression-based buy/sell signal generation
Customizable price source input (Open, High, Low, Close, HL2, HLC3, OHLC4)
Adjustable signal threshold and smoothing parameters
Signal confidence plotted in a separate pane
Alert conditions for buy and sell signals
Fully documented, clean Pine Script (v6) code for easy customization
Installation
Open TradingView and navigate to the Pine Script editor
Create a new script and paste the full content of the Q# MLLR Lite Pine Script
Save and add to chart
Configure inputs as needed for your trading style
Licensing
Q# MLLR Lite is provided under the MIT License, promoting open use, modification, and community collaboration with attributi
Q# MLLR Lite — Machine Learning Logistic Regression Trading Indicator
© Q# Tech Labs 2025 — Developed by Team Q#
Overview
Q# MLLR Lite is an open-source, lightweight TradingView indicator implementing a logistic regression model to generate buy/sell signals based on engineered price features. This “lite” version is designed for broad community access and serves as a foundation for the upcoming Pro version with advanced features and integration.
Features
Logistic Regression-based buy/sell signal generation
Customizable price source input (Open, High, Low, Close, HL2, HLC3, OHLC4)
Adjustable signal threshold and smoothing parameters
Signal confidence plotted in a separate pane
Alert conditions for buy and sell signals
Fully documented, clean Pine Script (v6) code for easy customization
Installation
Open TradingView and navigate to the Pine Script editor
Create a new script and paste the full content of the Q# MLLR Lite Pine Script
Save and add to chart
Configure inputs as needed for your trading style
Licensing
Q# MLLR Lite is provided under the MIT License, promoting open use, modification, and community collaboration with attribution.
Copyright (c) 2025 Q# Tech Labs
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
VWAP Institutional Trading Engine INDICATORVWAP Institutional Trading Engine
Adaptive Market Regime & Trading Model Indicator
🔍 Overview
The VWAP Institutional Trading Engine is an advanced, rule-based market analysis indicator designed to replicate institutional decision-making logic using VWAP, volatility, and session-based market behavior.
This indicator does not predict price.
Instead, it answers a more important question:
“What type of trading is appropriate right now – if any?”
The engine continuously evaluates:
Market regime (trend, range, dead market)
Volatility conditions
VWAP acceptance and deviation
Trading session (Asia / London / New York)
Based on this, it dynamically activates one of three trading models:
TREND
MEAN REVERSION
OFF (no trading)
This makes it ideal for:
Discretionary traders
Systematic traders
Risk-focused trading
Educational / portfolio-style trading approaches
🧠 Core Philosophy
Professional trading is not about finding more signals.
It is about knowing when not to trade.
This indicator is built around three institutional principles:
VWAP defines fair value
Volatility defines opportunity or danger
Different sessions require different behavior
⚙️ Indicator Components
1️⃣ VWAP & Statistical Deviation Bands
VWAP represents institutional fair price
±1σ bands indicate acceptance zones
±2σ bands represent statistical extremes
Used for:
Mean reversion zones
Trend acceptance confirmation
Go Score calculation
2️⃣ Volatility Engine
Volatility is measured using ATR relative to price
Compared against its own moving average
Classifications:
Low volatility → dead / untradable market
Normal volatility → structured behavior
High volatility → trend or liquidation events
3️⃣ Market Regime Detection
The engine classifies each moment into one regime:
Regime Meaning
TREND Price accepts above or below VWAP with volatility
RANGE Price rotates near VWAP
DEAD Low volatility, no opportunity
MIXED Unclear structure
4️⃣ Active Trading Model (Most Important)
Displayed in the dashboard as Model:
Model Interpretation
TREND Trade with momentum and continuation
MEAN_REVERT Trade extremes back to VWAP
OFF Do not trade
The Model tells you HOW you are allowed to trade right now.
5️⃣ Session Awareness (UTC)
The indicator adapts behavior based on session logic:
Session Preferred Behavior
Asia Mean Reversion
London Trend
New York Selective / adaptive
Trades are only allowed when model + session are aligned.
6️⃣ Go Score – Trade Quality Filter
Each potential setup receives a Go Score (0–100), based on:
Distance from VWAP
Market regime quality
Volatility penalties
Go Score Interpretation
≥ 80 High-quality (A+)
65–79 Acceptable
< 65 No trade
7️⃣ Risk Guidance (Informational)
The indicator outputs a Risk % suggestion, based on:
Go Score
Simulated drawdown logic
⚠️ This is guidance only, not position sizing.
📈 Visual Signals
The indicator plots contextual signals, not blind entries:
Mean Reversion Signals
▲ Long below −2σ
▼ Short above +2σ
Trend Signals
↑ Long after acceptance above +1σ
↓ Short after acceptance below −1σ
Signals appear only when trading is allowed by:
Model
Session
Go Score
🧩 Dashboard Explanation
The top-right dashboard displays real-time engine state:
Field Description
Session Current UTC session
Regime Detected market condition
Go Score Trade quality score
Risk % Suggested relative risk
Drawdown % Virtual defensive metric
Model Active trading model
If Model = OFF → do nothing.
🧭 Practical Trading Manual (Step-by-Step)
Step 1 – Check the Model
TREND → look for continuation
MEAN_REVERT → look for extremes
OFF → do not trade
Step 2 – Confirm Session Alignment
Asia + Mean Reversion ✔
London + Trend ✔
Misalignment = caution
Step 3 – Check Go Score
Below 65 → skip
65+ → proceed
Step 4 – Use Chart Structure
VWAP = anchor
σ bands = context
Signal = permission, not obligation
Step 5 – Manage Risk Manually
Use your own SL/TP rules
Follow the Risk % as guidance, not law
❌ What This Indicator Is NOT
Not a signal spam tool
Not a prediction system
Not a “holy grail”
It is a decision framework.
✅ Best Use Cases
Futures
Indices
Forex
Crypto
Intraday & swing trading
Recommended timeframes:
5m – 1H (intraday)
4H (contextual swing)
🏁 Final Notes
This indicator is intentionally transparent and rule-based.
It is designed to help traders:
Think in regimes
Trade with structure
Avoid overtrading
Protect capital
If you trade with the Model, not against it,
you will already be ahead of most market participants.
TradeQuire==> Key Features:
1. 4 Moving Averages configurable EMA or SMA
2. R Vol -> Relative volume (if value is .1 meaning 10%, (value*100)%)
3. Price vs 52-Week High/Low: Shows how far the current price is from the yearly extremes.
4. Price vs 13-Week High/Low: Shows momentum over the last quarter.
5. U/D Ratio: The "Up/Down Volume Ratio" (Standard 50-day calculation). Readings > 1.0 indicate accumulation.
6. Float %: (Float Shares / Total Shares Outstanding). Note: This requires financial data availability (Stocks only).
7. SMA Deviation: You can set a specific SMA (e.g., 20 or 50) and see how far the price is from it in %.
8. Full Customization: You can choose between a Vertical Table or a Horizontal Headband, change all colors, and position it anywhere.
==> Other Settings :
Dot Size Setting:
Go to settings -> Purple Dot (Big Move) -> Dot Size.
Tiny: Best for a minimal look (default).
Auto: Best if you want the dot to scale proportionally with the bar size when you zoom.
==> Table Position Setting:
Go to settings -> Relative Volume (RVol) -> Table Position.
You can choose any corner (Top Left, Bottom Right, etc.) or Middle positions.
==> Added "Purple Dot" Group:
Logic: It calculates the % change from yesterday's close. It uses math.abs so it triggers on both +5% (Up) and -5% (Down) and configurable.
Volume Check: It strictly checks if current volume is >= 500,000 (or whatever number you type in inputs).
Visual: Plots a small purple circle below the bar when both conditions are met.
ROC+ADX Trend & Momentum System### Code Analysis: ROC+ADX Trend & Momentum System (v5 Pine Script)
#### **Core Function**
This Pine Script indicator integrates **Rate of Change (ROC)** and **Average Directional Index (ADX)** to build a professional trend-momentum trading system, which identifies trend strength, momentum changes, price divergences and generates actionable long/short trading signals for financial markets (stocks, crypto, forex). It features coordinated visual display, adaptive volatility adjustment and a comprehensive scoring mechanism for trend evaluation.
#### **Key Features (Concise)**
1. **Hybrid Indicator Logic**
Combines **ROC (12/6-period, EMA-smoothed)** (measures price momentum) and **ADX (14-period)** (identifies trend strength/direction, with +DI/-DI for trend bias), forming a dual-dimension analysis of trend + momentum.
2. **Adaptive Dynamic Threshold**
Adjusts momentum thresholds in real time based on **14-period ATR volatility**; higher market volatility raises thresholds, lower volatility lowers them, ensuring signal accuracy across different market conditions.
3. **Multi-Category Trading Signals**
Generates 4 core signal types: trend breakout (long/short), momentum boost/drop, trend reversal, and price-ROC bullish/bearish divergence, all filtered by ADX trend validity.
4. **Comprehensive Trend Scoring System**
Calculates a **0-100 trend score** (integrates ADX strength, ROC momentum, direction consistency, momentum persistence) and classifies trend intensity into 5 levels (Extreme/Strong/Medium/Weak/None).
5. **Coordinated Visual Display**
Supports scalable unified display for ROC & ADX values (custom scale factors), with color-coded lines, momentum histograms, heatmap background and reference lines for intuitive trend judgment.
6. **Informative Dashboard & Alerts**
Embeds a top-right info panel showing real values (ROC, ADX, volatility), trend level and active signals; includes multi-tier alert conditions for all key signals (breakout, reversal, divergence).
7. **High Customizability**
Full input configurability for all core parameters (periods, thresholds, scale factors) and visual toggles (show/hide ROC/ADX, signals, heatmap, reference lines).
#### **Technical Highlights**
- Uses EMA smoothing for ROC/ADX to reduce false signals;
- Identifies ROC momentum & acceleration for precise trend phase judgment;
- ADX grading (strong/weak/oscillation) filters invalid signals in sideways markets;
- Color-coded elements (lines, histograms, heatmap) reflect real-time trend/momentum status;
- Non-overlay layout ensures clear separation from price charts, optimized for multi-screen analysis.
VIXO - VIX Oscillator// This Pine Script® code is subject to the terms of the Mozilla Public License 2.0 at mozilla.org
// © emreiletrade
//@version=6
indicator(title="VIXO - VIX Oscillator", shorttitle="VIXO", overlay=false)
// === Inputs ===
rsiLen = input.int(defval=14, title="RSI Length", minval=11, maxval=55)
momLen = input.int(defval=11, title="Momentum Length", minval=9, maxval=21)
normLookback = input.int(defval=100, title="Momentum Normalization Lookback", minval=20, maxval=200)
// === Data (OHLC needed) ===
=
request.security("TVC:VIX", timeframe.period, )
// === RSI Oscillator ===
vixRsi = ta.sma(ta.rsi(vixClose, rsiLen), 5)
// === Momentum (ROC) ===
vixMom = ta.roc(vixClose, momLen)
// === Momentum Normalization (0–100, 50 neutral) ===
momMin = ta.lowest(vixMom, normLookback)
momMax = ta.highest(vixMom, normLookback)
vixMomNorm = ta.sma(100 * (vixMom - momMin) / math.max(momMax - momMin, 1e-6), 3)
// === Helpers ===
vixMa = ta.sma(vixClose, 21)
ratio = vixMa != 0.0 ? (vixClose / vixMa) : 0.0
clampedRatio = math.min(math.max(ratio, 0.0), 1.6)
dynamicTransparency = 100.0 - (clampedRatio * 40.0)
dynamicTransparency := math.min(math.max(dynamicTransparency, 0.0), 100.0)
dynamicTransparency := vixHigh < 30 ? 100 : dynamicTransparency
// === Colors ===
color baseColor = close > close ? color.new(#00FF00, 0)
: close < close ? color.new(#FF0080, 0) : color.gray
color vixBarColor = color.new(baseColor, dynamicTransparency)
color pointColor = color.new(baseColor, dynamicTransparency)
// === Levels ===
hline(80, "Panic of Market", color=color.rgb(0, 255, 0, 40))
hline(60, "VIX says BUY", color=color.rgb(0, 255, 0, 70))
hline(50, "Neutral / Momentum Mid", color=color.new(color.gray, 50))
hline(40, "Get Ready", color=color.new(color.gray, 60))
// === Plots ===
plot(vixRsi, title="VIX RSI", color=color.rgb(0, 255, 255), linewidth=2)
plot(vixMomNorm, title="VIX Normalized Momentum", color=color.new(color.gray, 50), linewidth=1)
plot(vixHigh > 50 ? vixHigh : na, title = "High Points", style = plot.style_cross, color = color.new(pointColor,0))
plot(vixHigh, title="VIX Value Bars", style=plot.style_histogram, color=vixBarColor, linewidth=1)
Valenson Momentum IndicatorThis indicator primarily consists of all the confluences used for momentum swing breakout strategy.
Momentum Color Classification System### Code Analysis: Momentum Color Classification System (Pine Script v5)
#### Core Function
This is a **non-overlay TradingView Pine Script v5 indicator** designed to quantify and categorize price momentum dynamics with extreme precision. It calculates core momentum from price Rate of Change (ROC) and second-derivative momentum change, then classifies market momentum into 9 distinct states (bullish variations, bearish variations, and neutral oscillation). The indicator visualizes momentum via color-coded histogram bars, and provides real-time status labels, a detailed info dashboard, and actionable trading suggestions — all to help traders accurately identify momentum strength, acceleration/deceleration trends, and guide long/short trading decisions.
#### Key Features (Concise & Clear)
1. **9-tier Precise Momentum Classification**
Divides momentum into **4 bullish states** (accelerating/decelerating/steady/weak up), **4 bearish states** (accelerating/decelerating/steady/weak down) and 1 neutral oscillation state, fully covering all momentum trend phases in the market.
2. **2-dimensional Momentum Calculation**
Combines **1st-order momentum** (price ROC-based core momentum) and **2nd-order momentum change** (momentum acceleration/deceleration), plus absolute momentum strength, to comprehensively judge momentum direction, speed and intensity.
3. **Color-Coded Visualization with Hierarchy**
Uses a gradient color system (vibrant-to-pale green for bullish, vivid-to-light red for bearish, gray for neutral) with transparency differentiation to reflect momentum strength; histogram style ensures intuitive observation, paired with a dotted zero reference line for clear bias judgment.
4. **Practical Trading Auxiliary Tools**
Supports toggleable status labels for extreme momentum (accelerating up/down); embeds a top-right dashboard displaying real-time momentum values, change rate, state, strength level and direct trading suggestions, enabling one-glance market judgment.
5. **High Customizability**
Allows adjustment of core parameters (momentum calculation period, smoothing factor) and toggling of label display, with reasonable parameter ranges to adapt to different trading assets and timeframes.
6. **Trade-Oriented Decision Guidance**
Maps each momentum state to corresponding strength levels and actionable operation advice (long/add position, short/add position, hold, reduce position, wait), directly linking technical analysis to actual trading behavior.
ADR%, LoD Price, RS RatingGet the Values of ADR%, LoD Price, RS Rating on Daily Charts.
For RS Ratings, Benchmark Symbol and look back period need to be adjusted manually as per your requirement.
ATR Trimmed Daily Volatility Context Open-Close AnchoredPurpose
This indicator provides daily volatility context using a trimmed Average True Range ATR. It helps you assess whether todays movement is compressed, normal, or expanded — without predicting direction.
Key idea
Price movement is meaningful only relative to typical volatility. ATR describes what is normal for the instrument; it does not forecast highs-lows.
How it works
ATR Trim is calculated from the last N completed daily candles (default 5).
The script optionally removes extreme daily ranges (Trim used) to reduce distortion from abnormal spikes.
Bands are projected from a selectable Anchor:
Open (todays daily open) — intraday session context
Close (previous days close) — swing-multi-day context
FX Rate Bias US vs EU 2YFX Rate Bias – US vs EU (2Y)
This indicator provides a macro bias framework for FX markets by tracking the 2-year government bond yield differential between the United States and Germany.
Rather than displaying the spread as a raw calculation, the script translates interest-rate expectations into a clear directional bias, helping traders understand which currency currently holds a rate advantage.
The 2Y segment of the yield curve is highly sensitive to:
Central bank expectations
Forward guidance
Shifts in short-term monetary policy outlook
How to use
Positive spread → USD rate advantage
Negative spread → EUR rate advantage
Designed to be used as a contextual macro tool, this indicator helps align technical setups with broader monetary conditions.
It is not intended as a standalone entry or signal generator.
RAPF Plus - Forecast Cones - Payoff Greeks - Calibration HarnessRAPF+ Manual (v2.2 — “variable ↔ chart label” clarified)
RAPF+ — Forecast Cones + Payoff Greeks + Calibration Harness
──────────────────────────────────────────────────────────────────────────────
0) What this indicator is
──────────────────────────────────────────────────────────────────────────────
RAPF+ is a forecast-and-score system: it predicts a future price range, then later
checks whether that prediction was accurate — and only generates signals whenthe
conditions are trustworthy.
Core idea (the “lightbulb moment”):
You’re not trading a static band. You’re trading “today’s range that was predicted
h bars ago.”
──────────────────────────────────────────────────────────────────────────────
1) Mental Model (Non-Quant Friendly)
──────────────────────────────────────────────────────────────────────────────
Weather Forecast Analogy
- Bollinger Bands are like looking out the window to see if it’s raining now.
- RAPF+ is like checking the forecast made 3 days ago for today, then grading it.
Interpretation:
- If the forecast said “normal range” and the price stays inside the cone:
→ forecast held → “hold/trend environment”
- If price breaks outside the cone:
→ forecast failed → “breakout shock” or “overextension” (depends on mode)
Why this matters:
RAPF+ is about whether the *old forecast* was correct, not just where the price is now.
──────────────────────────────────────────────────────────────────────────────
2) What You See on the Chart (and what the internal variables are called)
──────────────────────────────────────────────────────────────────────────────
Important: Variable names like aUp/aDn/aMid are INTERNAL to the code.
On the chart and in the Data Window, you’ll see them by their PLOT NAMES.
How to read exact values:
- Hover a candle → open TradingView “Data Window” → find this indicator → read plot values.
- Or hover the plotted line to see its value.
- Or enable “Indicators Values” on the right scale to see last values.
A) Forecast Cones (future projections)
These are projected to the right of current candles (offset by H1/H2/H3).
Code variables (forecast for each horizon):
- mid1 / up1 / dn1 = forecast median/upper/lower at Horizon H1 (projected right)
- mid2 / up2 / dn2 = forecast median/upper/lower at Horizon H2 (projected right)
- mid3 / up3 / dn3 = forecast median/upper/lower at Horizon H3 (projected right)
Chart plot names (what users will see):
- “P50 H1”, “Upper H1”, “Lower H1”
- “P50 H2”, “Upper H2”, “Lower H2”
- “P50 H3”, “Upper H3”, “Lower H3”
Use forecast cones for planning (expectations, targets), NOT direct signal triggers.
B) Density Fan (optional)
Layered confidence bands (50–95%) for a selected horizon.
Code variables:
- upDen50/dnDen50 … upDen95/dnDen95 (selected density horizon)
Chart plot names:
- “Den Up 50”, “Den Dn 50”, … “Den Up 95”, “Den Dn 95” (usually hidden; fills visible)
C) Applied Cone (the tradeable one)
This is the cone that actively interacts with the CURRENT candle.
The Applied Cone is a “prediction made h bars ago, applied to today.”
It uses “old” cone values (shifted buffers) and then selects one horizon.
Internal variables (used by signals):
- aMid = applied median line for the selected Signal Horizon (H1/H2/H3)
- aUp = applied upper bound for the selected Signal Horizon
- aDn = applied lower bound for the selected Signal Horizon
Chart plot names (what users will see):
- aMid → “Applied Mid”
- aUp → “Applied Up”
- aDn → “Applied Dn”
Trading cue:
- Signals are generated by price crossing the Applied Cone (aUp/aDn),
meaning price broke outside the range that was predicted h bars ago for today.
Visual cue (important):
- Applied Cone = the one interacting with current candles (now).
- Forecast Cones = projected to the right into the future.
──────────────────────────────────────────────────────────────────────────────
3) The Stats Table (How to Trust It)
──────────────────────────────────────────────────────────────────────────────
The table grades the model across H1/H2/H3:
Coverage (most important)
- “How often did realized price land inside the predicted cone?”
- Target ≈ conf (e.g., 80%)
Interpretation:
- Coverage below target: cones too tight OR regime changed
- Coverage above target: cones conservative (wider than needed)
Dir Acc (Direction Accuracy)
- “How often was the direction of the forecast correct?”
- Compares sign(forecast mid - old spot) vs sign(realized move)
MAE (Mean Absolute Error)
- Average miss from the predicted midline (lower is better)
Avg Width
- Average cone width (how “expensive” the forecast is in range terms)
Warm-up note (important)
- Stats use warmupBars (default 50) to avoid early-history spikes.
- If you see dashes/empty values on load, wait for more bars to load/scroll back.
Horizon selection tip
Pick the horizon that best balances:
- Coverage near/above target
- Dir Acc acceptable
- MAE low
- Width reasonable
──────────────────────────────────────────────────────────────────────────────
4) The Risk Gate (When Signals Matter)
──────────────────────────────────────────────────────────────────────────────
RAPF+ has an explicit “stand down” filter.
Signals are considered valid only when okRisk = YES, based on:
- Trust ≥ Min Trust
- RegimeRisk ≤ Max RegimeRisk
- Coverage(selected horizon) ≥ Min Coverage
- Enough bars have elapsed for that horizon
HUD labels (what users see) vs code variables:
- “RegimeRisk” in HUD = regimeRisk in code
- “Trust” in HUD = trustTrend in code
- “μ(bar)” in HUD = muBar in code
- “σ(bar)” in HUD = sigmaBar in code
- “okRisk YES/no” = okRisk boolean in code
If okRisk = NO:
DEFAULT ACTION = HOLD / reduce risk / stay flat
This is “no signal.” It is a “low-quality environment.”
What RegimeRisk/Trust mean (simple)
- RegimeRisk rises when volatility is high and/or unstable.
- Trust = 1 − RegimeRisk
- Drift (μ) is damped when Trust is low.
──────────────────────────────────────────────────────────────────────────────
5) Buy / Sell / Hold Playbooks
──────────────────────────────────────────────────────────────────────────────
All rules below assume okRisk = YES.
A) Breakout Mode (continuation/trend)
Signal logic:
- BUY/LONG when price crosses above Applied Upper:
• internal: close crosses above aUp
• chart: close crosses above “Applied Up”
- SELL/SHORT when price crosses below Applied Lower:
• internal: close crosses below aDn
• chart: close crosses below “Applied Dn”
Drift direction filter (recommended ON):
- Longs require μ > 0 (muBar > 0)
- Shorts require μ < 0 (muBar < 0)
Management / Hold:
- Long bias while price is above aMid (“Applied Mid”)
- Short bias while price is below aMid (“Applied Mid”)
Exit ideas (choose your style):
- Conservative: exit if price re-enters inside the cone (failed breakout)
- Balanced: exit on cross back through aMid
- Hard stop: exit on cross opposite band
Best conditions for Breakout:
- Coverage at/above target
- Dir Acc decent
- Trust healthy (RegimeRisk contained)
B) Fade Mode (mean reversion/overextension)
Signal logic (opposite philosophy):
- SHORT when price breaks above aUp (“Applied Up”)
- LONG when price breaks below aDn (“Applied Dn”)
Profit logic:
- aMid (“Applied Mid”) is the “magnet” / mean reversion target
- Many traders scale out toward aMid
Re-entry circles (what they mean):
- When the price was outside, then it crossed back INSIDE the Applied Cone.
- In code: reenterFromAbove / reenterFromBelow
- On the chart: small yellow circles near the candle
Use as confirmation that the “shock” is fading and/or as take-profit prompts.
Best conditions for Fade:
- Dir Acc mediocre/low (choppy drift)
- Coverage struggling vs target (more violations)
- RegimeRisk higher (but still within your maxRisk gate)
C) Auto (Cal Error) Mode (adaptive behavior)
If Signal Mode = Auto (Cal Error):
- If realized coverage ≥ target → uses Breakout
- If realized coverage < target → uses Fade
Plain English:
“If my cones are behaving well, ride continuation.
If they’re failing, mean-revert the brakes.”
──────────────────────────────────────────────────────────────────────────────
6) What HOLD Means (3 distinct cases)
──────────────────────────────────────────────────────────────────────────────
Hold Type 1: No-trade hold (risk gate fails)
- If Trust too low OR RegimeRisk too high OR Coverage too low:
→ HOLD / reduce risk / stand down
Hold Type 2: Inside-cone hold (normal noise)
- Inside the Applied Cone is often “business as usual.”
- Breakout traders: wait, avoid impulsive adds
- Fade traders: take profit / don’t overstay
Hold Type 3: Midline bias hold
- aMid (“Applied Mid”) acts like “forecast fair value”
- Above aMid: bullish bias
- Below aMid: bearish bias
- Frequent flips around aMid: chop → prefer Fade or no-trade
──────────────────────────────────────────────────────────────────────────────
7) Setup Checklist (Practical Defaults)
──────────────────────────────────────────────────────────────────────────────
Step 0 — Select Your Timeframe (avoid noise first)
- Daily (1D): Recommended for most crypto assets.
Best balance of signal stability + trend capture.
- Weekly (1W): Use for macro trend bias (Drift check).
Great for direction context, but signals are slower/fewer.
- Intraday (1H/4H): Advanced users only.
Noisier; typically requires:
• Higher confidence (e.g., 0.90+)
• Stricter risk gates (higher Min Trust, higher Min Coverage, lower Max RegimeRisk)
• Patience with calibration stability
Step 1 — Pick Signal Horizon
- H1: quick swing
- H2: typical swing
- H3: position-style
Step 2 — Calibrate Coverage (don’t guess)
- Coverage below target → increase Cone Width Multiplier
- Coverage above target → decrease Cone Width Multiplier
- Optional: enable Auto-calibrate Cone Width (servo toward conf + margin)
Important: Use Cone Width Multiplier for coverage tuning (that’s what it’s for).
Avoid “fixing” coverage by changing cycle settings.
Step 3 — Set risk gates (reasonable baseline)
- Min Trust ≈ 0.45
- Max RegimeRisk ≈ 0.70
- Min Coverage ≈ 0.55+ (raise for fewer, higher-quality trades)
Step 4 — Keep Drift Filter ON (recommended)
Prevents trading against μ (drift direction).
──────────────────────────────────────────────────────────────────────────────
8) Optional: Payoff + Greeks (Advanced Layer)
──────────────────────────────────────────────────────────────────────────────
(Note: The Greeks engine is disabled by default to save performance.
You must enable it in indicator settings to see these metrics.)
If enabled, RAPF+ estimates the expected payoff for Straddle/Call/Put under the model
distribution (with optional fat-tail mixture) plus Δ / Γ / ν / Θ.
Use cases:
- Assess convexity vs mean reversion preference
- Spot/vol sensitivity awareness
- Horizon comparisons for “optionality-like” behavior
If you’re a spot-only trader, you can ignore this section.
──────────────────────────────────────────────────────────────────────────────
9) One-Page Rules Card
──────────────────────────────────────────────────────────────────────────────
PRE-CHECK
- Choose timeframe (prefer 1D for most crypto)
- Choose signal horizon (H1/H2/H3)
- Prefer horizon with good Coverage and acceptable Dir Acc
- Trade only if okRisk = YES
BREAKOUT MODE
- Buy on cross above “Applied Up” (aUp) (μ>0 if drift filter ON)
- Sell/short on cross below “Applied Dn” (aDn) (μ<0 if drift filter ON)
- Hold while aligned with “Applied Mid” (aMid)
- Exit on re-entry / aMid cross / opposite band (your style)
FADE MODE
- Short on break above “Applied Up” (aUp)
- Long on break below “Applied Dn” (aDn)
- Target “Applied Mid” (aMid) as the mean reversion magnet
- Re-entry circles confirm the “shock fade”
STAND DOWN
- If okRisk = NO → HOLD / reduce risk / no-trade
──────────────────────────────────────────────────────────────────────────────
Quick Glossary
──────────────────────────────────────────────────────────────────────────────
H1/H2/H3: Forecast horizons in bars
conf: Desired coverage probability (e.g., 0.80)
Coverage: % of times realized price stayed inside the cone
Dir Acc: % of times direction was correct
MAE: Avg error vs forecast midline
Width: Avg cone width (upper-lower)/spot
RegimeRisk: Combined “vol high/unstable” score
Trust: 1 − RegimeRisk (how much to trust drift)
μ(bar): Estimated per-bar drift (directional bias)
σ(bar): Estimated per-bar volatility
Applied Cone (present, tradeable):
- aMid / aUp / aDn are internal variables
- On the chart/Data Window, they appear as:
aMid = “Applied Mid”
aUp = “Applied Up”
aDn = “Applied Dn”
Forecast Cones (future projections):
- mid1/up1/dn1 (H1), mid2/up2/dn2 (H2), mid3/up3/dn3 (H3)
- On the chart, they appear as:
“P50 H1/Upper H1/Lower H1”, etc.
Breakout LevelsBreakout Levels - User Guide
Overview
The Breakout Levels indicator automatically detects and displays significant breakout candles across multiple timeframes. A breakout occurs when price makes a strong, decisive move - identified by candles with unusually large bodies relative to average volatility.
These breakout levels often act as future support/resistance zones, making them valuable reference points for trading decisions.
What is a Breakout?
A breakout is detected when a candle's body size (the distance between open and close) is significantly larger than normal. By default, the script looks for candles that are 2x the ATR (Average True Range) or larger.
Example:
If the 14-period ATR is $5, a candle with a $10+ body would qualify as a breakout
These represent strong, committed moves by the market
The script marks the high of bullish breakouts and the low of bearish breakouts
Settings Guide
Timeframes
Toggle which timeframes to monitor for breakouts:
Show Daily Breakouts - Green/Red levels from daily chart breakouts
Show 4H Breakouts - 4-hour timeframe breakouts
Show 1H Breakouts - 1-hour timeframe breakouts
Show 15M Breakouts - 15-minute timeframe breakouts
Tip: When running on a 15-minute chart, you can see breakouts from all higher timeframes simultaneously.
Lookback (How Far Back to Display)
Controls how many bars back to show levels for each timeframe:
TimeframeDefaultWhat it Means15M50 bars~12.5 hours of breakout history1H200 bars~8 days of breakout history4H250 bars~42 days of breakout historyDaily300 bars~300 days (nearly 1 year)
Why adjust this?
Increase to see more historical levels (may clutter chart)
Decrease to focus only on recent breakouts
Older levels are still stored, just not displayed
Detection Settings
Breakout Candle Size (x ATR)
Default: 2.0
Range: 1.0 to 5.0
What it does: Multiplier for what qualifies as a "big" candle
SettingSensitivityUse Case1.0-1.5Very sensitiveCatches more breakouts, but may include false moves2.0Balanced (default)Good mix of quality and quantity3.0-5.0Very selectiveOnly the most explosive moves
Recommendation: Start with 2.0 and adjust based on your market and trading style.
Visual Settings
Bullish Breakout Color
Default: Green with 60% transparency
Marks levels where price broke upward strongly
Bearish Breakout Color
Default: Red with 60% transparency
Marks levels where price broke downward strongly
Show Labels
Toggle labels on/off
Labels display: BO
Example: "4H BO 150.25"
Turn OFF for cleaner charts when you just want the lines
How to Use This Indicator
1. Identify Key Breakout Zones
Breakout levels often become magnets where price returns later:
Former resistance (where price broke up) becomes future support
Former support (where price broke down) becomes future resistance
2. Look for Confluence
When multiple timeframe breakouts cluster near the same price:
15M + 1H + 4H breakouts all near $150 = strong level
More confluence = more significant level
3. Watch for Retests
After a breakout, price often returns to test that level:
Bullish breakout retest from above = potential long entry
Bearish breakout retest from below = potential short entry
4. Combine with Other Analysis
Use breakout levels alongside:
Your own support/resistance analysis
Volume profiles
Fibonacci levels
Candlestick patterns at these levels
Practical Examples
Example 1: Clean Breakout and Retest
Daily candle closes up with a huge body (2.5x ATR)
Green line drawn at the high of that candle
Price pulls back 3 days later and bounces exactly off that green line
Trade opportunity: Long entry at the retest with stop below
Example 2: Failed Breakout
4H bearish breakout draws a red line at the low
Price immediately reverses back above the level
Signal: The breakout was false - consider this a stop hunt zone
Example 3: Multi-Timeframe Confluence
Daily breakout at $100
4H breakout at $100.50
1H breakout at $99.80
Strong cluster zone: $99.80-$100.50 becomes a major decision point
Best Practices
DO:
✅ Start with default settings (2.0x ATR, default lookbacks)
✅ Use on a 15-minute chart to see all timeframes
✅ Look for price reactions at these levels before trading
✅ Combine with volume - breakouts with high volume are more reliable
✅ Turn off labels when chart gets too busy
DON'T:
❌ Treat every line as guaranteed support/resistance
❌ Set breakout multiplier too low (<1.5) - creates noise
❌ Ignore the context - check what's happening in the broader market
❌ Trade blindly at these levels without confirmation
Troubleshooting
"Too many lines on my chart"
Reduce the lookback settings
Turn off some timeframes (maybe just show Daily + 4H)
Increase the breakout multiplier to 2.5 or 3.0
"Not showing any levels"
Lower the breakout multiplier to 1.5
Increase lookback settings
Check that at least one timeframe toggle is ON
Verify the market had actual volatility during the period
"Labels are cluttering the chart"
Turn off "Show Labels" in settings
Lines will remain, labels disappear
Technical Notes
ATR Period: 14 (industry standard, not adjustable in this version)
Max Lines: 500 (Pine Script limitation)
Duplicate Filter: Levels within 0.3% of ATR are considered duplicates and filtered
Chart Type: Works on any chart timeframe, optimized for 15-minute
Asset Type: Works on stocks, forex, crypto, futures
Summary
The Breakout Levels indicator gives you a systematic way to identify where strong, committed market moves occurred. These levels often act as future decision points. Use them as reference zones to watch for price reactions, not as automatic trade signals.
Quick Start:
Add indicator to a 15-minute chart
Leave default settings (2.0x ATR)
Watch how price interacts with the levels over the next few days
Adjust sensitivity based on your observations
Happy trading! 📈






















