Dynamic Liquidity HeatMap Profile [BigBeluga]🔵 OVERVIEW   
The  Dynamic Liquidity HeatMap Profile   is a smart-flow liquidity tracker that maps where stop-loss clusters and resting limit orders are likely positioned.  
Instead of traditional volume profiles based only on executed transactions, this tool projects  probable liquidity pools  — areas where traders are trapped or positioned and where smart money may hunt stops or fill orders.
It dynamically scans recent price swings, builds liquidity zones above and below price, and visualizes them as a heat map + histogram — highlighting areas with the greatest liquidity attraction.  
Orange highlights the highest-concentration liquidity (POC), making potential sweep targets obvious.
 🔵 CONCEPTS   
   
  Liquidity pools form above swing highs (buy stops) and below swing lows (sell stops). 
  Market makers & large players often push price into these zones to trigger stops and capture liquidity.  
  
  The indicator uses recent volatility + volume expansion to estimate where these pools exist.
  Horizontal heat bars show depth and intensity of probable liquidity.  
  
  Profile side histogram displays buy-side vs sell-side liquidity distribution.  
 
 🔵 FEATURES   
   
   Dynamic Liquidity Detection  — finds potential stop-loss clusters from recent swing behavior.
   Dual-Side Heatmap  — split liquidity view above (short stops) and below (long stops) current price.
  
   Volume-Weighted Levels  — higher volatility & volume = deeper liquidity expectation.
  
   Real-Time Heat Coloring   
   • Lime = liquidity below price (potential buy-side fuel)  
  
   • Blue = liquidity above price (potential sell-side fuel)  
  
   • Orange = peak liquidity (POC)  
  
   Liquidity Profile Histogram  — plotted at right side, layered by strength.  
   Auto-Cleaning Engine  — removes invalidated liquidity after breaks.  
  Adjustable  lookback window  and  bin resolution .  
  
 
 🔵 HOW TO USE   
   
  Look for price moving toward dense liquidity zones — high probability of wick raids or sweeps.  
  Orange POC often acts as magnet — strong target zone for smart money.  
  Combine with SFP / BOS logic to time reversals after liquidity hunts.  
  In trend, price repeatedly sweeps opposite-side liquidity before continuation.  
  Use liquidity walls as bias filters — heavy liquidity above often precedes downward move, and vice-versa.  
  Great for scalping sessions, indices, FX, BTC, ETH.  
 
 🔵 CONCLUSION   
The  Dynamic Liquidity HeatMap Profile   gives traders a tactical edge by revealing where the market’s hidden liquidity resides.  
It highlights where shorts and longs are positioned, identifies likely sweep zones, and marks the most attractive liquidity magnet (POC).  
Use it to anticipate stop hunts, avoid getting trapped, and align with smart-money flow instead of fighting it.
Volatility
Volume Momentum Div - [TCMaster]📘 Description
Volume + Momentum (Instant Alert) is a dynamic indicator designed to detect potential market tops and bottoms in real time by combining momentum shifts with volume spikes.
Unlike traditional oscillators that confirm signals only after candle close, this tool reacts instantly, providing early alerts during live market movements.
⚙️ How It Works
Momentum Calculation:
Measures the short-term price acceleration using the difference between the current price and the price n periods ago.
Rising momentum indicates bullish strength, while falling momentum shows bearish pressure.
Volume Spike Detection:
Compares current volume to its moving average.
When the current volume exceeds the average by a defined multiplier, it signals strong market participation — often appearing near market reversals.
Signal Logic:
Top Alert (🔻): Momentum turns negative while a volume spike occurs → potential short opportunity.
Bottom Alert (🔺): Momentum turns positive while a volume spike occurs → potential long opportunity.
🎯 Features
Real-time alerts (calc_on_every_tick=true) — signals trigger instantly during live candles.
Multiple plot styles available: Line, Histogram, or Columns.
Simple yet powerful logic suitable for scalping, intraday, and swing trading.
Works across all markets (forex, crypto, stocks, commodities).
💡 How to Use
Look for Volume Spikes — sudden increases in volume often mark exhaustion or breakout points.
Check Momentum Direction — combine with volume to confirm reversals.
Entry/Exit: 
Buy when a green triangle (🔺) appears below the bar.
Sell when a red triangle (🔻) appears above the bar.
Optional Filters: For improved accuracy, combine with RSI, Stochastic, or trend filters (e.g., EMA200).
Machine Learning Moving Average [BackQuant]Machine Learning Moving Average  
 A powerful tool combining clustering, pseudo-machine learning, and adaptive prediction, enabling traders to understand and react to price behavior across multiple market regimes (Bullish, Neutral, Bearish). This script uses a dynamic clustering approach based on percentile thresholds and calculates an adaptive moving average, ideal for forecasting price movements with enhanced confidence levels. 
 What is Percentile Clustering? 
Percentile clustering is a method that sorts and categorizes data into distinct groups based on its statistical distribution. In this script, the clustering process relies on the percentile values of a composite feature (based on technical indicators like RSI, CCI, ATR, etc.). By identifying key thresholds (lower and upper percentiles), the script assigns each data point (price movement) to a cluster (Bullish, Neutral, or Bearish), based on its proximity to these thresholds.
This approach mimics aspects of machine learning, where we “train” the model on past price behavior to predict future movements. The key difference is that this is not true machine learning; rather, it uses data-driven statistical techniques to "cluster" the market into patterns.
 Why Percentile Clustering is Useful 
 
 Clustering price data into meaningful patterns (Bullish, Neutral, Bearish) helps traders visualize how price behavior can be grouped over time.
 By leveraging past price behavior and technical indicators, percentile clustering adapts dynamically to evolving market conditions.
 It helps you understand whether price behavior today aligns with past bullish or bearish trends, improving market context.
 Clusters can be used to predict upcoming market conditions by identifying regimes with high confidence, improving entry/exit timing.
 
 What This Script Does 
 
 Clustering Based on Percentiles : The script uses historical price data and various technical features to compute a "composite feature" for each bar. This feature is then sorted and clustered based on predefined percentile thresholds (e.g., 10th percentile for lower, 90th percentile for upper).
 Cluster-Based Prediction : Once clustered, the script uses a weighted average, cluster momentum, or regime transition model to predict future price behavior over a specified number of bars.
 Dynamic Moving Average : The script calculates a machine-learning-inspired moving average (MLMA) based on the current cluster, adjusting its behavior according to the cluster regime (Bullish, Neutral, Bearish).
 Adaptive Confidence Levels : Confidence in the predicted return is calculated based on the distance between the current value and the other clusters. The further it is from the next closest cluster, the higher the confidence.
 Visual Cluster Mapping : The script visually highlights different clusters on the chart with distinct colors for Bullish, Neutral, and Bearish regimes, and plots the MLMA line.
 Prediction Output : It projects the predicted price based on the selected method and shows both predicted price and confidence percentage for each prediction horizon.
 Trend Identification : Using the clustering output, the script colors the bars based on the current cluster to reflect whether the market is trending Bullish (green), Bearish (red), or is Neutral (gray).
 
 How Traders Use It 
 
 Predicting Price Movements : The script provides traders with an idea of where prices might go based on past market behavior. Traders can use this forecast for short-term and long-term predictions, guiding their trades.
 Clustering for Regime Analysis : Traders can identify whether the market is in a Bullish, Neutral, or Bearish regime, using that information to adjust trading strategies.
 Adaptive Moving Average for Trend Following : The adaptive moving average can be used as a trend-following indicator, helping traders stay in the market when it’s aligned with the current trend (Bullish or Bearish).
 Entry/Exit Strategy : By understanding the current cluster and its associated trend, traders can time entries and exits with higher precision, taking advantage of favorable conditions when the confidence in the predicted price is high.
 Confidence for Risk Management : The confidence level associated with the predicted returns allows traders to manage risk better. Higher confidence levels indicate stronger market conditions, which can lead to higher position sizes.
 
 Pseudo Machine Learning Aspect 
While the script does not use conventional machine learning models (e.g., neural networks or decision trees), it mimics certain aspects of machine learning in its approach. By using clustering and the dynamic adjustment of a moving average, the model learns from historical data to adjust predictions for future price behavior. The "learning" comes from how the script uses past price data (and technical indicators) to create patterns (clusters) and predict future market movements based on those patterns.
 Why This Is Important for Traders 
 
 Understanding market regimes helps to adjust trading strategies in a way that adapts to current market conditions.
 Forecasting price behavior provides an additional edge, enabling traders to time entries and exits based on predicted price movements.
 By leveraging the clustering technique, traders can separate noise from signal, improving the reliability of trading signals.
 The combination of clustering and predictive modeling in one tool reduces the complexity for traders, allowing them to focus on actionable insights rather than manual analysis.
 
 How to Interpret the Output 
 
 Bullish (Green) Zone : When the price behavior clusters into the Bullish zone, expect upward price movement. The MLMA line will help confirm if the trend remains upward.
 Bearish (Red) Zone : When the price behavior clusters into the Bearish zone, expect downward price movement. The MLMA line will assist in tracking any downward trends.
 Neutral (Gray) Zone : A neutral market condition signals indecision or range-bound behavior. The MLMA line can help track any potential breakouts or trend reversals.
 Predicted Price : The projected price is shown on the chart, based on the cluster's predicted behavior. This provides a useful reference for where the price might move in the near future.
 Prediction Confidence : The confidence percentage helps you gauge the reliability of the predicted price. A higher percentage indicates stronger market confidence in the forecasted move.
 
 Tips for Use 
 
 Combining with Other Indicators : Use the output of this indicator in combination with your existing strategy (e.g., RSI, MACD, or moving averages) to enhance signal accuracy.
 Position Sizing with Confidence : Increase position size when the prediction confidence is high, and decrease size when it’s low, based on the confidence interval.
 Regime-Based Strategy : Consider developing a multi-strategy approach where you use this tool for Bullish or Bearish regimes and a separate strategy for Neutral markets.
 Optimization : Adjust the lookback period and percentile settings to optimize the clustering algorithm based on your asset’s characteristics.
 
 Conclusion 
The  Machine Learning Moving Average   offers a novel approach to price prediction by leveraging percentile clustering and a dynamically adapting moving average. While not a traditional machine learning model, this tool mimics the adaptive behavior of machine learning by adjusting to evolving market conditions, helping traders predict price movements and identify trends with improved confidence and accuracy.
Volumatic VIDYA – Pro+1. Professional & Clear (recommended for TradingView)
Volumatic VIDYA Pro+ combines a dynamic VIDYA trend filter, Delta Volume pressure, and automatic pattern recognition (Double/Triple Tops & Bottoms, Head & Shoulders).
A complete technical tool for detecting momentum shifts, trend reversals, and trade entries across multiple timeframes.
2. Short & Catchy
Adaptive VIDYA trendline + Delta Volume + Pattern detection in one tool.
Instantly visualize market bias, structure, and momentum strength.
3. Educational / Analytical
Analyze market dynamics with VIDYA-based trend filtering, volume delta analysis, and automated pattern recognition.
Ideal for traders who combine price action with quantitative confirmation.
Liquidity & Momentum Master (LMM)💎 Liquidity & Momentum Master (LMM)
A professional dual-system indicator that combines:
📦 High-Volume Support/Resistance Zones and
📊 RSI + Bollinger Band Combo Signals — to visualize both smart money footprints and momentum reversals in one clean tool.
🧱 1. High-Volume Liquidity Zones (Support/Resistance Boxes)
Conditions
Visible only on 1H and higher timeframes (1H, 4H, 1D, etc.)
Detects candles with abnormally high volume and strong ATR-based range
Separates bullish (support) and bearish (resistance) zones
Visualization
All boxes are white, with adjustable transparency (alphaW, alphaBorder)
Each box extends to the right automatically
Only the most important (Top-N) zones are kept — weaker ones are removed automatically
Interpretation
White boxes = price areas with heavy liquidity and volume concentration
Price approaching these zones often leads to bounces or rejections
Narrow spacing = consolidation, wide spacing = potential large move
💎 2. RSI Exit + BB-RSI Combo Signals
RSI Exit (Overbought/Oversold Recovery)
RSI drops from overbought (>70) → plots red “RSI” above the candle
RSI rises from oversold (<30) → plots green “RSI” below the candle
Works on 15m, 30m, 1H, 4H, 1D
→ Indicates short-term exhaustion recovery
BB-RSI Combo (Momentum Reversal Confirmation)
Active on 1H and higher only
Requires both:
✅ RSI divergence (bullish or bearish)
✅ Bollinger Band re-entry (after temporary breakout)
Combo Buy (Green Diamond)
Bullish RSI divergence
Candle closes back above lower Bollinger Band
Combo Sell (Red Diamond)
Bearish RSI divergence
Candle closes back below upper Bollinger Band
→ Confirms stronger reversal momentum compared to standard RSI signals
Vandan V2Vandan V2 is an automated trading strategy for NQ1! (E-mini Nasdaq-100) based on short-term mean reversion with dynamic risk control. It combines volatility filters and overbought/oversold signals to capture local market imbalances.
Backtested from 2015 to 2025, it achieved a +730% total return, Profit Factor of 1.40, max drawdown of only 1.61%, and over 106,000 trades. Designed for systematic scalping or intraday arbitrage with a limit of 3 simultaneous contracts.
Simulated Fear & Greed (CNN-calibrated v2)🧭 Fear & Greed Index — TradingView Version (Simulated CNN Model)
🔍 Purpose
The Fear & Greed Index is a sentiment indicator that quantifies market emotion on a scale from 0 to 100, where:
0 represents Extreme Fear (capitulation, oversold conditions), and
100 represents Extreme Greed (euphoria, overbought conditions).
It helps traders assess whether the market is driven by fear (risk aversion) or greed (risk appetite) — giving a high-level view of potential turning points in market sentiment.
⚙️ How It Works in TradingView
Because TradingView cannot directly access CNN’s or alternative external sentiment feeds, this indicator simulates the Fear & Greed Index by analyzing in-chart technical data that reflect investor psychology.
It uses a multi-factor model, converting price and volume signals into a composite sentiment score.
🧩 Components Used (Simulated Metrics)
Category	Metric	Emotional Interpretation
Volatility	ATR (Average True Range)	High ATR = Fear, Low ATR = Greed
Momentum	RSI + MACD Histogram	Rising momentum = Greed, Falling = Fear
Volume Activity	Volume Z-Score	High positive deviation = Greed, Low = Fear
Trend Context	SMA Regime Bias (50/200)	Downtrend adds Fear penalty, Uptrend supports Greed
These elements are normalized into a 0–100 scale using percentile ranks (like statistical scoring) and then combined using user-adjustable weights.
⚖️ CNN-Style Calibration
The script follows CNN’s five sentiment bands for clarity:
Range	Zone	Colour	Description
0–25	Extreme Fear	🔴 Red	Panic, forced selling, capitulation risk
25–45	Fear	🟠 Orange	Uncertainty, hesitation, early accumulation phase
45–55	Neutral	⚪ Gray	Balanced sentiment, indecision
55–75	Greed	🟢 Light Green	Optimism, trend continuation
75–100	Extreme Greed	💚 Bright Green	Euphoria, risk of reversal
This structure aligns visually with CNN’s public gauge, making it easy to interpret.
MTF VFSMA SqueezeThe purpose of this indicator is to detect a market squeeze (lack of volatility) period and to identify the initiation and direction of the breakout.
 It is based on Variety-Filtered, Squeeze Moving Averages   indicator.  
 The original indicator created by Loxx identifies both squeeze zones and breakouts/breakdowns. A squeeze zone is defined when price is below a specific volatility threshold calculated as the difference between a fast- and slow-moving average and filtered using ATR- or Pips-based threshold. 
 It operates on a single timeframe and  includes Loxx's Expanded Source Types, signals, alerts, etc. and 35+ Loxx's Moving Averages. These adaptive, minimal-lag indicators are built upon advanced mathematical and signal processing DSP techniques that far surpass traditional Moving Averages. 
  This currently published indicator includes the following main developments:  
 Squeeze Detection using Percentile Rank Method 
It detects the Squeeze by applying a Percentile Rank to the historical distance (spread) between the two MAs.
MA Spread: The basis for Squeeze detection is the distance between the two moving averages.
Percentile Rank: A statistical measure that indicates the percentage of past Spread values within the set lookback period that are lower than the current MA Spread.
Squeeze State: A Squeeze occurs when the Percentile Rank is below the set Squeeze Threshold (%)).
Example: If the threshold is 20% and the Rank is 15%, it means the MA Spread is in its tightest 15% range, below the set threshold. Therefore, the condition is currently met.
Goal: Objective volatility measurement that adapts to market conditions.
 Squeeze Duration Filter 
A key condition for a Breakout signal is that the MAs must have remained in the Squeeze zone for a specified minimum duration.
Goal: To filter out market noise and False Breakouts.
 Multi-Timeframe (MTF) Confluence 
Multi-Timeframe trend and squeeze monitoring for 3 timeframes (TFs).
Provides confirmation using the MA status from two higher timeframes (TF2, TF3).
Goal: Trend and momentum confirmation from a broader market context.
 Signals Only on Bar Close? 
By selecting the signalOnClose parameter to enabled, it is possible to avoid repainting on the chart TF. If it is checked, all events on the chart (L/S signals, Squeeze Start/End, MA color change) will only appear after the bar has closed, preventing repainting. Higher TF events remain in real-time.
Goal: To increase the reliability of signals.
 Multi-Level Alerts and Info Panel 
Comprehensive, confluence-weighted alerts and real-time status display.
Enhanced Alerts based on multi-timeframe confluences. Alerts are ready to enable/disable for Any alert() function call and ready for watchlists. Alert Frequency is also configurable in Inputs window. „Once per bar close” is the most reliable for signals. „Always” or „Once per bar” alert frequencies may generate temporary signal alerts.
Please note that even if "Once per bar close" is selected as alert frequency, this only applies to the chart TF, and TF2 and TF3 status may be modified until the close of the relevant candle.
Goal: Transparent decision-making.
  Other Improvements 
  Unlike the original indicator, the coloring of the MA curves on the chart depends on the relative positions of the fast MA and slow MA. The curves are colored bullish when the fast MA is above the slow MA, bearish when the opposite is true, and neutral in the squeeze zone.
 Data Window with Squeeze Start/End, Buy/Sell, Status, Squeeze Percentile etc. on all 3 TFs.
 Ready for Pine Screener.
Please be aware that currently only the chart TF is configurable in Pine Screener, TF2 and TF3 are set to their default values.
 Pine Script® version 6. 
 Limitations 
When setting the indicator parameters, please take into account the limitations of TradingView. (Lookback period of Percentile Rank and Moving Averages periods, Execution time limit (timeout) etc.)
For example, if a NaN% message appears as the Percentile Rank value, please reduce the lookback period.
 How to use it 
This indicator is a Breakout-following system, but it can also be the basis for Range Trading.
 
 The Setup Phase 
This is the preparation stage. The indicator signals low volatility as the bands tighten.
Squeeze Dynamics: Monitoring the Squeeze Duration is essential. The longer the price spends in the Squeeze zone, the more likely the resulting breakout will be powerful.
 The Signal Phase (Breakout)
The Breakout signal appears on the bar where the Percentile Rank first crosses above the Squeeze threshold, indicating a sudden return of volatility. 
Further condition: Meets the SqueezeDuration filter. 
Breakout direction: Bullish: Fast MA > SLow MA, Bearish: Fast MA < SLow MA
Applying MTF Confluence:
The most promising trades that are in line with higher timeframes:
Total Confluence: Chart TF Signal + TF2 Bullish/Bearish + TF3 Bullish/Bearish. This is the strongest, highest-probability setup.
Simple signal: Only the Chart TF signals. This should be handled with caution, as the higher timeframes (TF2, TF3) might still be in a Squeeze or in a conflicting state.
 Alternative Use: Range Trading within the Squeeze Bands
If the market has low volume, the squeeze bands can be used as dynamic support/resistance for bounces off the edges of the range:
The probability of a successful range trade increases if the boundaries of the squeeze zone have only been touched a few times previously. Each touch weakens the zone boundaries and increases the chance of a Breakout. 
 Suggested Tactics and Risk Management 
When using Breakout strategies, strict risk management and the use of confirmations are essential:
 Volume Confirmation: A strong, above-average volume Breakout candle increases the probability of a successful breakout.
 False Breakout: If the breakout occurs on low volume, there is a higher chance of a pullback and a False Breakout.
 Entry After Retest: A safer entry: wait until the price breaks out, but only enter if it returns to the squeeze zone and bounces back from there. This reduces the risk of a False Breakout trap.
The Risk of False Breakout:
 False Breakouts are part of any Breakout strategy. Always have a strict Stop Loss set.
 Reversal: Be prepared for the possibility that after a Breakout signal (e.g., Long), the price returns to the zone and then breaks out in the opposite (Short) direction.
  Please note that all technical analysis and trading signals only indicate probabilities. Always use your own risk management rules and follow market regulations. 
 Disclaimer 
This indicator is provided for educational and informational purposes only. It is not financial advice.
Trading involves substantial risk of loss and is not suitable for every investor. Past performance shown in examples is not indicative of future results.
The indicator provides signals and calculations, but trading decisions are solely your responsibility. Always:
Test strategies on paper before using real money
Never risk more than you can afford to lose
Understand that all trading involves risk
Consider seeking advice from a licensed financial advisor
The publisher makes no guarantees regarding accuracy, profitability, or performance. Use at your own risk.
Intraday Perpetual Premium & Z-ScoreThis indicator measures the real-time premium of a perpetual futures contract relative to its spot market and interprets it through a statistical lens.
It helps traders detect when funding pressure is building, when leverage is being unwound, and when crowding in the futures market may precede volatility.
How it works
	•	Premium (%) = (Perp – Spot) ÷ Spot × 100
The script fetches both spot and perpetual prices and calculates their percentage difference each minute.
	•	Rolling Mean & Z-Score
Over a 4-hour look-back, it computes the average premium and standard deviation to derive a Z-Score, showing how stretched current sentiment is.
	•	Dynamic ±2σ Bands highlight statistically extreme premiums or discounts.
	•	Rate of Change (ROC) over one hour gauges the short-term directional acceleration of funding flows.
Colour & Label Interpretation
Visual cue	Meaning	Trading Implication
🟢 Green bars + “BULL Pressure”	Premium rising faster than mean	Leverage inflows → momentum strengthening
🔴 Red bars + “BEAR Pressure”	Premium shrinking	Leverage unwind → pull-back or consolidation
⚠️ Orange “EXTREME Premium/Discount”		Crowded trade → heightened reversal risk
⚪ Grey bars	Neutral	Balanced conditions
Alerts
	•	Bull Pressure Alert → funding & premium rising (momentum building)
	•	Bear Pressure Alert → premium falling (deleveraging)
	•	Extreme Premium Alert → crowded longs; potential top
	•	Extreme Discount Alert → capitulation; possible bottom
Use case
Combine this indicator with your Heikin-Ashi, RSI, and MACD confluence rules:
	•	Enter only when your oscillators are low → curling up and Bull Pressure triggers.
	•	Trim or exit when Bear Pressure or Extreme Premium appears.
	•	Watch for Extreme Discount during flushes as an early bottoming clue.
Accurate ATR Stop Loss Distance — Risk Management ToolAccurate ATR Stop Loss Distance — Risk Management Tool
This indicator calculates an accurate Stop Loss distance in pips using the Average True Range (ATR) multiplied by a user-defined multiplier.
It automatically detects the correct pip size based on the instrument type (Forex, Crypto, Stocks, Indices, Futures), adjusting for 2-, 3-, 4-, or 5-digit quotes — ensuring professional-grade precision that matches institutional ATR-based risk systems.
📊 Features:
Uses ATR × Multiplier to determine precise SL distance in pips.
Automatically adjusts pip value depending on the asset type (handles 5-digit Forex brokers).
Clean and minimal design — displays only one info box in the top-right corner.
Fully customizable text and background colors.
Includes alert condition for automated SL updates.
⚙️ How to use:
Set your preferred ATR period and multiplier.
The indicator instantly displays your Stop Loss distance in pips at the top-right of the chart.
Combine with your entry strategy to calculate lot size or risk per trade.
💡 Ideal for traders who want consistent, objective SL distances derived from volatility rather than arbitrary points or emotions.
Note: Educational and informational tool only. Does not execute trades or give financial advice.
hbd.mozanitstones - GoldThis PineScript indicator code aims to create an advanced composite trading system and generates buy/sell signals by combining multiple technical analyses. Essentially, the system utilizes a composite scoring mechanism using trend filters based on moving averages (EMA 50 and EMA 200) and various oscillators (such as RSI, MACD, and Stochastic) to support buy and sell decisions. It also integrates advanced confirmation tools such as the Multi-Timeframe (MTF) EMA filter, along with additional filters such as SuperTrend, Bollinger Bandwidth, and Volume Ratio. The code's key feature is that it generates final signals that meet both traditional signal conditions and the minimum number of confirmations achieved by weighting these various indicators, thus increasing signal reliability.
RSI Exit + BB-RSI Combo📊 RSI Exit + BB-RSI Combo Indicator
This indicator combines RSI overbought/oversold exit signals with Bollinger Band re-entry conditions to highlight potential reversal or retracement zones.
1️⃣ RSI Exit Signal  
   - When RSI drops below 70 after being overbought → 🔴 "RSI" label  
   - When RSI rises above 30 after being oversold → 🟢 "RSI" label  
   - Works on 15m / 30m / 1h / 4h / 1D timeframes  
2️⃣ BB-RSI Combo Signal  
   - When an RSI divergence forms and  
   - The candle body re-enters the Bollinger Band on 1H+ timeframe  
     → Combo signal (💎 diamond) is shown  
💡 How to Use  
- Use RSI exit signals to spot overextension corrections  
- Use combo signals to identify high-probability reversal or rebound setups  
- Suitable for both swing and short-term trading  
 RSI Overbought/Oversold + Divergence Indicator (new)//@version=5
indicator('CryptoSignalScanner - RSI Overbought/Oversold + Divergence Indicator (new)', 
//---------------------------------------------------------------------------------------------------------------------------------
//--- Define Colors ---------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------
vWhite  = #FFFFFF
vViolet = #C77DF3
vIndigo = #8A2BE2
vBlue   = #009CDF
vGreen  = #5EBD3E
vYellow = #FFB900
vRed    = #E23838
longColor  = color.green
shortColor = color.red
textColor  = color.white
bullishColor = color.rgb(38,166,154,0) //Used in the display table
bearishColor = color.rgb(239,83,79,0) //Used in the display table
nomatchColor = color.silver //Used in the display table
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
//--- Functions--------------------------------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
TF2txt(TF) =>
    switch TF
        "S"    => "RSI 1s:"
        "5S"    => "RSI 5s:"
        "10S"   => "RSI 10s:"
        "15S"   => "RSI 15s:"
        "30S"   => "RSI 30s"
        "1"     => "RSI 1m:"
        "3"     => "RSI 3m:"
        "5"     => "RSI 5m:"
        "15"    => "RSI 15m:"
        "30"    => "RSI 30m"
        "45"    => "RSI 45m"
        "60"    => "RSI 1h:"
        "120"   => "RSI 2h:"
        "180"   => "RSI 3h:"
        "240"   => "RSI 4h:"
        "480"   => "RSI 8h:"
        "D"     => "RSI 1D:"
        "1D"    => "RSI 1D:"
        "2D"    => "RSI 2D:"
        "3D"    => "RSI 2D:"
        "3D"    => "RSI 3W:"
        "W"     => "RSI 1W:"
        "1W"    => "RSI 1W:"
        "M"     => "RSI 1M:"
        "1M"    => "RSI 1M:"
        "3M"    => "RSI 3M:"
        "6M"    => "RSI 6M:"
        "12M"   => "RSI 12M:"
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
//--- Show/Hide Settings ----------------------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
rsiShowInput          = input(true, title='Show RSI', group='Show/Hide Settings')
maShowInput           = input(false, title='Show MA', group='Show/Hide Settings')
showRSIMAInput        = input(true, title='Show RSIMA Cloud', group='Show/Hide Settings')
rsiBandShowInput      = input(true, title='Show Oversold/Overbought Lines', group='Show/Hide Settings')
rsiBandExtShowInput   = input(true, title='Show Oversold/Overbought Extended Lines', group='Show/Hide Settings')
rsiHighlightShowInput = input(true, title='Show Oversold/Overbought Highlight Lines', group='Show/Hide Settings')
DivergenceShowInput   = input(true, title='Show RSI Divergence Labels', group='Show/Hide Settings')
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
//--- Table Settings --------------------------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
rsiShowTable      = input(true, title='Show RSI Table Information box', group="RSI Table Settings")
rsiTablePosition  = input.string(title='Location', defval='middle_right', options= , group="RSI Table Settings", inline='1')
rsiTextSize       = input.string(title=' Size', defval='small', options= , group="RSI Table Settings", inline='1')
rsiShowTF1 = input(true, title='Show TimeFrame1', group="RSI Table Settings", inline='tf1')
rsiTF1     = input.timeframe("15", title=" Time", group="RSI Table Settings", inline='tf1')
rsiShowTF2 = input(true, title='Show TimeFrame2', group="RSI Table Settings", inline='tf2')
rsiTF2     = input.timeframe("60", title=" Time", group="RSI Table Settings", inline='tf2')
rsiShowTF3 = input(true, title='Show TimeFrame3', group="RSI Table Settings", inline='tf3')
rsiTF3     = input.timeframe("240", title=" Time", group="RSI Table Settings", inline='tf3')
rsiShowTF4 = input(true, title='Show TimeFrame4', group="RSI Table Settings", inline='tf4')
rsiTF4     = input.timeframe("D", title=" Time", group="RSI Table Settings", inline='tf4')
rsiShowHist = input(true, title='Show RSI Historical Columns', group="RSI Table Settings", tooltip='Show the information of the 2 previous closed candles')
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
//--- RSI Input Settings ----------------------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
rsiSourceInput  = input.source(close, 'Source', group='RSI Settings')
rsiLengthInput  = input.int(14, minval=1, title='RSI Length', group='RSI Settings', tooltip='Here we set the RSI lenght')
rsiColorInput   = input.color(#26a69a, title="RSI Color",  group='RSI Settings')
rsimaColorInput = input.color(#ef534f, title="RSIMA Color",  group='RSI Settings')
rsiBandColorInput = input.color(#787B86, title="RSI Band Color",  group='RSI Settings')
rsiUpperBandExtInput = input.int(title='RSI Overbought Extended Line', defval=80, minval=50, maxval=100, group='RSI Settings')
rsiUpperBandInput   = input.int(title='RSI Overbought Line', defval=70, minval=50, maxval=100, group='RSI Settings')
rsiLowerBandInput   = input.int(title='RSI Oversold Line', defval=30, minval=0, maxval=50, group='RSI Settings')
rsiLowerBandExtInput = input.int(title='RSI Oversold Extended Line', defval=20, minval=0, maxval=50, group='RSI Settings')
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
//--- MA Input Settings -----------------------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
maTypeInput = input.string("EMA", title="MA Type", options= , group="MA Settings")
maLengthInput = input.int(14, title="MA Length", group="MA Settings")
maColorInput = input.color(color.yellow, title="MA Color",  group='MA Settings') //#7E57C2
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
//--- Divergence Input Settings ---------------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
lbrInput        = input(title="Pivot Lookback Right", defval=2, group='RSI Divergence Settings')
lblInput        = input(title="Pivot Lookback Left", defval=2, group='RSI Divergence Settings')
lbRangeMaxInput = input(title="Max of Lookback Range", defval=10, group='RSI Divergence Settings')
lbRangeMinInput = input(title="Min of Lookback Range", defval=2, group='RSI Divergence Settings')
plotBullInput       = input(title="Plot Bullish", defval=true, group='RSI Divergence Settings')
plotHiddenBullInput = input(title="Plot Hidden Bullish", defval=true, group='RSI Divergence Settings')
plotBearInput       = input(title="Plot Bearish", defval=true, group='RSI Divergence Settings')
plotHiddenBearInput = input(title="Plot Hidden Bearish", defval=true, group='RSI Divergence Settings')
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
//--- RSI Calculation -------------------------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
rsi         = ta.rsi(rsiSourceInput, rsiLengthInput)
rsiprevious = rsi 
  = request.security(syminfo.tickerid, rsiTF1,  [rsi, rsi , rsi ], lookahead=barmerge.lookahead_on)
  = request.security(syminfo.tickerid, rsiTF2,  [rsi, rsi , rsi ], lookahead=barmerge.lookahead_on)
  = request.security(syminfo.tickerid, rsiTF3,  [rsi, rsi , rsi ], lookahead=barmerge.lookahead_on)
  = request.security(syminfo.tickerid, rsiTF4,  [rsi, rsi , rsi ], lookahead=barmerge.lookahead_on)
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
//--- MA Calculation -------------------------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
ma(source, length, type) =>
    switch type
        "SMA" => ta.sma(source, length)
        "Bollinger Bands" => ta.sma(source, length)
        "EMA" => ta.ema(source, length)
        "SMMA (RMA)" => ta.rma(source, length)
        "WMA" => ta.wma(source, length)
        "VWMA" => ta.vwma(source, length)
rsiMA         = ma(rsi, maLengthInput, maTypeInput)
rsiMAPrevious = rsiMA 
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
//--- Stoch RSI Settings + Calculation --------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
showStochRSI    = input(false, title="Show Stochastic RSI", group='Stochastic RSI Settings')
smoothK         = input.int(title="Stochastic K", defval=3, minval=1,  maxval=10, group='Stochastic RSI Settings')
smoothD         = input.int(title="Stochastic D", defval=4, minval=1,  maxval=10, group='Stochastic RSI Settings')
lengthRSI       = input.int(title="Stochastic RSI Lenght", defval=14, minval=1, group='Stochastic RSI Settings')
lengthStoch     = input.int(title="Stochastic Lenght", defval=14, minval=1, group='Stochastic RSI Settings')
colorK          = input.color(color.rgb(41,98,255,0), title="K Color",  group='Stochastic RSI Settings', inline="1")
colorD          = input.color(color.rgb(205,109,0,0), title="D Color",  group='Stochastic RSI Settings', inline="1")
StochRSI    = ta.rsi(rsiSourceInput, lengthRSI)
k       = ta.sma(ta.stoch(StochRSI, StochRSI, StochRSI, lengthStoch), smoothK) //Blue Line
d       = ta.sma(k, smoothD) //Red Line
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
//--- Divergence Settings ------------------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
bearColor = color.red
bullColor = color.green
hiddenBullColor = color.new(color.green, 50)
hiddenBearColor = color.new(color.red, 50)
//textColor = color.white
noneColor = color.new(color.white, 100)
osc = rsi
plFound = na(ta.pivotlow(osc, lblInput, lbrInput)) ? false : true
phFound = na(ta.pivothigh(osc, lblInput, lbrInput)) ? false : true
_inRange(cond) =>
	bars = ta.barssince(cond == true)
	lbRangeMinInput <= bars and bars <= lbRangeMaxInput 
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
//--- Define Plot & Line Colors ---------------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
rsiColor = rsi >= rsiMA ? rsiColorInput : rsimaColorInput
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
//--- Plot Lines ------------------------------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
// Create a horizontal line at a specific price level
myLine = line.new(bar_index , 75, bar_index, 75, color = color.rgb(187, 14, 14), width = 2)
bottom = line.new(bar_index , 50, bar_index, 50, color = color.rgb(223, 226, 28), width = 2)
mymainLine = line.new(bar_index , 60, bar_index, 60, color = color.rgb(13, 154, 10), width = 3)
hline(50, title='RSI Baseline', color=color.new(rsiBandColorInput, 50), linestyle=hline.style_solid, editable=false)   
hline(rsiBandExtShowInput ? rsiUpperBandExtInput : na,  title='RSI Upper Band',  color=color.new(rsiBandColorInput, 10), linestyle=hline.style_dashed, editable=false)  
hline(rsiBandShowInput ? rsiUpperBandInput : na,  title='RSI Upper Band',  color=color.new(rsiBandColorInput, 10), linestyle=hline.style_dashed, editable=false) 
hline(rsiBandShowInput ? rsiLowerBandInput : na,  title='RSI Upper Band',  color=color.new(rsiBandColorInput, 10), linestyle=hline.style_dashed, editable=false) 
hline(rsiBandExtShowInput ? rsiLowerBandExtInput : na,  title='RSI Upper Band',  color=color.new(rsiBandColorInput, 10), linestyle=hline.style_dashed, editable=false)
bgcolor(rsiHighlightShowInput ? rsi >= rsiUpperBandExtInput ? color.new(rsiColorInput, 70) : na : na, title="Show Extended Oversold Highlight", editable=false)
bgcolor(rsiHighlightShowInput ? rsi >= rsiUpperBandInput ? rsi < rsiUpperBandExtInput ? color.new(#64ffda, 90) : na : na: na, title="Show Overbought Highlight", editable=false)
bgcolor(rsiHighlightShowInput ? rsi <= rsiLowerBandInput ? rsi > rsiLowerBandExtInput ? color.new(#F43E32, 90) : na : na : na, title="Show Extended Oversold Highlight", editable=false)
bgcolor(rsiHighlightShowInput ? rsi <= rsiLowerBandInput ? color.new(rsimaColorInput, 70) : na : na, title="Show Oversold Highlight", editable=false)
maPlot     = plot(maShowInput ? rsiMA : na, title='MA', color=color.new(maColorInput,0), linewidth=1)
rsiMAPlot  = plot(showRSIMAInput ? rsiMA : na, title="RSI EMA", color=color.new(rsimaColorInput,0), editable=false, display=display.none)
rsiPlot    = plot(rsiShowInput ? rsi : na, title='RSI', color=color.new(rsiColor,0), linewidth=1)
fill(rsiPlot, rsiMAPlot, color=color.new(rsiColor, 60), title="RSIMA Cloud")
plot(showStochRSI ? k : na, title='Stochastic K', color=colorK, linewidth=1)
plot(showStochRSI ? d : na, title='Stochastic D', color=colorD, linewidth=1)
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
//--- Plot Divergence -------------------------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
// Regular Bullish
// Osc: Higher Low
oscHL = osc  > ta.valuewhen(plFound, osc , 1) and _inRange(plFound )
// Price: Lower Low
priceLL = low  < ta.valuewhen(plFound, low , 1)
bullCond = plotBullInput and priceLL and oscHL and plFound
plot(
     plFound ? osc  : na,
     offset=-lbrInput,
     title="Regular Bullish",
     linewidth=2,
     color=(bullCond ? bullColor : noneColor)
     )
plotshape(
     DivergenceShowInput ? bullCond ? osc  : na : na,
     offset=-lbrInput,
     title="Regular Bullish Label",
     text=" Bull ",
     style=shape.labelup,
     location=location.absolute,
     color=bullColor,
     textcolor=textColor
     )
//------------------------------------------------------------------------------
// Hidden Bullish
// Osc: Lower Low
oscLL = osc  < ta.valuewhen(plFound, osc , 1) and _inRange(plFound )
// Price: Higher Low
priceHL = low  > ta.valuewhen(plFound, low , 1)
hiddenBullCond = plotHiddenBullInput and priceHL and oscLL and plFound
plot(
	 plFound ? osc  : na,
	 offset=-lbrInput,
	 title="Hidden Bullish",
	 linewidth=2,
	 color=(hiddenBullCond ? hiddenBullColor : noneColor)
	 )
plotshape(
	 DivergenceShowInput ? hiddenBullCond ? osc  : na : na,
	 offset=-lbrInput,
	 title="Hidden Bullish Label",
	 text=" H Bull ",
	 style=shape.labelup,
	 location=location.absolute,
	 color=bullColor,
	 textcolor=textColor
	 )
//------------------------------------------------------------------------------
// Regular Bearish
// Osc: Lower High
oscLH = osc  < ta.valuewhen(phFound, osc , 1) and _inRange(phFound )
// Price: Higher High
priceHH = high  > ta.valuewhen(phFound, high , 1)
bearCond = plotBearInput and priceHH and oscLH and phFound
plot(
	 phFound ? osc  : na,
	 offset=-lbrInput,
	 title="Regular Bearish",
	 linewidth=2,
	 color=(bearCond ? bearColor : noneColor)
	 )
plotshape(
	 DivergenceShowInput ? bearCond ? osc  : na : na,
	 offset=-lbrInput,
	 title="Regular Bearish Label",
	 text=" Bear ",
	 style=shape.labeldown,
	 location=location.absolute,
	 color=bearColor,
	 textcolor=textColor
	 )
//------------------------------------------------------------------------------
// Hidden Bearish
// Osc: Higher High
oscHH = osc  > ta.valuewhen(phFound, osc , 1) and _inRange(phFound )
// Price: Lower High
priceLH = high  < ta.valuewhen(phFound, high , 1)
hiddenBearCond = plotHiddenBearInput and priceLH and oscHH and phFound
plot(
	 phFound ? osc  : na,
	 offset=-lbrInput,
	 title="Hidden Bearish",
	 linewidth=2,
	 color=(hiddenBearCond ? hiddenBearColor : noneColor)
	 )
plotshape(
	 DivergenceShowInput ? hiddenBearCond ? osc  : na : na,
	 offset=-lbrInput,
	 title="Hidden Bearish Label",
	 text=" H Bear ",
	 style=shape.labeldown,
	 location=location.absolute,
	 color=bearColor,
	 textcolor=textColor
	 )
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
//--- Check RSI Lineup ------------------------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
bullTF =  rsi > rsi  and rsi  > rsi 
bearTF =  rsi < rsi  and rsi  < rsi 
bullTF1 =  rsi1 > rsi1_1 and rsi1_1 > rsi1_2
bearTF1 =  rsi1 < rsi1_1 and rsi1_1 < rsi1_2
bullTF2 =  rsi2 > rsi2_1 and rsi2_1 > rsi2_2
bearTF2 =  rsi2 < rsi2_1 and rsi2_1 < rsi2_2
bullTF3 =  rsi3 > rsi3_1 and rsi3_1 > rsi3_2
bearTF3 =  rsi3 < rsi3_1 and rsi3_1 < rsi3_2
bullTF4 =  rsi4 > rsi4_1 and rsi4_1 > rsi4_2
bearTF4 =  rsi4 < rsi4_1 and rsi4_1 < rsi4_2
bbTxt(bull,bear) =>
    bull ? "BULLISH" : bear ? "BEARISCH" : 'NO LINEUP'
bbColor(bull,bear) =>
    bull ? bullishColor : bear ? bearishColor : nomatchColor
newTC(tBox, col, row, txt, width, txtColor, bgColor, txtHA, txtSize) =>
    table.cell(table_id=tBox,column=col, row=row, text=txt, width=width,text_color=txtColor,bgcolor=bgColor, text_halign=txtHA, text_size=txtSize)
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
//--- Define RSI Table Setting ----------------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
width_c0 = 0
width_c1 = 0
if rsiShowTable
    var tBox = table.new(position=rsiTablePosition, columns=5, rows=6, bgcolor=color.rgb(18,22,33,50), frame_color=color.black, frame_width=1, border_color=color.black, border_width=1)
    newTC(tBox, 0,1,"RSI Current",width_c0,color.orange,color.rgb(0,0,0,100),'right',rsiTextSize)
    newTC(tBox, 1,1,str.format(" {0,number,#.##} ", rsi),width_c0,vWhite,rsi < 50 ? bearishColor:bullishColor,'left',rsiTextSize)
    newTC(tBox, 4,1,bbTxt(bullTF, bearTF),width_c0,vWhite,bbColor(bullTF, bearTF),'center',rsiTextSize)
    if rsiShowHist
        newTC(tBox, 2,1,str.format(" {0,number,#.##} ", rsi ),width_c0,vWhite,rsi  < 50 ? bearishColor:bullishColor,'left',rsiTextSize)
        newTC(tBox, 3,1,str.format(" {0,number,#.##} ", rsi ),width_c0,vWhite,rsi  < 50 ? bearishColor:bullishColor,'left',rsiTextSize)
    if rsiShowTF1
        newTC(tBox, 0,2,TF2txt(rsiTF1),width_c0,vWhite,color.rgb(0,0,0,100),'right',rsiTextSize)
        newTC(tBox, 1,2,str.format(" {0,number,#.##} ", rsi1),width_c0,vWhite,rsi1 < 50 ? bearishColor:bullishColor,'left',rsiTextSize)
        newTC(tBox, 4,2,bbTxt(bullTF1, bearTF1),width_c0,vWhite,bbColor(bullTF1,bearTF1),'center',rsiTextSize)
        if rsiShowHist
            newTC(tBox, 2,2,str.format(" {0,number,#.##} ", rsi1_1),width_c0,vWhite,rsi1_1 < 50 ? bearishColor:bullishColor,'left',rsiTextSize)
            newTC(tBox, 3,2,str.format(" {0,number,#.##} ", rsi1_2),width_c0,vWhite,rsi1_2 < 50 ? bearishColor:bullishColor,'left',rsiTextSize)
    if rsiShowTF2
        newTC(tBox, 0,3,TF2txt(rsiTF2),width_c0,vWhite,color.rgb(0,0,0,100),'right',rsiTextSize)
        newTC(tBox, 1,3,str.format(" {0,number,#.##} ", rsi2),width_c0,vWhite,rsi2 < 50 ? bearishColor:bullishColor,'left',rsiTextSize)
        newTC(tBox, 4,3,bbTxt(bullTF2, bearTF2),width_c0,vWhite,bbColor(bullTF2,bearTF2),'center',rsiTextSize)
        if rsiShowHist
            newTC(tBox, 2,3,str.format(" {0,number,#.##} ", rsi2_1),width_c0,vWhite,rsi2_1 < 50 ? bearishColor:bullishColor,'left',rsiTextSize)
            newTC(tBox, 3,3,str.format(" {0,number,#.##} ", rsi2_2),width_c0,vWhite,rsi2_2 < 50 ? bearishColor:bullishColor,'left',rsiTextSize)
    if rsiShowTF3
        newTC(tBox, 0,4,TF2txt(rsiTF3),width_c0,vWhite,color.rgb(0,0,0,100),'right',rsiTextSize)
        newTC(tBox, 1,4,str.format(" {0,number,#.##} ", rsi3),width_c0,vWhite,rsi3 < 50 ? bearishColor:bullishColor,'left',rsiTextSize)
        newTC(tBox, 4,4,bbTxt(bullTF3, bearTF3),width_c0,vWhite,bbColor(bullTF3,bearTF3),'center',rsiTextSize)
        if rsiShowHist
            newTC(tBox, 2,4,str.format(" {0,number,#.##} ", rsi3_1),width_c0,vWhite,rsi3_1 < 50 ? bearishColor:bullishColor,'left',rsiTextSize)
            newTC(tBox, 3,4,str.format(" {0,number,#.##} ", rsi3_2),width_c0,vWhite,rsi3_2 < 50 ? bearishColor:bullishColor,'left',rsiTextSize)
    if rsiShowTF4
        newTC(tBox, 0,5,TF2txt(rsiTF4),width_c0,vWhite,color.rgb(0,0,0,100),'right',rsiTextSize)
        newTC(tBox, 1,5,str.format(" {0,number,#.##} ", rsi4),width_c0,vWhite,rsi4 < 50 ? bearishColor:bullishColor,'left',rsiTextSize)
        newTC(tBox, 4,5,bbTxt(bullTF4, bearTF4),width_c0,vWhite,bbColor(bullTF4,bearTF4),'center',rsiTextSize)
        if rsiShowHist
            newTC(tBox, 2,5,str.format(" {0,number,#.##} ", rsi4_1),width_c0,vWhite,rsi4_1 < 50 ? bearishColor:bullishColor,'left',rsiTextSize)
            newTC(tBox, 3,5,str.format(" {0,number,#.##} ", rsi4_2),width_c0,vWhite,rsi4_2 < 50 ? bearishColor:bullishColor,'left',rsiTextSize)
//------------------------------------------------------
//--- Alerts -------------------------------------------
//------------------------------------------------------
Tristan's Tri-band StrategyTristan's Tri-band Strategy - Confluence Trading System 
Strategy Overview:
 
 This strategy combines three powerful technical indicators - RSI, Williams %R, and Bollinger Bands - into a single visual trading system. Instead of cluttering your chart with separate indicator panels, all signals are displayed directly on the price chart using color-coded gradient overlays, making it easy to spot high-probability trade setups at a glance.
 
 How It Works: 
The strategy identifies trading opportunities when multiple indicators align (confluence), suggesting strong momentum shifts:
 📈 Long Entry Signals: 
 
 RSI drops to 30 or below (oversold)
 Williams %R reaches -80 to -100 range (oversold)
 Price touches or breaks below the lower Bollinger Band
 All three conditions must align during your selected trading session
 
 📉 Short Entry Signals: 
 
 RSI rises to 70 or above (overbought)
 Williams %R reaches 0 to -20 range (overbought)
 Price touches or breaks above the upper Bollinger Band
 All three conditions must align during your selected trading session
 
Visual Indicators:
 
 (faint) Green gradients below candles = Bullish oversold conditions (buying opportunity)
 (faint) Red/Orange gradients above candles = Bearish overbought conditions (selling opportunity)
 Stacked/brighter gradients = Multiple indicators confirming the same signal (higher probability) will stack and show brighter / less faint
 Blue Bollinger Bands = Volatility boundaries and mean reversion zones
 
 Exit Strategy: 
 
 Long trades exit when price reaches the upper Bollinger Band OR RSI becomes overbought (≥70)
 Short trades exit when price reaches the lower Bollinger Band OR RSI becomes oversold (≤30)
 
 Key Features: 
✅ Session Filters - Trade only during NY (9:30 AM-4 PM), London (3 AM-11:30 AM), or Asia (7 PM-1 AM EST) sessions
✅ No Repainting - Signals are confirmed on candle close for realistic backtesting and live trading
✅ Customizable Parameters - Adjust RSI levels, BB standard deviations, Williams %R periods, and gradient visibility
✅ Visual Clarity - See all three indicators at once without switching between panels
✅ Built-in Alerts - Get notified when entry and exit conditions are met
 How to Use Effectively: 
 
 Choose Your Trading Session - For day trading US stocks, enable only the NY session. For forex or 24-hour markets, select the sessions that match your schedule.
 Look for Gradient Stacking - The brightest, most visible gradients occur when both RSI and Williams %R signal together. These are your highest-probability setups.
 Confirm with Price Action - Wait for the candle to close before entering. The strategy enters on the next bar's open to prevent repainting.
 Respect the Bollinger Bands - Entries occur at the outer bands (price extremes), and exits occur at the opposite band or when momentum reverses.
 Backtest First - Test the strategy on your preferred instruments and timeframes. Works best on liquid assets with clear trends and mean reversion patterns (stocks, major forex pairs, indices).
 Adjust Gradient Visibility - Use the "Gradient Strength" slider (lower = more visible) to make signals stand out on your chart style.
 
Best Timeframes: 5-minute to 1-hour charts for intraday trading; 4-hour to daily for swing trading  (I have also found the 3 hour timeframe to work really well for some stocks / ETFs.) 
Best Markets: Liquid instruments with volatility - SPY, QQQ, major stocks, EUR/USD, GBP/USD, major indices
Risk Management: This is a mean reversion strategy that works best in ranging or choppy markets. In strong trends, signals may appear less frequently. Always use proper position sizing and stop losses based on your risk tolerance.
----------------------------------------------
Note: Past performance does not guarantee future results. This strategy is provided for educational purposes. Always backtest thoroughly and practice proper risk management before live trading.RetryClaude can make mistakes. Please double-check responses. Sonnet 4.5
NY VIX Channel Trend US Futures Day Trade StrategyNY VIX Channel Trend Strategy
 Summary in one paragraph
 Session anchored intraday strategy for index futures such as ES and NQ on one to fifteen minute charts. It acts only after the first configurable window of New York Regular Trading Hours and uses a VIX derived daily implied move to form a realistic channel from the session open. Originality comes from using a pure implied volatility yardstick as portable support and resistance, then committing in the direction of the first window close relative to the open. Add it to a clean chart and trade the simple visuals. For conservative alerts use on bar close.
 Scope and intent
 • Markets. Index futures ES and NQ
• Timeframes. One to thirty minutes
• Default demo. ES1 on five minutes
• Purpose. Provide a portable intraday yardstick for entries and exits without curve fitting
• Limits. This is a strategy. Orders are simulated on standard candles
 Originality and usefulness
 • Unique concept. A VIX only channel anchored at 09:30 New York plus a single window trend test
• Addresses. False urgency at session open and unrealistic bands from arbitrary multipliers
• Testability. Every input is visible and the channel is plotted so users can audit behavior
• Portable yardstick. Daily implied move equals VIX percent divided by square root of two hundred fifty two
• Protected status. None. Method and use are fully disclosed
 Method overview in plain language
 Take the daily VIX or VIX9D value, convert it to a daily fraction by dividing by square root of two hundred fifty two, then anchor a symmetric channel at the New York session open. Observe the first N minutes. If that window closes above the open the bias is long. If it closes below the open the bias is short. One trade per session. Exits occur at the channel boundary or at a bracket based on a user selected VIX factor. Positions are closed a set number of minutes before the session ends.
 Base measures
 Return basis. The daily implied move unit equals VIX percent divided by square root of two hundred fifty two and serves as the distance unit for targets and stops.
 Components
 • VIX Channel. Top, mid, bottom lines anchored at 09:30 New York. No extra multipliers
• Window Trend. Close of the first N minutes relative to the session open sets direction
• Risk Bracket. Take profit and stop loss equal to VIX unit times user factor
• Session Window. Uses the exchange time of the chart
 Fusion rule
 Minimum gates count equals one. The trade only arms after the window has elapsed and a direction exists. One entry per session.
 Signal rule
 • Long when the window close is above the session open and the window has completed
• Short when the window close is below the session open and the window has completed
• Exit on channel touch. Long exits at the top. Short exits at the bottom
• Flat thirty minutes before the session close or at the user setting
 Inputs with guidance
 Setup
• Use VIX9D. Width source. Typical true for fast tone or false for baseline
• Use daily OPEN. Toggle for sensitivity to overnight changes
Logic
• Window minutes. Five to one hundred twenty. Larger values delay entries and reduce whipsaw
• VIX factor for TP. Zero point five to two. Raising it widens the profit target
• VIX factor for SL. Zero point five to two. Raising it widens the stop
• Exit minutes before close. Fifteen to ninety. Raising it exits earlier
Properties visible in this publication
• Initial capital one hundred thousand USD
• Base currency USD
• request.security uses lookahead off
• Commission cash per contract two point five $ per each contract. Slippage one tick
• Default order size method FIXED with value one contract. Pyramiding zero. Process orders on close ON. Bar magnifier OFF. Recalculate after order is filled OFF. Calc on every tick ON
 Realism and responsible publication
 No performance claims. Past results never guarantee future outcomes. Fills and slippage vary by venue. Shapes can move while a bar forms and settle on close. Strategy uses standard candles.
 Honest limitations and failure modes
 Economic releases and thin liquidity can break the channel. Very quiet regimes can reduce signal contrast. Session windows follow the exchange time of the chart. If both stop and target can be hit within one bar, assume stop first for conservative reading without bar magnifier.
Works best in liquid hours of New York RTH. Very large gaps and surprise news may exceed the implied channel. Always validate on the symbols you trade.
 Entries and exits
 • Entry logic. After the first window, go long if the window close is above the session open, go short if below
• Exit logic. Long exits at the channel top or at the take profit or stop. Short exits at the channel bottom or at the take profit or stop. Flat before session close by the configured minutes
• Risk model. Initial stop and target based on the VIX unit times user factors. No trail and no break even. No cooldown
• Tie handling. Treat as stop first for conservative interpretation
 Position sizing
 Fixed size one contract per trade. Target risk per trade should generally remain near one percent of account equity. Risk is based on the daily volatility value, the max loss from the tests for one year duration with 5min chart was 4%, while the avg loss was below <1% of the total capital.
If you have any questions please let me know. Thank you for coming by !
Yang-Zhang Volatility (YZVol) by CoryP1990 – Quant ToolkitThe Yang-Zhang Volatility (YZVol) estimator measures realized volatility using both overnight gaps and intraday moves. It combines three components: overnight returns, open-to-close returns, and the Rogers–Satchell term, weighted by Zhang’s k to reduce bias.
 How to read it 
Line color: Green when YZVol is rising (volatility expansion), Red when falling (volatility compression).
Background: Green tint = above High-vol threshold (active regime). Red tint = below Low-vol threshold (quiet regime).
Units: Displays Daily % by default on any timeframe (values are normalized to daily). An optional toggle shows Annualized % (√252 × Daily %).
 Typical uses 
Spot transitions between quiet and active regimes.
Compare realized vol vs implied vol or a risk-target.
Adapt position sizing to volatility clustering.
 Defaults 
Length = 20
High-vol threshold = 5% (Daily)
Low-vol threshold = 1% (Daily)
Optional: Annualized % display
 Example — SPY (1D) 
During the 2020 crash, YZVol surged to 5.8 % per day, capturing the height of pandemic-era volatility before compressing into a calm regime through 2021. Volatility re-expanded in 2022 due to reinflamed COVID fears and gradually stabilized through 2023. A sharp, liquidity-driven volatility event in August 2024 caused another brief YZVol surge, reflecting the historic one-day VIX spike triggered by market-wide risk-off flows and thin pre-market liquidity. A second, policy-driven expansion followed in April–May 2025, coinciding with the renewed U.S.–China tariff conflict and a sharp equity pullback. Since mid-2025, YZVol has settled near 1 % per day, with the red background confirming that realized volatility has once again compressed into a quiet, low-risk regime.
 Part of the Quant Toolkit — transparent, open-source indicators for modern quantitative analysis. Built by CoryP1990.
Inyerneck UT Bot with 9 EMA Filter With Signals (Tight) v: 4.20this script is a customized version of the UT bot, enhanced with 9ema trend filter for cleaner entries.designed for short term traders to reduce noise and avoid false signals during choppy price action. youll only see signals when price action confirms momentum aligned with trend as defined by EMA.  try adjusting sensitivity and ATR period to your liking. my current setting is ATR 6,Sensitivity 3.8,EMA 9 to 11... 
VIX/VVIX Spike RiskVIX/VVIX Spike Risk Analyzer  
The VIX/VVIX Spike Risk Analyzer analyzes historical VIX behavior under similar market conditions to forecast future VIX spike risk. 
By combining current VIX and VVIX levels as dual filters, it identifies historical precedents and calculates the probability and magnitude of VIX spikes over the next 1, 5, and 10 trading days.
 IMPORTANT: This indicator must be applied to the VIX chart (CBOE:VIX) to function correctly. 
 Methodology 
 1. Dual-Filter Pattern Matching 
The indicator uses both VIX and VVIX as simultaneous filters to identify historically analogous market conditions:
By requiring BOTH metrics to match historical levels, the indicator creates more precise market condition filters than using VIX alone. This dual-filter approach significantly improves predictive accuracy because:
VIX alone might be at 15, but VVIX can tell us if that 15 is stable (low VVIX) or explosive (high VVIX)
High VVIX + Low VIX often precedes major spikes
Low VVIX + Low VIX suggests sustained calm
 2. Tolerance Settings 
VIX Matching (Default: ±10% Relative)
Uses relative percentage matching for consistency across different VIX regimes
Example: VIX at 15 matches 13.5-16.5 (±10%)
Can switch to absolute tolerance (±5 points) if preferred
VVIX Matching (Default: ±10 Points Absolute)
Uses absolute point matching as VVIX scales differently
Example: VVIX at 100 matches 90-110
Can switch to relative percentage if preferred
 3. Historical Analysis Window 
The indicator scans up to 500 bars backward (limited by VVIX data availability) to find all historical periods where both VIX and VVIX were at similar levels. Each match becomes a "sample" for statistical analysis.
 4. Forward-Looking Spike Analysis 
For each historical match, the indicator measures VIX behavior over the next 1, 5, and 10 days
 Display Metrics Explained
 
 Average Highest Spike 
Shows the average of the maximum VIX spikes observed.
 Highest Single Spike 
Shows the single largest spike ever recorded
 Probability No 10% Spike 
Shows what percentage of historical cases stayed BELOW a 10% spike:
 Probability No 20% Spike 
Shows what percentage of historical cases stayed BELOW a 20% spike:
 Note : You'll see many more shaded bars than the sample count because each match creates up to 5 consecutive shaded bars (bars 1-5 after the match all "look back" and see it).
 Short Volatility Strategies: 
Enter when there's a LOW probability of big vol spikes based on today's metrics
 Long Volatility Strategies 
Enter when there's a HIGH probability of big vol spikes based on today's metrics
India Vix based Strangle StrikesA clean Nifty–VIX dashboard that converts India VIX into expected daily moves, price ranges, and suggested strangle strikes. Includes VIX %, expanded 1.2× range, and smart rounded strike levels for options trading.
This script provides a professional on-chart dashboard that converts India VIX into actionable trading levels for Nifty. It calculates the VIX-based expected daily move, projected price ranges, expanded 1.2× ranges, and suggested strangle strike prices. Includes clean formatting, color-coded sections, and real-time updates.
Ideal for traders using straddles, strangles, intraday volatility models, range-bound setups, and options-based risk management.
1.2x expanded range is better success probability, may keep 20% of strangle value as stop loss. 
The vix based system is intended to give approx. 70%+ success rate.
detects bottom rebound signal🧩 General Idea:
This indicator detects bottom rebound signals — the start of an upward move after a downtrend — using a combination of RSI + price + volume.
⚙️ How the Indicator Works:
Calculates the RSI (Relative Strength Index) using a 14-period length.
→ Purpose: Measure momentum after a decline.
Monitors upward RSI crossovers at levels 45, 50, 55, and 60.
→ Purpose: Confirm that momentum is shifting from bearish to bullish.
Checks for a price increase of more than 2% compared to the previous close.
→ Purpose: Ensure that the move is strong and not just a small fluctuation.
Confirms that today’s volume is higher than yesterday’s.
→ Purpose: Validate that buying pressure is supported by real market activity.
When all conditions are met together ⇒ a rebound signal is generated ✅
(It plots a value of 1 as a histogram — can be used as a filter).
Triggers an alert when a rebound signal occurs — so you can get notified automatically in TradingView.
🎯 Indicator Purpose:
To identify stocks that are truly rebounding from their bottom, confirming it through momentum, price strength, and volume — often highlighting early entry opportunities before a larger uptrend.
🧩 الفكرة العامة:
يرصد لحظات ارتداد السهم من القاع — أي بداية صعود بعد فترة نزول — اعتمادًا على RSI + السعر + الحجم.
⚙️ خطوات عمل المؤشر:
يحسب مؤشر القوة النسبية (RSI) بطول 14 شمعة.
الهدف: قياس الزخم بعد نزول طويل.
يراقب تقاطعات RSI لأعلى عند المستويات (45، 50، 55، 60).
الهدف: تأكيد أن الزخم بدأ يتحول من سالب إلى موجب.
يتحقق من ارتفاع السعر أكثر من 2٪ مقارنةً بالإغلاق السابق.
الهدف: التأكد أن الصعود حقيقي وليس مجرد تذبذب بسيط.
يتأكد أن حجم التداول اليوم أكبر من اليوم السابق.
الهدف: وجود دعم حقيقي من المشترين (تأكيد على دخول سيولة).
عند تحقق كل الشروط السابقة معًا ⇒ يعطي إشارة ارتداد من القاع ✅
(يرسم عمودًا بقيمة 1 في الأسفل ويمكن استخدامه كفلتر).
يصدر تنبيه (Alert) عند تحقق الإشارة لتتابعها تلقائيًا في TradingView.
🎯 الهدف من المؤشر:
تحديد الأسهم التي بدأت ترتد فعليًا من القاع مع تأكيد الزخم والحجم والسعر — وهي غالبًا فرص دخول مبكرة قبل استمرار الصعود.
تنبيه مهم: يعمل كفلتر نبيه على قائمة محددة ولا يظهر على الشارت
VIX Regime AnalyzerVIX Regime Analyzer 
The VIX Regime Analyzer is an analytical tool that examines historical VIX patterns to provide insights into how your asset typically performs under similar volatility conditions.
 Key Features: 
 Historical Pattern Matching: Automatically scans up to 1,000 bars of history to find all periods when VIX was at levels similar to today, using customizable tolerance ranges (absolute or percentage-based).
 Forward-Looking Statistics: For each VIX regime match, calculates what actually happened to your asset over the next 1, 5, 10, and 20 trading days, providing both average returns and probability of positive outcomes.
 Regime Classification System: Intelligently categorizes the current market environment as bullish or bearish: Visual Historical Context:  
Background shading throughout your chart highlights every historical period when VIX matched current levels, color-coded by subsequent performance (green for gains, red for losses).
 User Inputs: 
 VIX Level Tolerance (+/-): How closely VIX must match (default: ±5 points)
 Use Relative Tolerance (%): Switch to percentage-based matching for consistency across different VIX levels
 Lookback Period: How many bars to analyze
 Highlight Historical VIX Matches: Toggle background highlighting of past matching periods
 The Data Table 
The statistics box appears in the right handside of your chart and contains three main sections:
 Section 1: VIX REGIME 
Current VIX: The live VIX closing price
Range: The tolerance band being searched (e.g., if VIX is 18 with ±5 tolerance, range is 13-23)
Historical Samples: Number of matching periods found in the lookback window (minimum 10 required for statistical validity)
 Section 2: FORWARD RETURN 
Shows the average percentage change in your asset over different timeframes following similar VIX levels:
Avg Next Day: What typically happened by the next trading session
Avg Next 5 Days: Average 5-day forward performance
Avg Next 10 Days: Average 10-day forward performance
Avg Next 20 Days: Average 20-day forward performance (approximately 1 month)
 Section 3: PROBABILITY UP 
Shows the win rate - the percentage of times your asset closed higher after VIX matched current levels:
Next Day: Probability of being up the next session
Next 5 Days: Probability of being up after 5 days
Next 10 Days: Probability of being up after 10 days
Next 20 Days: Probability of being up after 20 days
 Colors: 
🟢 Green: Bullish regimes (various strengths)
🔴 Red: Bearish regimes (various strengths)
🟡 Yellow: Choppy/uncertain regime
 When "Highlight Historical VIX Matches" is enabled: 
Scroll back through your chart and you'll see colored backgrounds highlighting every period when VIX matched today's level. The color tells you whether that match led to gains (green) or losses (red). This provides instant visual pattern recognition - you can quickly see if similar VIX levels historically led to bullish or bearish outcomes.
 Practical Example: 
If you see that most historical periods with similar VIX levels are highlighted in green, it suggests the current VIX level has historically been a bullish signal for your asset.
How The Indicator Makes Decisions
The regime classification uses both magnitude AND probability to avoid false signals:
Example of Strong Classification:
Average 5-day return: +1.5%
Win rate: 65%
Result: STRONG BULLISH (both high return and high probability)
Example of Weak Signal:
Average 5-day return: +2.0%
Win rate: 35%
Result: CHOPPY (high average but low consistency = unreliable)
This dual-factor approach ensures the indicator doesn't mislead you with regimes that had a few huge winners but mostly losers, or vice versa.
 Best Practices 
Combine with your existing strategy: Use this as a regime filter rather than standalone signals
Check sample size: More historical matches = more reliable statistics
Consider multiple timeframes: If 5-day and 20-day metrics disagree, proceed with caution
Asset-specific tuning: Different assets may require different tolerance settings
VIX spikes: The indicator is particularly useful during VIX spikes to understand if panic is justified
 What Makes This Different 
Unlike simple VIX indicators that just plot the fear index, this tool:
 Quantifies the actual impact of VIX levels on YOUR specific asset
 Provides probability-based forecasts rather than subjective interpretation
 Shows historical context visually so you can see patterns at a glance
 Uses rigorous statistical criteria to avoid false regime classifications























