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.
Volatilità
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.
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.
Volatility Heat-Map, momentum ribbon and divergence detectorThis is a comprehensive volatility + momentum + volume + ATR dashboard with table visualization, momentum ribbon, and divergence detection. It’s optimized for visual clarity with dynamic coloring and is suitable for both trend-following and mean-reversion traders.
Table shows:
Oscillator values with arrows and K/D status.
Current & Daily ATR with tops/bottoms.
Volume & % change, rising/falling indicator.
Volatility regime (Low/Normal/High) with color coding.
Momentum strength (strong/weak bullish/bearish).
Oscillator
stoch = hh != ll ? 100 * (src - ll) / (hh - ll) : 0
k = smooth(stoch, kSmoothing)
d = smooth(k, dSmoothing)
Standard stochastic normalization.
Smoothing based on selected type (SMA/EMA/WMA).
diff between K and D is normalized for the momentum ribbon color:
Greenish for bullish, red for bearish, silver for neutral.
Overbought / Oversold lines: 80/20, midline at 50.
4. BBWP Calculation
bbwp = f_bbwp(i_priceSrc, i_bbwpLen, i_bbwpLkbk, i_basisType)
bbwpSMA5 = f_maType(bbwp, 5, "SMA")
Heatmap Thresholds:
Low < 15%
High > 85%
Otherwise Normal.
Colors dynamically assigned for histogram and table background.
Plotted as columns if table
Bullish and Bearish divergence labels plotted, both regular and hidden.
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.
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.
MIG and MC 发布简介(中文)
MIG and MC 指标帮助日内交易者快速识别微型缺口(Micro Gap)与微型通道(Micro Channel)。脚本支持过滤开盘跳空、合并连续缺口,并自动绘制
FPL(Fair Price Line)延伸线,既可追踪缺口是否被填补,也能直观标注潜在的趋势结构。为了确保跨周期一致性,最新版本对开盘前后和跨日场景做了专门处理
主要特性
- 自动检测并显示看涨/看跌微型缺口,支持按需合并连续缺口。
- 自定义是否忽略开盘缺口、缺口显示范围与 FPL 样式。
- FPL 触及后即停止延伸,辅助研判缺口是否真正回补。
- 内置强收盘与缺口过滤的微型通道识别,可选多种严格程度。
- 适用于 1/5/9 分钟等日内周期,也适用于更长周期。
Recommended English Description
The MIG and MC indicator highlights Micro Gaps and Micro Channels so you can track true intraday imbalances without noise. It merges
consecutive gaps, projects Fair Price Lines (FPL) that stop once touched, and offers a full intraday-ready opening-gap filter so your
early bars stay clean. The latest update refines cross-session handling, giving reliable gap plots on 1-, 5-, and 9-minute charts as well as higher time frames.
Key Features
- Detects bullish and bearish micro gaps with optional gap merging.
- Toggle opening-gap filters and configure look back, visibility, and FPL style.
- FPL lines stop as soon as price revisits the gap, making gap closure obvious.
- Micro Channel mode uses strong-close and gap filters to mark high-quality trend legs.
- Consistent behavior across intraday and higher time frames.
BB Pullback Strategy - Persistent Fractal TrendIn Uptrend, when price pullback and reach the lower band, expect it to bounce, thus enter buy at lower band.
In Downtrend, when price pullback and reach the upper band, expect it to bounce, thus enter sell at upper band.
Uptrend and Downtrend is decided by using William Fractal (3 bars) HH, HL, LH, LL
NSR - Dynamic Linear Regression ChannelOverview
The NSR - Dynamic Linear Regression Channel is a powerful overlay indicator that plots a dynamic regression-based channel around price action. Unlike static channels, this tool continuously recalculates the linear regression trendline from a user-defined starting point and builds upper and lower boundaries using a combination of standard deviation and maximum price deviations (highs/lows).
It visually separates "Premium" (overvalued) and "Discount" (undervalued) zones relative to the regression trend — ideal for mean-reversion, breakout, or trend-following strategies.
Key Features
Dynamic Regression Line Calculates slope, intercept, and average using full lookback from a reset point.
Adaptive Channel Width Combines standard deviation of residuals with max high/low deviations for robust boundaries.
Auto-Reset on Breakout Channel resets when price closes beyond upper/lower band twice in direction of trend .
Visual Zones Blue shaded = Premium (resistance zone)
Red shaded = Discount (support zone)
Real-Time Updates Live channel extends with each bar; historical channels preserved on reset.
How It Works
Regression Calculation
Uses all bars since last reset to compute the best-fit line:
y = intercept + slope × bar_position
Deviation Bands
Statistical : Standard deviation of price from regression line
Structural : Maximum distance from highs to line (upper) and lows to line (lower)
Final band = Regression Line ± (Deviation Input × StdDev)
Channel Reset Logic
Resets when:
Price closes above upper band twice in an uptrend (slope > 0)
OR closes below lower band twice in a downtrend (slope < 0)
Prevents overextension and adapts to new trends.
Visual Output
Active channel updates in real-time
Completed channels saved as historical reference (up to 500 lines/boxes)
Input Parameters
Deviation (2.0) - Multiplier for standard deviation to set channel width
Premium Color - blue color for upper (resistance) zone
Discount Color - red color for lower (support) zone
Best Use Cases
Mean Reversion - Buy near lower band in uptrend, sell near upper band
Breakout Trading - Enter on confirmed close beyond band + volume
Trend Confirmation - Use slope direction + price position in channel
Stop Loss / Take Profit - Place stops beyond opposite band
Pro Tips
Use on higher timeframes (4H, Daily) for cleaner regression fits
Combine with volume or momentum to filter false breakouts
Lower Deviation (e.g., 1.5) for tighter, more responsive channels
Watch channel resets — they often mark significant trend shifts
Why Use DLRC?
"Most channels are static. This one evolves with the market."
The NSR-DLRC gives you a mathematically sound, visually intuitive way to see:
Where price should be (regression)
Where it has been (deviation extremes)
When the trend is breaking structure
Perfect for traders who want regression-based precision without rigid assumptions.
Add to chart → Watch price dance within the evolving trend corridor.
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.
🎯 الهدف من المؤشر:
تحديد الأسهم التي بدأت ترتد فعليًا من القاع مع تأكيد الزخم والحجم والسعر — وهي غالبًا فرص دخول مبكرة قبل استمرار الصعود.
تنبيه مهم: يعمل كفلتر نبيه على قائمة محددة ولا يظهر على الشارت
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.
90D High % Pullback LinesAutomatically draws 10%, 20%, and 30% pullback lines based on the highest price over the past 90 days.
Mean Reversion Indicator — Buy the (DCA) Dip Signal (unbiased)Description
The Mean Reversion Signal — Buy the Dip (unbiased) indicator is designed to detect high-probability reversion points within Bitcoin’s cyclical market structure. These signals only appear when momentum has either fully reset on the Stochastic RSI (SRSI) or when a positive momentum reversal is beginning to form.
It combines 6H Relative Strength Index (RSI) data with 2-Week Stochastic RSI (SRSI) dynamics to identify exhaustion and early accumulation phases.
Core logic:
A buy signal appears when the 6H RSI closes below 30, indicating local oversold conditions.
The 2W Stochastic RSI confirms momentum alignment when both K & D are below 20 (deep oversold), above 80 (strong ongoing rally), or when K crosses above D (positive reversal).
The indicator is cycle-aware — active only after a defined date (e.g., 2023-01-01) to ensure it aligns with current market structure and avoids noise from pre-cycle conditions.
Additionally, green signals from previous bull cycles (e.g., 2015, 2019, 2020) are also displayed to highlight historically similar accumulation phases, allowing for cross-cycle comparison.
Color zones:
🟩 High probability of a durable new rally
🟧 Moderate probability zone
🔴 Momentum already extended; potential continuation but weaker signal
Recommended combinations:
For a deeper confirmation framework, this signal pairs well with:
- CoinGlass: Derivatives Risk Index Chart (to assess market (de)leveraging and derivatives pressure)
- BTC Futures Sentiment Index (Axel Adler Jr.) — (to monitor directional sentiment shifts)
- CheckonChain: Bitcoin — Short-Term Holder SOPR (to track realized profit-taking activity)
- CheckonChain: Bitcoin — Short-Term Holder MVRV (to evaluate valuation risk relative to cost basis)
Use case:
This tool helps traders identify favorable mean-reversion opportunities while considering broader cycle context and momentum structure.
It is not financial advice — best used alongside macro structure analysis, derivatives positioning, and on-chain behavior for comprehensive decision-making.
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 -------------------------------------------
//------------------------------------------------------
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
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.
Fractal Dimension Index (FDI) by CoryP1990 – Quant ToolkitThe Fractal Dimension Index (FDI) quantifies how directional or choppy price movement is; in other words, it measures the “roughness” of a trend. FDI values near 1.0–1.3 indicate strong directional trends, while values near 1.5–2.0 reflect chaotic or range-bound behavior. This makes FDI a powerful tool for detecting trend vs. mean-reversion regimes.
How it works
Calculates the ratio of average price changes over full and half-length windows to estimate the fractal dimension of price movement.
Teal line = FDI decreasing → trending behavior (market smoother, more directional).
Orange line = FDI increasing → choppiness or consolidation.
Background:
Green tint = trend-friendly regime (FDI below low threshold).
Orange tint = choppy regime (FDI above high threshold).
Use cases
Detect when markets shift from trend-following to mean-reverting conditions.
Filter trades: favor trend strategies when FDI < 1.3 and reversion setups when FDI > 1.7.
Combine with momentum or volatility metrics to classify regimes.
Defaults
Length = 20
High-FDI threshold = 1.8
Low-FDI threshold = 1.2
Example — TSLA (1D, 2021)
Early 2021 trades choppy to sideways with FDI swinging up toward 1.5, then the index drops below 1.2 as Tesla transitions into a persistent trend-friendly regime through the second half of the year (green background). During the Q4 breakout, FDI holds ~1.0–1.2, confirming strong directionality; brief pullbacks lift FDI back toward the mid-range before trending pressure resumes. At the right edge, FDI sits well below the low threshold, signaling that price remains in a trend-supportive state.
Part of the Quant Toolkit — transparent, open-source indicators for modern quantitative analysis. Built by CoryP1990.
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.
TRADE ORBIT:-Andean Oscillator with Buy/Sell + Background//=============================================================================
// DESCRIPTION
//-----------------------------------------------------------------------------
// The Andean Oscillator is a trend-momentum tool that compares bullish and
// bearish pressure using dynamic envelopes derived from price. It evaluates
// the strength of upward vs downward movement and generates trade signals
// when bullish or bearish momentum aligns above a smoothed signal line.
//
// COMPONENTS
// -----------
// • Bull : Represents bullish pressure
// • Bear : Represents bearish pressure
// • Signal: EMA smoothing of the stronger of Bull/Bear
//
// SIGNAL LOGIC
// -------------
// ✅ BUY signal is generated when:
// 1) Bull crosses above Bear
// 2) Bull then crosses above the Signal line
//
// ✅ SELL signal is generated when:
// 1) Bear crosses above Bull
// 2) Bear then crosses above the Signal line
//
// BACKGROUND COLORS
// -----------------
// • Green background → Bull > Bear and Bull > Signal
// • Red background → Bear > Bull and Bear > Signal
//
// PLOTS
// -----
// • Green plot → Bullish component
// • Red plot → Bearish component
// • Orange plot → Signal line
//
// ADDITIONAL NOTES
// ----------------
// • Uses envelope calculation with EMA smoothing
// • State-tracking ensures proper trend recognition
// • Alert conditions are included for Buy and Sell signals
//
//=============================================================================
Normalized EFINormalized EFI (nEFI)
The Normalized EFI (nEFI) is a volume-weighted momentum oscillator that refines the classic Elder Force Index (EFI) by normalizing it against average trading volume. This makes it highly adaptable across different assets, timeframes, and market conditions—especially useful when comparing momentum strength between low- and high-volume instruments.
How It Works:
Relative Price Change: Measures the percentage change in price from the prior bar:
(Close - Close ) / Close
Volume Normalization: Divides current volume by its EMA (default: 30 periods) to create a relative volume factor:
Volume / EMA(Volume, 30)
Normalized Force: Combines the two:
nEFI_raw = PriceChange% × RelativeVolume × 100
Smoothing: Applies an EMA (default: 13 periods) to reduce noise and highlight meaningful trends.
Key Features & Inputs:
Smoothing Length (default: 13): Controls responsiveness of the EMA smoothing.
Volume EMA Length (default: 30): Sets the lookback for volume normalization—longer values create a more stable baseline.
Zero Line Centered: Positive values indicate buying pressure; negative values show selling pressure.
How to Use:
Trend Confirmation: Rising nEFI above zero supports bullish trends; falling below zero confirms bearish moves.
Divergences: Look for price making new highs/lows while nEFI fails to follow — often signals reversal.
Zero Line Crossovers: Cross above zero = potential buy signal; cross below = sell signal.
Extreme Readings: Spikes far from zero may indicate overbought/oversold conditions or climax moves.
Advantages:
Volume-Adaptive: Unlike raw EFI, nEFI scales properly across assets with vastly different volume profiles (e.g., stocks vs. crypto).
Consistent Scaling: Values are intuitive and comparable over time and across symbols.
Reduced Noise: EMA smoothing filters out erratic volume spikes common in illiquid markets.
Cross-Market Friendly: Works reliably on forex, futures, stocks, and crypto without manual recalibration.
Ideal for:
Swing traders, momentum strategies, and multi-asset analysis seeking a clean, interpretable measure of volume-adjusted price force.
Ichimoku Vision🌫️ Ichimoku Vision — Mathematics of Order in Market Emotion
Trading isn’t just numbers; it’s a daily duel between reason and emotion — discipline against fear.
Ichimoku Vision brings logic to that battle through mathematical symmetry and dynamic observation of balance and pressure inside market flow.
It is rooted in the classical Ichimoku Kinko Hyo structure but rebuilt with modern filtration logic:
Tenkan–Kijun intersections, Cloud evaluation, Chikou confirmation, and Flat Event mapping that filters out idle activity and false structure.
Every signal is statistically verified before appearing — once printed, it will never repaint or disappear.
Smart Alerts & Webhook Automation
Signals are emitted once per bar close, ensuring clean event flow.
All alerts — BUY, SELL, TP, SL, and Ichimoku Exit — are structured in lightweight JSON format suitable for webhook integration or external reporting pipelines.
Each message includes standardized information such as:
action, symbol, signal_type, entry_price, tp_price, sl_price — allowing connection with external analytic dashboards or tracking systems for real‑time performance assessment.
Alerts are designed for analytical automation: trigger once, report cleanly, and never clutter historical data.
Behavioral Pattern & Performance Analytics
Ichimoku Vision contains a dynamic Profit Table that records trading statistics in real time:
Win and Loss streaks, Success rate, Average Profit, Risk‑Reward ratio, drawdown levels, and profit performance with and without leverage.
This table acts as a psychological mirror — revealing behavioral tendencies behind execution.
Through its data, the system highlights reversal bias, recovery discipline, and response stability under pressure.
Each trade adds a new datapoint to your behavioral pattern map, transforming reaction into measurable structure.
Developer‑Level Data Output
For researchers and algorithmic developers, Ichimoku Vision exports structured CSV series fully aligned with the standard used in advanced trading systems like Alpha Signal (XRPUSDT) 5m.
Each record includes:
Signal Type (1 = Buy, –1 = Sell), Exit Type (1 = TP hit, –1 = SL hit), Entry and Exit Candle indices, Entry Price, Current TP/SL targets, and Position Status (1 = Long, –1 = Short, 0 = Closed).
This dataset allows empirical back‑testing and behavioral research without exposing any private source code.
Technical Precision
Non‑Repainting signal architecture
Configurable exit modes: Fixed TP/SL or Ichimoku Condition based
Automated alert and webhook system
Profit Table with tracking of risk and confidence metrics
Kijun Flat Event Detection — marks zones of market equilibrium
Designed for XRPUSDT on 5‑minute timeframe, tunable for other assets
Every function — from entry logic to exit timing and TP/SL line management — serves the purpose of detecting clean market structure and reaction cycles without emotion bias.
Essence
Ichimoku Vision doesn’t chase candles — it interprets the story they tell.
It’s a technical indicator built around discipline, balance, and clarity.
Each signal is a mathematical reflection of market emotion, translating chaos into structure, and structure into reason.
Precision, persistence, and stability — in every decision.
Alpha Signal(XRPUSDT)5mAlpha Signal (XRPUSDT).5m
Alpha Signal (XRPUSDT).5m is an advanced short‑term technical indicator designed for five‑minute market intervals. It integrates layered filtering, behavioral sequencing, and adaptive risk handling to deliver clean, non‑repainting trading signals under real volatility conditions.
The indicator builds its logic on multiple synchronized systems: SSL confirmation channels define directional intent, ADX zones prevent weak‑momentum entries, and MA filters ensure structural correctness of each move. These components interact to find valid breakout or reversal conditions while excluding unstable momentum shifts or random impulses.
Once a signal is fully validated, it locks in place — no repaint, no disappearance. All signals are also broadcast through structured JSON alerts, automatically formatted for remote automation or webhook transmission. A typical alert includes:
action, indicator, symbol, signal_type, entry_price, tp_price, and sl_price.
This consistent schema allows connection to external dashboards, spreadsheet trackers, or trading bots without revealing any source logic.
Alpha Signal also calculates take‑profit and stop‑loss levels using multi‑stage ATR volatility and manages active trades across TP1, TP2, and TP3 targets. Stop‑loss events are detected dynamically and reported instantly in the same JSON format, maintaining statistical traceability for every trade.
In parallel, the indicator records quantitative behavior inside CSV datasets for deeper analysis. Each row contains the trade type, exit classification (TP or SL), entry and exit indices, price levels, ATR‑scaled targets, and position status. This structure supports external behavioral analytics, sequence accuracy checks, and profit/risk aggregation across time windows.
The system maintains discipline via its internal “Minimum Profit Guard” — a filter that rejects any setup offering return below the configured threshold. Combined with adaptive filters and leveraged ATR‑based targets, this protection prevents low‑quality trades and sustains long‑term consistency.
Alpha Signal’s operational rules are optimized for stability on the XRPUSDT 5‑minute chart but extend naturally to similar high‑frequency pairs. The indicator reacts strictly to verified cross‑confirmations among ADX, SSL, and momentum phases, adjusting to structural slope, volume pressure, and short‑term volatility.
It is built for traders seeking data transparency, automation readiness, and emotional neutrality in fast‑paced environments. Alpha Signal (XRPUSDT).5m functions purely through confirmed logic — every alert, threshold, and output remains verifiable and consistent throughout market evolution.
Ultra Scalp(XRPUSDT).5mUltra Scalp is a non‑repainting, adaptive scalping indicator built on a proprietary artificial‑intelligence framework developed specifically for high‑frequency pattern recognition in volatile markets.
Originally optimized for XRPUSDT (5‑minute) intervals, it dynamically adapts to different assets and volatility regimes through its internal self‑learning adjustment engine.
📊 Core Logic & Signal Architecture
This system unifies multiple analytical layers into a coherent structure:
Supertrend‑based trend mapping defines real‑time market direction.
MA Flow Alignment integrates SMA, EMA, DEMA, TEMA, HMA, JMA, and McGinley‑type tracking for smoother context.
SMI Reversal Filter confirms exhaustion zones and transitional turning points.
ADX Zone Validation suppresses activity in low‑volatility or conflicting‑trend conditions.
RSI Diamond Markers highlight potential reversal extremes.
Trend Cloud Visualization presents a continuous view of structural bias via Hull MA projection.
All signals are confirmed at bar close, guaranteeing zero repainting behavior.
🧠 Smart Alert System & Automation
Each event generates a structured JSON alert encapsulating actionable trade data — including entry, take‑profit (TP1 – TP3), and stop‑loss (SL) values.
These alerts are compatible with any webhook‑based system such as Google Sheets, Python scripts, or dashboard integrators.
Example JSON alert:
{
"action": "ENTRY",
"indicator": "Ultra Scalp",
"symbol": "XRPUSDT",
"signal_type": "BUY",
"entry_price": "0.5720",
"tp_price": "0.5780",
"sl_price": "0.5670"
}
Alert Frequency: alert.freq_once_per_bar_close
📈 Performance Tracking Module
Ultra Scalp automatically collects session data to analyze both technical and behavioral performance:
Profit / Loss tracking per signal
Real‑time Risk – Reward ratios
Maximum Drawdown measurements
Win / Loss streak detection
Balance‑curve evolution and recovery rate
These metrics transform the chart into a decision‑feedback dashboard, enabling traders to monitor precision and consistency over time.
🧾 Data Export Structure
Every confirmed alert can be exported in .csv format for professional‑grade analytics.
Columns:
Data is designed for compatibility with analytical environments like Python, Power BI, and Excel‑based dashboards.
🔹 Essence
This indicator transforms short‑term market volatility into structured, repeatable logic.
The current version is publicly available to all TradingView users, while its source code is protected under a proprietary artificial‑intelligence framework to preserve the internal logic and prevent unauthorized access.






















