Anchored VWAP Polyline [CHE]  Anchored VWAP Polyline   — Anchored VWAP drawn as a polyline from a user-defined bar count with last-bar updates and optional labels
  Summary 
This indicator renders an anchored Volume-Weighted Average Price as a continuous polyline starting from a user-selected anchor point a specified number of bars back. It accumulates price multiplied by volume only from the anchor forward and resets cleanly when the anchor moves. Drawing is object-based (polyline and labels) and updated on the most recent bar only, which reduces flicker and avoids excessive redraws. Optional labels mark the anchor and, conditionally, a delta label when the current close is below the historical close at the anchor offset.
  Motivation: Why this design? 
Anchored VWAP is often used to track fair value after a specific event such as a swing, breakout, or session start. Traditional plot-based lines can repaint during live updates or incur overhead when frequently redrawn. This implementation focuses on explicit state management, last-bar rendering, and object recycling so the line stays stable while remaining responsive when the anchor changes. The design emphasizes deterministic updates and simple session gating from the anchor.
  What’s different vs. standard approaches? 
 Baseline: Classic VWAP lines plotted from session open or full history.
 Architecture differences:
   Anchor defined by a fixed bar offset rather than session or day boundaries.
   Object-centric drawing via `polyline` with an array of `chart.point` objects.
   Last-bar update pattern with deletion and replacement of the polyline to apply all points cleanly.
   Conditional labels: an anchor marker and an optional delta label only when the current close is below the historical close at the offset.
 Practical effect: You get a visually continuous anchored VWAP that resets when the anchor shifts and remains clean on chart refreshes. The labels act as lightweight diagnostics without clutter.
  How it works (technical) 
 The anchor index is computed as the latest bar index minus the user-defined bar count.
 A session flag turns true from the anchor forward; prior bars are excluded.
 Two persistent accumulators track the running sum of price multiplied by volume and the running sum of volume; they reset when the session flag turns from false to true.
 The anchored VWAP is the running sum divided by the running volume whenever both are valid and the volume is not zero.
 Points are appended to an array only when the anchored VWAP is valid. On the most recent bar, any existing polyline is deleted and replaced with a new one built from the point array.
 Labels are refreshed on the most recent bar:
   A yellow warning label appears when there are not enough bars to compute the reference values.
   The anchor label marks the anchor bar.
   The delta label appears only when the current close is below the close at the anchor offset; otherwise it is suppressed.
 No higher-timeframe requests are used; repaint is limited to normal live-bar behavior.
  Parameter Guide 
Bars back — Sets the anchor offset in bars; default two hundred thirty-three; minimum one. Larger values extend the anchored period and increase stability but respond more slowly to regime changes.
Labels — Toggles all labels; default enabled. Disable to keep the chart clean when using multiple instances.
  Reading & Interpretation 
 The polyline represents the anchored VWAP from the chosen anchor to the current bar. Price above the line suggests strength relative to the anchored baseline; price below suggests weakness.
 The anchor label shows where the accumulation starts.
 The delta label appears only when today’s close is below the historical close at the offset; it provides a quick context for negative drift relative to that reference.
 A yellow message at the current bar indicates the chart does not have enough history to compute the reference comparison yet.
  Practical Workflows & Combinations 
 Trend following: Anchor after a breakout bar or a swing confirmation. Use the anchored VWAP as dynamic support or resistance; look for clean retests and holds for continuation.
 Mean reversion: Anchor at a local extreme and watch for approaches back toward the line; require structure confirmation to avoid early entries.
 Session or event studies: Re-set the anchor around earnings, macro releases, or session opens by adjusting the bar offset.
 Combinations: Pair with structure tools such as swing highs and lows, or with volatility measures to filter chop. The labels can be disabled when combining multiple instances to maintain chart clarity.
  Behavior, Constraints & Performance 
 Repaint and confirmation: The line is updated on the most recent bar only; historical values do not rely on future bars. Normal live-bar movement applies until the bar closes.
 No higher timeframe: There is no `security` call; repaint paths related to higher-timeframe lookahead do not apply here.
 Resources: Uses one polyline object that is rebuilt on the most recent bar, plus two labels when conditions are met. `max_bars_back` is two thousand. Arrays store points from the anchor forward; extremely long anchors or very long charts increase memory usage.
 Known limits: With very thin volume, the VWAP can be unavailable for some bars. Very large anchors reduce responsiveness. Labels use ATR for vertical placement; extreme gaps can place them close to extremes.
  Sensible Defaults & Quick Tuning 
 Starting point: Bars back two hundred thirty-three with Labels enabled works well on many assets and timeframes.
 Too noisy around the line: Increase Bars back to extend the accumulation window.
 Too sluggish after regime changes: Decrease Bars back to focus on a shorter anchored period.
 Chart clutter with multiple instances: Disable Labels while keeping the polyline visible.
  What this indicator is—and isn’t 
This is a visualization of an anchored VWAP with optional diagnostics. It is not a full trading system and does not include entries, exits, or position management. Use it alongside clear market structure, risk controls, and a plan for trade management. It does not predict future prices.
 Inputs with defaults 
 Bars back: two hundred thirty-three bars, minimum one.
 Labels: enabled or disabled toggle, default enabled.
Pine version: v6
Overlay: true
Primary outputs: one polyline, optional labels (anchor, conditional delta, and a warning when insufficient bars).
Metrics and functions: volume, ATR for label offset, object drawing via polyline and chart points, last-bar update pattern.
Special techniques: session gating from the anchor, persistent state, object recycling, explicit guards against unavailable values and zero volume.
Compatibility and assets: Designed for standard candlestick or bar charts across liquid assets and common timeframes.
Diagnostics: Yellow warning label when history is insufficient.
  Disclaimer 
The content provided, including all code and materials, is strictly for educational and informational purposes only. It is not intended as, and should not be interpreted as, financial advice, a recommendation to buy or sell any financial instrument, or an offer of any financial product or service. All strategies, tools, and examples discussed are provided for illustrative purposes to demonstrate coding techniques and the functionality of Pine Script within a trading context.
Any results from strategies or tools provided are hypothetical, and past performance is not indicative of future results. Trading and investing involve high risk, including the potential loss of principal, and may not be suitable for all individuals. Before making any trading decisions, please consult with a qualified financial professional to understand the risks involved.
By using this script, you acknowledge and agree that any trading decisions are made solely at your discretion and risk.
Do not use this indicator on Heikin-Ashi, Renko, Kagi, Point-and-Figure, or Range charts, as these chart types can produce unrealistic results for signal markers and alerts.
 Best regards and happy trading
Chervolino 
Cari dalam skrip untuk "one一季度财报"
Squeeze Hour Frequency [CHE]Squeeze Hour Frequency (ATR-PR) — Standalone — Tracks daily squeeze occurrences by hour to reveal time-based volatility patterns 
  Summary 
This indicator identifies periods of unusually low volatility, defined as squeezes, and tallies their frequency across each hour of the day over historical trading sessions. By aggregating counts into a sortable table, it helps users spot hours prone to these conditions, enabling better scheduling of trading activity to avoid or target specific intraday regimes. Signals gain robustness through percentile-based detection that adapts to recent volatility history, differing from fixed-threshold methods by focusing on relative lowness rather than absolute levels, which reduces false positives in varying market environments.
  Motivation: Why this design? 
Traders often face uneven intraday volatility, with certain hours showing clustered low-activity phases that precede or follow breakouts, leading to mistimed entries or overlooked calm periods. The core idea of hourly squeeze frequency addresses this by binning low-volatility events into 24 hourly slots and counting distinct daily occurrences, providing a historical profile of when squeezes cluster. This reveals time-of-day biases without relying on real-time alerts, allowing proactive adjustments to session focus.
  What’s different vs. standard approaches? 
- Reference baseline: Classical volatility tools like simple moving average crossovers or fixed ATR thresholds, which flag squeezes uniformly across the day.
- Architecture differences:
  - Uses persistent arrays to track one squeeze per hour per day, preventing overcounting within sessions.
  - Employs custom sorting on ratio arrays for dynamic table display, prioritizing top or bottom performers.
  - Handles timezones explicitly to ensure consistent binning across global assets.
- Practical effect: Charts show a persistent table ranking hours by squeeze share, making intraday patterns immediately visible—such as a top hour capturing over 20 percent of total events—unlike static overlays that ignore temporal distribution, which matters for avoiding low-liquidity traps in crypto or forex.
  How it works (technical) 
The indicator first computes a rolling volatility measure over a specified lookback period. It then derives a relative ranking of the current value against recent history within a window of bars. A squeeze is flagged when this ranking falls below a user-defined cutoff, indicating the value is among the lowest in the recent sample.
On each bar, the local hour is extracted using the selected timezone. If a squeeze occurs and the bar has price data, the count for that hour increments only if no prior mark exists for the current day, using a persistent array to store the last marked day per hour. This ensures one tally per unique trading day per slot.
At the final bar, arrays compile counts and ratios for all 24 hours, where the ratio represents each hour's share of total squeezes observed. These are sorted ascending or descending based on display mode, and the top or bottom subset populates the table. Background shading highlights live squeezes in red for visual confirmation. Initialization uses zero-filled arrays for counts and negative seeds for day tracking, with state persisting across bars via variable declarations.
No higher timeframe data is pulled, so there is no repaint risk from external fetches; all logic runs on confirmed bars.
  Parameter Guide 
ATR Length — Controls the lookback for the volatility measure, influencing sensitivity to short-term fluctuations; shorter values increase responsiveness but add noise, longer ones smooth for stability — Default: 14 — Trade-offs/Tips: Use 10-20 for intraday charts to balance quick detection with fewer false squeezes; test on historical data to avoid over-smoothing in trending markets.
Percentile Window (bars) — Sets the history depth for ranking the current volatility value, affecting how "low" is defined relative to past; wider windows emphasize long-term norms — Default: 252 — Trade-offs/Tips: 100-300 bars suit daily cycles; narrower for fast assets like crypto to catch recent regimes, but risks instability in sparse data.
Squeeze threshold (PR < x) — Defines the cutoff for flagging low relative volatility, where values below this mark a squeeze; lower thresholds tighten detection for rarer events — Default: 10.0 — Trade-offs/Tips: 5-15 percent for conservative signals reducing false positives; raise to 20 for more frequent highlights in high-vol environments, monitoring for increased noise.
Timezone — Specifies the reference for hourly binning, ensuring alignment with market sessions — Default: Exchange — Trade-offs/Tips: Set to "America/New_York" for US assets; mismatches can skew counts, so verify against chart timezone.
Show Table — Toggles the results display, essential for reviewing frequencies — Default: true — Trade-offs/Tips: Disable on mobile for performance; pair with position tweaks for clean overlays.
Pos — Places the table on the chart pane — Default: Top Right — Trade-offs/Tips: Bottom Left avoids candle occlusion on volatile charts.
Font — Adjusts text readability in the table — Default: normal — Trade-offs/Tips: Tiny for dense views, large for emphasis on key hours.
Dark — Applies high-contrast colors for visibility — Default: true — Trade-offs/Tips: Toggle false in light themes to prevent washout.
Display — Filters table rows to focus on extremes or full list — Default: All — Trade-offs/Tips: Top 3 for quick scans of risky hours; Bottom 3 highlights safe low-squeeze periods.
  Reading & Interpretation 
Red background shading appears on bars meeting the squeeze condition, signaling current low relative volatility. The table lists hours as "H0" to "H23", with columns for daily squeeze counts, percentage share of total squeezes (summing to 100 percent across hours), and an arrow marker on the top hour. A summary row above details the peak count, its share, and the leading hour. A label at the last bar recaps total days observed, data-valid days, and top hour stats. Rising shares indicate clustering, suggesting regime persistence in that slot.
  Practical Workflows & Combinations 
- Trend following: Scan for hours with low squeeze shares to enter during stable regimes; confirm with higher highs or lower lows on the 15-minute chart, avoiding top-share hours post-news like tariff announcements.
- Exits/Stops: Tighten stops in high-share hours to guard against sudden vol spikes; use the table to shift to conservative sizing outside peak squeeze times.
- Multi-asset/Multi-TF: Defaults work across crypto pairs on 5-60 minute timeframes; for stocks, widen percentile window to 500 bars. Combine with volume oscillators—enter only if squeeze count is below average for the asset.
  Behavior, Constraints & Performance 
Logic executes on closed bars, with live bars updating counts provisionally but finalizing on confirmation; table refreshes only at the last bar, avoiding intrabar flicker. No security calls or higher timeframes, so no repaint from external data. Resources include a 5000-bar history limit, loops up to 24 iterations for sorting and totals, and arrays sized to 24 elements; labels and table are capped at 500 each for efficiency. Known limits: Skips hours without bars (e.g., weekends), assumes uniform data availability, and may undercount in sparse sessions; timezone shifts can alter profiles without warning.
  Sensible Defaults & Quick Tuning 
Start with ATR Length at 14, Percentile Window at 252, and threshold at 10.0 for broad crypto use. If too many squeezes flag (noisy table), raise threshold to 15.0 and narrow window to 100 for stricter relative lowness. For sluggish detection in calm markets, drop ATR Length to 10 and threshold to 5.0 to capture subtler dips. In high-vol assets, widen window to 500 and threshold to 20.0 for stability.
  What this indicator is—and isn’t 
This is a historical frequency tracker and visualization layer for intraday volatility patterns, best as a filter in multi-tool setups. It is not a standalone signal generator, predictive model, or risk manager—pair it with price action, news filters, and position sizing rules.
  Disclaimer 
The content provided, including all code and materials, is strictly for educational and informational purposes only. It is not intended as, and should not be interpreted as, financial advice, a recommendation to buy or sell any financial instrument, or an offer of any financial product or service. All strategies, tools, and examples discussed are provided for illustrative purposes to demonstrate coding techniques and the functionality of Pine Script within a trading context.
Any results from strategies or tools provided are hypothetical, and past performance is not indicative of future results. Trading and investing involve high risk, including the potential loss of principal, and may not be suitable for all individuals. Before making any trading decisions, please consult with a qualified financial professional to understand the risks involved.
By using this script, you acknowledge and agree that any trading decisions are made solely at your discretion and risk.
Do not use this indicator on Heikin-Ashi, Renko, Kagi, Point-and-Figure, or Range charts, as these chart types can produce unrealistic results for signal markers and alerts.
Best regards and happy trading
Chervolino
Thanks to Duyck
for the ma sorter
Michal D. Lagless Moving Average | MisinkoMasterThe  𝕸𝖎𝖈𝖍𝖆𝖑 𝕯. 𝕷𝖆𝖌𝖑𝖊𝖘𝖘 𝕸𝖔𝖛𝖎𝖓𝖌 𝕬𝖛𝖊𝖗𝖆𝖌𝖊  is my latest creation of a trend following tool, which is a bit different from the rest. By trying to de-lag the classical moving average, it gives you fast signals on changes in trend as fast as possible, keeping traders & investors always in check for potential risks they might want to avoid.
 How does it work? 
First we need to calculate lengths. The lengths are calcuted using a user defined input called the "Length Multiplier" and we of course need as well the length input too.
The indicator uses 10 lengths, 5 for an average price, 5 for median price.
The length for the average is the following:
length_2_avg = length_1_avg * length_multiplier
length_3_avg = length_2_avg * length_multiplier
...
and for the median lengths:
length_1_median = length_2_avg
length_2_median = length_3_avg
Here applies this rule
length_x_median < length_x_avg
This is intentional, and it is because the average is a little more reactive, while the median is a bit slower. To make up for the "slowness" of the median, we simple reduce the length of it a bit more than the average.
Now that we have our length we are ready to calculate averages and medians over their respective period. This is the a normal average from elementary school, nothing too fancy.
Now that we have all of them we match the pairs using another user defined input called "Median Weight" like so:
(Average_x * (2-median_weight) + Median_x * median_weight)/2
This gives more weight to the average (also due to the max value limit set to avoid breaking the fundational logic behind it).
After doing it to all the pairs we now average those pairs using another input called "Exponential Weight Multiplier".
The Exponential Weight Multiplier is used for weights which I will cover soon:
weight1 = weight
weight2 = weight * weight
weight3 = weight * weight * weight....
This is done until we have all the weights calculated
This gives exponentially more weight to the less lagging indicators, which is how we delag the indicator.
Then we sum all the pairs like so:
sum = pair1 * weight1 + pair2 * weight2 + pair3 * weight3 + pair4 * weight4 + pair5 * weight5
Then the sum is divided by the sum of weights, this results in us getting the final value.
 Methodology & What is the actual point & how was it made? 
I want to cover this one a bit deeper:
The methodology behind this was creating an indicator that would not be lagging, and would be able to avoid lag while not producing signals too often.
In many attempts in the first part, I tried using EMA, RMA, DEMA, TEMA, HMA, SMA and so on, but they were too noisy (except for SMA & RMA, but those had their flaws), so I tried the classical average taught in elementary school. This one worked better, but the noise was too high still after all this time. This made me include the median, which helped the noise, but made it far too lagging.
Here came the idea of making the median length lower and adding weights to counter the lag of the median, but it was still too lagging. This made me make the weights for lengths more exponential, while previously they were calculated using a little bit amplified sums that were alright, but nowhere near my desired result.
Using the new weights I got further, and after a bit of testing I was sattisfied with the results.
The logic for the trend was a big part in my development part, there were many I could think of, but not enough time to try them, so I stuck to the usual one, and I leave it up to  YOU  to beat my trend logic and get even better results.
 Use Cases: 
- Price/MA Crossovers
Simple, effective, useful
- Source for other indicators
This I tried myself, and it worked in a cool way, making the signals of for example RSI much smoother, so definitely try it out if you know how to code, or just simply put it in the source of the RSI.
- ROC
This trend logic stuck with me, I think you could find a way to make it good, but mainly for the people that can code in pine, trying out to combine the trend logic with ROC could work very well, do not sleep on it!
- Education
This concept is not really that complex, so for people looking for new ideas, inspiration, or just watching how trend following tools behave in general this is something that could benefit anyone, as the concept can be applied to ANYTHING, even the classical RSI, MACD, you could try even the Parabolic SAR, maybe STC or VZO, there is no limit to imagination.
- Strategy creation
Filtering this indicator with "and" conditions, or maybe even "or" or anything really could be very useful in a strategy that desires fast signals.
- Price Distance from bands
I noticed this while looking at past performance:
The stronger the trend the higher the distance from the Moving Average.
 Final Notes 
Watch out for mean reverting markets, as this is trend following you could get easily screwed in them.
Play around with this if it fits your desired outcome, you might find something I did not.
Hope you find it useful,
See you next time!
Keltner Channel Enhanced [DCAUT]█ Keltner Channel Enhanced  
 📊 ORIGINALITY & INNOVATION 
The Keltner Channel Enhanced represents an important advancement over standard Keltner Channel implementations by introducing dual flexibility in moving average selection for both the middle band and ATR calculation. While traditional Keltner Channels typically use EMA for the middle band and RMA (Wilder's smoothing) for ATR, this enhanced version provides access to 25+ moving average algorithms for both components, enabling traders to fine-tune the indicator's behavior to match specific market characteristics and trading approaches.
 Key Advancements: 
 
 Dual MA Algorithm Flexibility: Independent selection of moving average types for middle band (25+ options) and ATR smoothing (25+ options), allowing optimization of both trend identification and volatility measurement separately
 Enhanced Trend Sensitivity: Ability to use faster algorithms (HMA, T3) for middle band while maintaining stable volatility measurement with traditional ATR smoothing, or vice versa for different trading strategies
 Adaptive Volatility Measurement: Choice of ATR smoothing algorithm affects channel responsiveness to volatility changes, from highly reactive (SMA, EMA) to smoothly adaptive (RMA, TEMA)
 Comprehensive Alert System: Five distinct alert conditions covering breakouts, trend changes, and volatility expansion, enabling automated monitoring without constant chart observation
 Multi-Timeframe Compatibility: Works effectively across all timeframes from intraday scalping to long-term position trading, with independent optimization of trend and volatility components
 
This implementation addresses key limitations of standard Keltner Channels: fixed EMA/RMA combination may not suit all market conditions or trading styles. By decoupling the trend component from volatility measurement and allowing independent algorithm selection, traders can create highly customized configurations for specific instruments and market phases.
 📐 MATHEMATICAL FOUNDATION 
Keltner Channel Enhanced uses a three-component calculation system that combines a flexible moving average middle band with ATR-based (Average True Range) upper and lower channels, creating volatility-adjusted trend-following bands.
 Core Calculation Process: 
 1. Middle Band (Basis) Calculation: 
The basis line is calculated using the selected moving average algorithm applied to the price source over the specified period:
 
basis = ma(source, length, maType)
 
Supported algorithms include EMA (standard choice, trend-biased), SMA (balanced and symmetric), HMA (reduced lag), WMA, VWMA, TEMA, T3, KAMA, and 17+ others.
 2. Average True Range (ATR) Calculation: 
ATR measures market volatility by calculating the average of true ranges over the specified period:
 
trueRange = max(high - low, abs(high - close ), abs(low - close ))
atrValue = ma(trueRange, atrLength, atrMaType)
 
ATR smoothing algorithm significantly affects channel behavior, with options including RMA (standard, very smooth), SMA (moderate smoothness), EMA (fast adaptation), TEMA (smooth yet responsive), and others.
 3. Channel Calculation: 
Upper and lower channels are positioned at specified multiples of ATR from the basis:
 
upperChannel = basis + (multiplier × atrValue)
lowerChannel = basis - (multiplier × atrValue)
 
Standard multiplier is 2.0, providing channels that dynamically adjust width based on market volatility.
 Keltner Channel vs. Bollinger Bands - Key Differences: 
While both indicators create volatility-based channels, they use fundamentally different volatility measures:
 Keltner Channel (ATR-based): 
 
 Uses Average True Range to measure actual price movement volatility
 Incorporates gaps and limit moves through true range calculation
 More stable in trending markets, less prone to extreme compression
 Better reflects intraday volatility and trading range
 Typically fewer band touches, making touches more significant
 More suitable for trend-following strategies
 
 Bollinger Bands (Standard Deviation-based): 
 
 Uses statistical standard deviation to measure price dispersion
 Based on closing prices only, doesn't account for intraday range
 Can compress significantly during consolidation (squeeze patterns)
 More touches in ranging markets
 Better suited for mean-reversion strategies
 Provides statistical probability framework (95% within 2 standard deviations)
 
 Algorithm Combination Effects: 
The interaction between middle band MA type and ATR MA type creates different indicator characteristics:
 
 Trend-Focused Configuration (Fast MA + Slow ATR): Middle band uses HMA/EMA/T3, ATR uses RMA/TEMA, quick trend changes with stable channel width, suitable for trend-following
 Volatility-Focused Configuration (Slow MA + Fast ATR): Middle band uses SMA/WMA, ATR uses EMA/SMA, stable trend with dynamic channel width, suitable for volatility trading
 Balanced Configuration (Standard EMA/RMA): Classic Keltner Channel behavior, time-tested combination, suitable for general-purpose trend following
 Adaptive Configuration (KAMA + KAMA): Self-adjusting indicator responding to efficiency ratio, suitable for markets with varying trend strength and volatility regimes
 
 📊 COMPREHENSIVE SIGNAL ANALYSIS 
Keltner Channel Enhanced provides multiple signal categories optimized for trend-following and breakout strategies.
 Channel Position Signals: 
 Upper Channel Interaction: 
 
 Price Touching Upper Channel: Strong bullish momentum, price moving more than typical volatility range suggests, potential continuation signal in established uptrends
 Price Breaking Above Upper Channel: Exceptional strength, price exceeding normal volatility expectations, consider adding to long positions or tightening trailing stops
 Price Riding Upper Channel: Sustained strong uptrend, characteristic of powerful bull moves, stay with trend and avoid premature profit-taking
 Price Rejection at Upper Channel: Momentum exhaustion signal, consider profit-taking on longs or waiting for pullback to middle band for reentry
 
 Lower Channel Interaction: 
 
 Price Touching Lower Channel: Strong bearish momentum, price moving more than typical volatility range suggests, potential continuation signal in established downtrends
 Price Breaking Below Lower Channel: Exceptional weakness, price exceeding normal volatility expectations, consider adding to short positions or protecting against further downside
 Price Riding Lower Channel: Sustained strong downtrend, characteristic of powerful bear moves, stay with trend and avoid premature covering
 Price Rejection at Lower Channel: Momentum exhaustion signal, consider covering shorts or waiting for bounce to middle band for reentry
 
 Middle Band (Basis) Signals: 
 Trend Direction Confirmation: 
 
 Price Above Basis: Bullish trend bias, middle band acts as dynamic support in uptrends, consider long positions or holding existing longs
 Price Below Basis: Bearish trend bias, middle band acts as dynamic resistance in downtrends, consider short positions or avoiding longs
 Price Crossing Above Basis: Potential trend change from bearish to bullish, early signal to establish long positions
 Price Crossing Below Basis: Potential trend change from bullish to bearish, early signal to establish short positions or exit longs
 
 Pullback Trading Strategy: 
 
 Uptrend Pullback: Price pulls back from upper channel to middle band, finds support, and resumes upward, ideal long entry point
 Downtrend Bounce: Price bounces from lower channel to middle band, meets resistance, and resumes downward, ideal short entry point
 Basis Test: Strong trends often show price respecting the middle band as support/resistance on pullbacks
 Failed Test: Price breaking through middle band against trend direction signals potential reversal
 
 Volatility-Based Signals: 
 Narrow Channels (Low Volatility): 
 
 Consolidation Phase: Channels contract during periods of reduced volatility and directionless price action
 Breakout Preparation: Narrow channels often precede significant directional moves as volatility cycles
 Trading Approach: Reduce position sizes, wait for breakout confirmation, avoid range-bound strategies within channels
 Breakout Direction: Monitor for price breaking decisively outside channel range with expanding width
 
 Wide Channels (High Volatility): 
 
 Trending Phase: Channels expand during strong directional moves and increased volatility
 Momentum Confirmation: Wide channels confirm genuine trend with substantial volatility backing
 Trading Approach: Trend-following strategies excel, wider stops necessary, mean-reversion strategies risky
 Exhaustion Signs: Extreme channel width (historical highs) may signal approaching consolidation or reversal
 
 Advanced Pattern Recognition: 
 Channel Walking Pattern: 
 
 Upper Channel Walk: Price consistently touches or exceeds upper channel while staying above basis, very strong uptrend signal, hold longs aggressively
 Lower Channel Walk: Price consistently touches or exceeds lower channel while staying below basis, very strong downtrend signal, hold shorts aggressively
 Basis Support/Resistance: During channel walks, price typically uses middle band as support/resistance on minor pullbacks
 Pattern Break: Price crossing basis during channel walk signals potential trend exhaustion
 
 Squeeze and Release Pattern: 
 
 Squeeze Phase: Channels narrow significantly, price consolidates near middle band, volatility contracts
 Direction Clues: Watch for price positioning relative to basis during squeeze (above = bullish bias, below = bearish bias)
 Release Trigger: Price breaking outside narrow channel range with expanding width confirms breakout
 Follow-Through: Measure squeeze height and project from breakout point for initial profit targets
 
 Channel Expansion Pattern: 
 
 Breakout Confirmation: Rapid channel widening confirms volatility increase and genuine trend establishment
 Entry Timing: Enter positions early in expansion phase before trend becomes overextended
 Risk Management: Use channel width to size stops appropriately, wider channels require wider stops
 
 Basis Bounce Pattern: 
 
 Clean Bounce: Price touches middle band and immediately reverses, confirms trend strength and entry opportunity
 Multiple Bounces: Repeated basis bounces indicate strong, sustainable trend
 Bounce Failure: Price penetrating basis signals weakening trend and potential reversal
 
 Divergence Analysis: 
 
 Price/Channel Divergence: Price makes new high/low while staying within channel (not reaching outer band), suggests momentum weakening
 Width/Price Divergence: Price breaks to new extremes but channel width contracts, suggests move lacks conviction
 Reversal Signal: Divergences often precede trend reversals or significant consolidation periods
 
 Multi-Timeframe Analysis: 
Keltner Channels work particularly well in multi-timeframe trend-following approaches:
 Three-Timeframe Alignment: 
 
 Higher Timeframe (Weekly/Daily): Identify major trend direction, note price position relative to basis and channels
 Intermediate Timeframe (Daily/4H): Identify pullback opportunities within higher timeframe trend
 Lower Timeframe (4H/1H): Time precise entries when price touches middle band or lower channel (in uptrends) with rejection
 
 Optimal Entry Conditions: 
 
 Best Long Entries: Higher timeframe in uptrend (price above basis), intermediate timeframe pulls back to basis, lower timeframe shows rejection at middle band or lower channel
 Best Short Entries: Higher timeframe in downtrend (price below basis), intermediate timeframe bounces to basis, lower timeframe shows rejection at middle band or upper channel
 Risk Management: Use higher timeframe channel width to set position sizing, stops below/above higher timeframe channels
 
 🎯 STRATEGIC APPLICATIONS 
Keltner Channel Enhanced excels in trend-following and breakout strategies across different market conditions.
 Trend Following Strategy: 
 Setup Requirements: 
 
 Identify established trend with price consistently on one side of basis line
 Wait for pullback to middle band (basis) or brief penetration through it
 Confirm trend resumption with price rejection at basis and move back toward outer channel
 Enter in trend direction with stop beyond basis line
 
 Entry Rules: 
 Uptrend Entry: 
 
 Price pulls back from upper channel to middle band, shows support at basis (bullish candlestick, momentum divergence)
 Enter long on rejection/bounce from basis with stop 1-2 ATR below basis
 Aggressive: Enter on first touch; Conservative: Wait for confirmation candle
 
 Downtrend Entry: 
 
 Price bounces from lower channel to middle band, shows resistance at basis (bearish candlestick, momentum divergence)
 Enter short on rejection/reversal from basis with stop 1-2 ATR above basis
 Aggressive: Enter on first touch; Conservative: Wait for confirmation candle
 
 Trend Management: 
 
 Trailing Stop: Use basis line as dynamic trailing stop, exit if price closes beyond basis against position
 Profit Taking: Take partial profits at opposite channel, move stops to basis
 Position Additions: Add to winners on subsequent basis bounces if trend intact
 
 Breakout Strategy: 
 Setup Requirements: 
 
 Identify consolidation period with contracting channel width
 Monitor price action near middle band with reduced volatility
 Wait for decisive breakout beyond channel range with expanding width
 Enter in breakout direction after confirmation
 
 Breakout Confirmation: 
 
 Price breaks clearly outside channel (upper for longs, lower for shorts), channel width begins expanding from contracted state
 Volume increases significantly on breakout (if using volume analysis)
 Price sustains outside channel for multiple bars without immediate reversal
 
 Entry Approaches: 
 
 Aggressive: Enter on initial break with stop at opposite channel or basis, use smaller position size
 Conservative: Wait for pullback to broken channel level, enter on rejection and resumption, tighter stop
 
 Volatility-Based Position Sizing: 
Adjust position sizing based on channel width (ATR-based volatility):
 
 Wide Channels (High ATR): Reduce position size as stops must be wider, calculate position size using ATR-based risk calculation: Risk / (Stop Distance in ATR × ATR Value)
 Narrow Channels (Low ATR): Increase position size as stops can be tighter, be cautious of impending volatility expansion
 ATR-Based Risk Management: Use ATR-based risk calculations, position size = 0.01 × Capital / (2 × ATR), use multiples of ATR (1-2 ATR) for adaptive stops
 
 Algorithm Selection Guidelines: 
Different market conditions benefit from different algorithm combinations:
 
 Strong Trending Markets: Middle band use EMA or HMA, ATR use RMA, capture trends quickly while maintaining stable channel width
 Choppy/Ranging Markets: Middle band use SMA or WMA, ATR use SMA or WMA, avoid false trend signals while identifying genuine reversals
 Volatile Markets: Middle band and ATR both use KAMA or FRAMA, self-adjusting to changing market conditions reduces manual optimization
 Breakout Trading: Middle band use SMA, ATR use EMA or SMA, stable trend with dynamic channels highlights volatility expansion early
 Scalping/Day Trading: Middle band use HMA or T3, ATR use EMA or TEMA, both components respond quickly
 Position Trading: Middle band use EMA/TEMA/T3, ATR use RMA or TEMA, filter out noise for long-term trend-following
 
 📋 DETAILED PARAMETER CONFIGURATION 
Understanding and optimizing parameters is essential for adapting Keltner Channel Enhanced to specific trading approaches.
 Source Parameter: 
 
 Close (Most Common): Uses closing price, reflects daily settlement, best for end-of-day analysis and position trading, standard choice
 HL2 (Median Price): Smooths out closing bias, better represents full daily range in volatile markets, good for swing trading
 HLC3 (Typical Price): Gives more weight to close while including full range, popular for intraday applications, slightly more responsive than HL2
 OHLC4 (Average Price): Most comprehensive price representation, smoothest option, good for gap-prone markets or highly volatile instruments
 
 Length Parameter: 
Controls the lookback period for middle band (basis) calculation:
 
 Short Periods (10-15): Very responsive to price changes, suitable for day trading and scalping, higher false signal rate
 Standard Period (20 - Default): Represents approximately one month of trading, good balance between responsiveness and stability, suitable for swing and position trading
 Medium Periods (30-50): Smoother trend identification, fewer false signals, better for position trading and longer holding periods
 Long Periods (50+): Very smooth, identifies major trends only, minimal false signals but significant lag, suitable for long-term investment
 
 Optimization by Timeframe:  1-15 minute charts use 10-20 period, 30-60 minute charts use 20-30 period, 4-hour to daily charts use 20-40 period, weekly charts use 20-30 weeks.
 ATR Length Parameter: 
Controls the lookback period for Average True Range calculation, affecting channel width:
 
 Short ATR Periods (5-10): Very responsive to recent volatility changes, standard is 10 (Keltner's original specification), may be too reactive in whipsaw conditions
 Standard ATR Period (10 - Default): Chester Keltner's original specification, good balance between responsiveness and stability, most widely used
 Medium ATR Periods (14-20): Smoother channel width, ATR 14 aligns with Wilder's original ATR specification, good for position trading
 Long ATR Periods (20+): Very smooth channel width, suitable for long-term trend-following
 
 Length vs. ATR Length Relationship:  Equal values (20/20) provide balanced responsiveness, longer ATR (20/14) gives more stable channel width, shorter ATR (20/10) is standard configuration, much shorter ATR (20/5) creates very dynamic channels.
 Multiplier Parameter: 
Controls channel width by setting ATR multiples:
 
 Lower Values (1.0-1.5): Tighter channels with frequent price touches, more trading signals, higher false signal rate, better for range-bound and mean-reversion strategies
 Standard Value (2.0 - Default): Chester Keltner's recommended setting, good balance between signal frequency and reliability, suitable for both trending and ranging strategies
 Higher Values (2.5-3.0): Wider channels with less frequent touches, fewer but potentially higher-quality signals, better for strong trending markets
 
 Market-Specific Optimization:  High volatility markets (crypto, small-caps) use 2.5-3.0 multiplier, medium volatility markets (major forex, large-caps) use 2.0 multiplier, low volatility markets (bonds, utilities) use 1.5-2.0 multiplier.
 MA Type Parameter (Middle Band): 
Critical selection that determines trend identification characteristics:
 
 EMA (Exponential Moving Average - Default): Standard Keltner Channel choice, Chester Keltner's original specification, emphasizes recent prices, faster response to trend changes, suitable for all timeframes
 SMA (Simple Moving Average): Equal weighting of all data points, no directional bias, slower than EMA, better for ranging markets and mean-reversion
 HMA (Hull Moving Average): Minimal lag with smooth output, excellent for fast trend identification, best for day trading and scalping
 TEMA (Triple Exponential Moving Average): Advanced smoothing with reduced lag, responsive to trends while filtering noise, suitable for volatile markets
 T3 (Tillson T3): Very smooth with minimal lag, excellent for established trend identification, suitable for position trading
 KAMA (Kaufman Adaptive Moving Average): Automatically adjusts speed based on market efficiency, slow in ranging markets, fast in trends, suitable for markets with varying conditions
 
 ATR MA Type Parameter: 
Determines how Average True Range is smoothed, affecting channel width stability:
 
 RMA (Wilder's Smoothing - Default): J. Welles Wilder's original ATR smoothing method, very smooth, slow to adapt to volatility changes, provides stable channel width
 SMA (Simple Moving Average): Equal weighting, moderate smoothness, faster response to volatility changes than RMA, more dynamic channel width
 EMA (Exponential Moving Average): Emphasizes recent volatility, quick adaptation to new volatility regimes, very responsive channel width changes
 TEMA (Triple Exponential Moving Average): Smooth yet responsive, good balance for varying volatility, suitable for most trading styles
 
 Parameter Combination Strategies: 
 
 Conservative Trend-Following: Length 30/ATR Length 20/Multiplier 2.5, MA Type EMA or TEMA/ATR MA Type RMA, smooth trend with stable wide channels, suitable for position trading
 Standard Balanced Approach: Length 20/ATR Length 10/Multiplier 2.0, MA Type EMA/ATR MA Type RMA, classic Keltner Channel configuration, suitable for general purpose swing trading
 Aggressive Day Trading: Length 10-15/ATR Length 5-7/Multiplier 1.5-2.0, MA Type HMA or EMA/ATR MA Type EMA or SMA, fast trend with dynamic channels, suitable for scalping and day trading
 Breakout Specialist: Length 20-30/ATR Length 5-10/Multiplier 2.0, MA Type SMA or WMA/ATR MA Type EMA or SMA, stable trend with responsive channel width
 Adaptive All-Conditions: Length 20/ATR Length 10/Multiplier 2.0, MA Type KAMA or FRAMA/ATR MA Type KAMA or TEMA, self-adjusting to market conditions
 
 Offset Parameter: 
Controls horizontal positioning of channels on chart. Positive values shift channels to the right (future) for visual projection, negative values shift left (past) for historical analysis, zero (default) aligns with current price bars for real-time signal analysis. Offset affects only visual display, not alert conditions or actual calculations.
 📈 PERFORMANCE ANALYSIS & COMPETITIVE ADVANTAGES 
Keltner Channel Enhanced provides improvements over standard implementations while maintaining proven effectiveness.
 Response Characteristics: 
 
 Standard EMA/RMA Configuration: Moderate trend lag (approximately 0.4 × length periods), smooth and stable channel width from RMA smoothing, good balance for most market conditions
 Fast HMA/EMA Configuration: Approximately 60% reduction in trend lag compared to EMA, responsive channel width from EMA ATR smoothing, suitable for quick trend changes and breakouts
 Adaptive KAMA/KAMA Configuration: Variable lag based on market efficiency, automatic adjustment to trending vs. ranging conditions, self-optimizing behavior reduces manual intervention
 
 Comparison with Traditional Keltner Channels: 
 Enhanced Version Advantages: 
 
 Dual Algorithm Flexibility: Independent MA selection for trend and volatility vs. fixed EMA/RMA, separate tuning of trend responsiveness and channel stability
 Market Adaptation: Choose configurations optimized for specific instruments and conditions, customize for scalping, swing, or position trading preferences
 Comprehensive Alerts: Enhanced alert system including channel expansion detection
 
 Traditional Version Advantages: 
 
 Simplicity: Fewer parameters, easier to understand and implement
 Standardization: Fixed EMA/RMA combination ensures consistency across users
 Research Base: Decades of backtesting and research on standard configuration
 
 When to Use Enhanced Version:  Trading multiple instruments with different characteristics, switching between trending and ranging markets, employing different strategies, algorithm-based trading systems requiring customization, seeking optimization for specific trading style and timeframe.
 When to Use Standard Version:  Beginning traders learning Keltner Channel concepts, following published research or trading systems, preferring simplicity and standardization, wanting to avoid optimization and curve-fitting risks.
 Performance Across Market Conditions: 
 
 Strong Trending Markets: EMA or HMA basis with RMA or TEMA ATR smoothing provides quicker trend identification, pullbacks to basis offer excellent entry opportunities
 Choppy/Ranging Markets: SMA or WMA basis with RMA ATR smoothing and lower multipliers, channel bounce strategies work well, avoid false breakouts
 Volatile Markets: KAMA or FRAMA with EMA or TEMA, adaptive algorithms excel by automatic adjustment, wider multipliers (2.5-3.0) accommodate large price swings
 Low Volatility/Consolidation: Channels narrow significantly indicating consolidation, algorithm choice less impactful, focus on detecting channel width contraction for breakout preparation
 
 Keltner Channel vs. Bollinger Bands - Usage Comparison: 
 Favor Keltner Channels When:  Trend-following is primary strategy, trading volatile instruments with gaps, want ATR-based volatility measurement, prefer fewer higher-quality channel touches, seeking stable channel width during trends.
 Favor Bollinger Bands When:  Mean-reversion is primary strategy, trading instruments with limited gaps, want statistical framework based on standard deviation, need squeeze patterns for breakout identification, prefer more frequent trading opportunities.
 Use Both Together:  Bollinger Band squeeze + Keltner Channel breakout is powerful combination, price outside Bollinger Bands but inside Keltner Channels indicates moderate signal, price outside both indicates very strong signal, Bollinger Bands for entries and Keltner Channels for trend confirmation.
 Limitations and Considerations: 
 General Limitations: 
 
 Lagging Indicator: All moving averages lag price, even with reduced-lag algorithms
 Trend-Dependent: Works best in trending markets, less effective in choppy conditions
 No Direction Prediction: Indicates volatility and deviation, not future direction, requires confirmation
 
 Enhanced Version Specific Considerations: 
 
 Optimization Risk: More parameters increase risk of curve-fitting historical data
 Complexity: Additional choices may overwhelm beginning traders
 Backtesting Challenges: Different algorithms produce different historical results
 
 Mitigation Strategies: 
 
 Use Confirmation: Combine with momentum indicators (RSI, MACD), volume, or price action
 Test Parameter Robustness: Ensure parameters work across range of values, not just optimized ones
 Multi-Timeframe Analysis: Confirm signals across different timeframes
 Proper Risk Management: Use appropriate position sizing and stops
 Start Simple: Begin with standard EMA/RMA before exploring alternatives
 
 Optimal Usage Recommendations: 
 For Maximum Effectiveness: 
 
 Start with standard EMA/RMA configuration to understand classic behavior
 Experiment with alternatives on demo account or paper trading
 Match algorithm combination to market condition and trading style
 Use channel width analysis to identify market phases
 Combine with complementary indicators for confirmation
 Implement strict risk management using ATR-based position sizing
 Focus on high-quality setups rather than trading every signal
 Respect the trend: trade with basis direction for higher probability
 
 Complementary Indicators: 
 
 RSI or Stochastic: Confirm momentum at channel extremes
 MACD: Confirm trend direction and momentum shifts
 Volume: Validate breakouts and trend strength
 ADX: Measure trend strength, avoid Keltner signals in weak trends
 Support/Resistance: Combine with traditional levels for high-probability setups
 Bollinger Bands: Use together for enhanced breakout and volatility analysis
 
 USAGE NOTES 
This indicator is designed for technical analysis and educational purposes. Keltner Channel Enhanced has limitations and should not be used as the sole basis for trading decisions. While the flexible moving average selection for both trend and volatility components provides valuable adaptability across different market conditions, algorithm performance varies with market conditions, and past characteristics do not guarantee future results.
Key considerations:
 
 Always use multiple forms of analysis and confirmation before entering trades
 Backtest any parameter combination thoroughly before live trading
 Be aware that optimization can lead to curve-fitting if not done carefully
 Start with standard EMA/RMA settings and adjust only when specific conditions warrant
 Understand that no moving average algorithm can eliminate lag entirely
 Consider market regime (trending, ranging, volatile) when selecting parameters
 Use ATR-based position sizing and risk management on every trade
 Keltner Channels work best in trending markets, less effective in choppy conditions
 Respect the trend direction indicated by price position relative to basis line
 
The enhanced flexibility of dual algorithm selection provides powerful tools for adaptation but requires responsible use, thorough understanding of how different algorithms behave under various market conditions, and disciplined risk management.
Aladin Pair Trading System v1Aladin Pair Trading System v1 
What is This Indicator?
The Aladin Pair Trading System is a sophisticated tool designed to help traders identify profitable opportunities by comparing two related stocks that historically move together. Think of it as finding when one twin is running ahead or lagging behind the other - these moments often present trading opportunities as they tend to return to moving together.
Who Should Use This?
Beginners: Learn about statistical arbitrage and pair trading
Intermediate Traders: Execute mean-reversion strategies with confidence
Advanced Traders: Fine-tune parameters for optimal pair relationships
Portfolio Managers: Implement market-neutral strategies
💡 What is Pair Trading? 
Imagine two ice cream shops next to each other. They usually have similar customer traffic because they're in the same area. If one day Shop A is packed while Shop B is empty, you might expect this imbalance to correct itself soon.
Pair trading works the same way:
You find two stocks that normally move together (like TCS and Infosys)
When one stock moves too far from the other, you trade expecting them to realign
You buy the lagging stock and sell the leading stock
When they come back together, you profit from both sides
Key Features
1. Z-Score Analysis
What it is: A statistical measure showing how far the price relationship has deviated from normal
What it means:
Z-Score near 0 = Normal relationship
Z-Score at +2 = Stock A is expensive relative to Stock B (Sell A, Buy B)
Z-Score at -2 = Stock A is cheap relative to Stock B (Buy A, Sell B)
2. Multiple Timeframe Analysis
Long-term Z-Score (300 bars): Shows the big picture trend
Short-term Z-Score (100 bars): Shows recent movements
Signal Z-Score (20 bars): Generates quick trading signals
3. Statistical Validation
The indicator checks if the pair is suitable for trading:
Correlation (must be > 0.7): Confirms the stocks move together
1.0 = Perfect positive correlation
0.7 = Strong correlation
Below 0.7 = Warning: pair may not be reliable
ADF P-Value (should be < 0.05): Tests if the relationship is stable
Low value = Good for pair trading
High value = Relationship may be random
Cointegration: Confirms long-term equilibrium relationship
YES = Pair tends to revert to mean
NO = Pair may drift apart permanently
Visual Elements Explained
Chart Zones (Color-Coded Areas)
Yellow Zone (-1.5 to +1.5)
Normal Zone: Relationship is stable
Action: Wait for better opportunities
Blue Zone (±1.5 to ±2.0)
Entry Zone: Deviation is significant
Action: Prepare for potential trades
Green/Red Zone (±2.0 to ±3.0)
Opportunity Zone: Strong deviation
Action: High-probability trade setups
Beyond ±3.0
Risk Limit: Extreme deviation
Action: Either maximum opportunity or structural break
Signal Arrows
Green Arrow Up (Buy A + Sell B):
Stock A is undervalued relative to B
Buy Stock A, Short Stock B
Red Arrow Down (Sell A + Buy B):
Stock A is overvalued relative to B
Sell Stock A, Buy Stock B
Settings Guide
Symbol Inputs
Pair Symbol (Symbol B): Choose the second stock to compare
Default: NSE:INFY (Infosys)
Example pairs: TCS/INFY, HDFCBANK/ICICIBANK, RELIANCE/ONGC
Z-Score Parameters
Long Z-Score Period (300): Historical context
Short Z-Score Period (100): Recent trend
Signal Period (20): Trading signals
Z-Score Threshold (2.0): Entry trigger level
Higher = Fewer but stronger signals
Lower = More frequent signals
Statistical Parameters
Correlation Period (240): How many bars to check correlation
Hurst Exponent Period (50): Measures mean-reversion tendency
Probability Lookback (100): Historical probability calculations
Trading Parameters
Entry Threshold (0.0): Minimum Z-score for entry
Risk Threshold (1.5): Warning level
Risk Limit (3.0): Maximum deviation to trade
How to Use (Step-by-Step)
Step 1: Choose Your Pair
Add the indicator to your chart (this becomes Stock A)
In settings, select Stock B (the comparison stock)
Choose stocks from the same sector for best results
Step 2: Verify Pair Quality
Check the Statistics Table (top-right corner):
✅ Correlation > 0.70 (Green = Good)
✅ ADF P-value < 0.05 (Green = Good)
✅ Cointegrated = YES (Green = Good)
If all three are green, the pair is suitable for trading!
Step 3: Wait for Signals
BUY SIGNAL (Green Arrow Up)
Z-Score crosses above -2.0
Action: Buy Stock A, Sell Stock B
Exit: When Z-Score returns to 0
SELL SIGNAL (Red Arrow Down)
Z-Score crosses below +2.0
Action: Sell Stock A, Buy Stock B
Exit: When Z-Score returns to 0
Step 4: Risk Management
Yellow Zone: Monitor only
Blue Zone: Prepare for entry
Green/Red Zone: Active trading zone
Beyond ±3.0: Maximum risk - use caution
⚠️ Important Warnings
Not All Pairs Work: Always check the statistics table first
Market Conditions Matter: Correlation can break during market stress
Use Stop Losses: Set stops at Z-Score ±3.5 or beyond
Position Sizing: Trade both legs with appropriate hedge ratios
Transaction Costs: Factor in brokerage and slippage for both stocks
Example Trade
Scenario: TCS vs INFOSYS
Correlation: 0.85 ✅
Z-Score: -2.3 (TCS is cheap vs INFY)
Action to be taken:
Buy 1lot of TCS Future
Sell 1lot of INFOSYS Future
Expected Outcome:
As Z-Score moves toward 0, TCS outperforms INFOSYS
Close both positions when Z-Score crosses 0
Profit from the convergence
Best Practices
Test Before Trading: Use paper trading first
Sector Focus: Choose pairs from the same industry
Monitor Statistics: Check correlation daily
Avoid News Events: Don't trade pairs during earnings/major news
Size Appropriately: Start small, scale with experience
Be Patient: Wait for high-quality setups (±2.0 or beyond)
What Makes This Indicator Unique?
Multi-timeframe Z-Score analysis: Three different perspectives
Statistical validation: Built-in correlation and cointegration tests
Visual risk zones: Easy-to-understand color-coded areas
Real-time statistics: Live pair quality monitoring
Beginner-friendly: Clear signals with educational zones
Technical Background
The indicator uses:
Engle-Granger Cointegration Test: Validates pair relationship
ADF (Augmented Dickey-Fuller) Test: Tests stationarity
Pearson Correlation: Measures linear relationship
Z-Score Normalization: Standardizes deviations
Log Returns: Handles price differences properly
Support & Community
For questions, suggestions, or to share your pair trading experiences:
Comment below the indicator
Share your successful pair combinations
Report any issues for quick fixes
Disclaimer
This indicator is for educational and informational purposes only. It does not constitute financial advice. Pair trading involves risk, including the risk of loss. 
Always:
Do your own research
Understand the risks
Trade with money you can afford to lose
Consider consulting a financial advisor
📌 Quick Reference Card
Z-ScoreInterpretationAction-3.0 to -2.0A very cheap vs BStrong Buy A, Sell B-2.0 to -1.5A cheap vs BBuy A, Sell B-1.5 to +1.5Normal rangeHold/Wait+1.5 to +2.0A expensive vs BSell A, Buy B+2.0 to +3.0A very expensive vs BStrong Sell A, Buy B
Good Pair Statistics:
Correlation: > 0.70
ADF P-value: < 0.05
Cointegration: YES
Version: 1.0
Last Updated: 10th October 2025
Compatible: TradingView Pine Script v6
Happy Trading! 
cd_VWAP_mtg_CxCd_VWAP_mtg_Cx 
 Overview 
The most important condition for being successful and profitable in the market is to consistently follow the same rules without compromise, while the price constantly moves in countless different ways.
Regardless of the concept or trading school, those who have rules win.
In this indicator, we will define and use three main sections to set and apply our rules.
The indicator uses the VWAP (Volume Weighted Average Price) — price weighted by volume.
Two VWAPs can be displayed either by manually entering date and time, or by selecting from the menu.
From the menu, you can select the following reference levels:
•	HTF Open: Opening candle of the higher timeframe
•	ATH / ATL: All-Time High / All-Time Low candles
•	PMH / PML, PWH / PWL, PDH / PDL, PH4H / PH4L: Previous Month, Week, Day, or H4 Highs/Lows
•	MH / ML, WH / WL, DH / DL, H4H / H4L: Current Month, Week, Day, or H4 Highs/Lows
Additionally, it includes:
•	Mitigation / Order Block zones (local buyer-seller balance) across two timeframes.
•	Buy/Sell Side Liquidity levels (BSL / SSL) from the aligned higher timeframe (target levels).
________________________________________
 Components and Usage 
 1 – VWAP 
Calculated using the classical method:
•	High + Volume for the upper value
•	Close + Volume for the middle value
•	Low + Volume for the lower value
The VWAP is displayed as a colored band, where the coloring represents the bias.
Let’s call this band FVB (Fair Value Band) for ease of explanation.
The FVB represents the final line of defense, the buyer/seller boundary, and in technical terms, it can be viewed as premium/discount zones or support/resistance levels.
Within this critical area, the strong side continues its move, while the weaker side is forced to retreat.
But does the side that breaks beyond the band always keep going?
We all know that’s not always the case — in different pairs and timeframes, price often violates both the upper and lower edges multiple times.
To achieve more consistent analysis, we’ll define a new set of rules.
________________________________________
 2 – Mitigation / Order Blocks 
In trading literature, there are dozens of different definitions and uses of mitigation or order blocks.
Here, we will interpret the candlesticks to create our own definition, and we’ll use the zones defined by candles that fit this pattern.
For simplicity, let’s abbreviate mitigation as “mtg.”
For a candle to be selected as an mtg, it must clearly show strength from one side (buyers or sellers) — which can also be observed visually on the chart.
________________________________________
Bullish mtg criteria:
1.	The first candle must be bullish (close > open) → buyers are strong.
2.	The next candle makes a new high (buyers push higher) but fails to close above and pulls back to close inside the previous range → sellers react.
It also must not break the previous low → buyers defend.
3.	In the following candle(s), as long as the first candle’s low is protected and the second candle’s high is broken, it indicates buyer strength → a bullish mtg is confirmed.
When price returns to this zone later (gets mitigated), the expectation is that the zone holds and price pushes upward again.
If the low is violated, the mtg becomes invalid.
In technical terms:
If the previous candle’s high is broken but no close occurs above it, the expectation is a reversal move that will retest its low.
 Question: 
What if the low is protected and in the next candle(s) a new high forms?
 Answer:  → Bullish mtg.
   
Bearish mtg (opposite)
  
 3 – Buy/Sell Side Liquidity Levels 
With the help of the aligned higher timeframe (swing points), we will define our market structure framework and set our liquidity targets accordingly. 
  
Let’s put the pieces together.
If we continue explaining from a trade-focused perspective, our first priority should be our bias — our projection or expectation of the market’s potential movement.
We will determine this bias using the FVB.
Since we know the band often gets violated on both sides, we want the price action to convince us of its strength.
To do that, we’ll use the first candle that closes beyond the band.
The distance from that candle’s high to low will be our threshold range 
Bullish level = high + (candle length × coefficient)
Bearish level = low - (candle length × coefficient)
When the price closes beyond this threshold, it demonstrates strength, and our bias will now align in that direction.
How long will this bias remain valid?
→ Until a closing candle appears on the opposite side of the band.
If a close occurs on the opposite side, then a new bias will only be confirmed once the new threshold level is broken.
During the period in between, we have no bias.
Let’s continue on the chart:
  
Now that our bias has been established, where and how do we look for trade opportunities?
There are two possible entry approaches:
•	Aggressive entry: Enter immediately with the breakout.
•	Conservative entry: Wait for a pullback and enter once a suitable structure forms.
(The choice depends on the user’s preference.)
At this stage, the user can apply their own entry model. Let’s give an example:
Let’s assume we’re looking for setups using HTF sweep + LTF CISD confirmation.
Once our bias turns bearish, we look for an HTF sweep forming on or near an FVB or mtg block, and then confirm the entry with a CISD signal.
  
In summary:
•	FVB defines the bias, the entry zone, and the target zone.
•	Mtg blocks represent entry zones.
•	BSL / SSL levels suggest target zones.
Overlapping FVB and mtg blocks are expected to be more effective.
The indicator also provides an option for a second FVB.
A band attached to a lower timeframe can be used as confirmation.
•	Main band: Bias + FVB
•	Extra band: Entry trigger confirmed by a close beyond it. 
  
Mtg blocks can provide trade entry opportunities, especially when the price is moving strongly in one direction (flow).
  
Consecutive or complementary mtg blocks indicate that the price is decisive in one direction, while sometimes also showing areas where we should wait before entering.
  
Mtg blocks that contain an FVG (Fair Value Gap) within their body are expected to be more effective.
 Settings: 
The default values are set to 1-3-5m, optimized for scalping trades.
 VWAP settings: 
Main VWAP (FVB):
•	Can be set by selecting a start time, manually entering date and time, or choosing a predefined level.
Extra VWAP (FVB):
•	Set from the menu. If not needed, select “none.”
•	Visibility, color, and fill settings for VWAP are located here.
•	Threshold levels visibility and color options are also in this section.
•	The multiplier is used for calculating the threshold level.
 Important: 
•	If the Extra VWAP is selected but not displayed, you need to increase the chart timeframe.
o	Example: If the chart is on 3m and you select WH from the extra options, it will not display correctly.
•	Upper limits for VWAP:
o	1m and 3m charts: daily High/Low
o	5m chart: weekly High/Low
________________________________________
 Mtg Settings: 
  
•	Visibility and color settings for blocks are configured here.
•	To display on a second timeframe, the box must be checked and the timeframe specified.
•	Optional display modes: “only active blocks,” “only last violated mtg,” or “all.”
•	For confirmation and removal criteria, choosing high/low or close determines the source used for mtg block formation and deletion conditions. 
 BSL/SSL Settings: 
•	Visibility, color, font size, and line style can be configured in this section.
When “Auto” is selected, the aligned timeframe is determined automatically by the indicator, while in manual mode, the user defines the timeframe.
 Final Words: 
Simply opening trades every time the price touches the VWAP or mtg blocks will not make you a profitable trader. Searching for setups with similar structures while maintaining proper risk management will yield better results in the long run.
I would be happy to hear your feedback and suggestions.
 Happy trading! 
CVD Pro – Smart Overlay + Signals (with Persist Mode)What this Indicator Does
CVD Pro visualizes Cumulative Volume Delta (CVD) data directly on your main price chart — helping you detect real buying vs. selling pressure in real time.
Unlike most CVD scripts that run in a separate subwindow, this one overlays price-mapped CVD curves on the candles themselves for better confluence with market structure and FVG zones.
The script dynamically scales normalized CVD values to the price range and uses adaptive smoothing and deviation bands to highlight shifts in trader behavior.
It also includes automatic bullish/bearish crossover signals, displayed as on-chart labels.
⚙️ Main Features
✅ Price-mapped CVD Overlay
CVD is normalized (Z-score) and projected onto the price chart for easy visual correlation with price structure.
✅ Multi-Timeframe Presets
Three sensitivity presets optimized for different chart environments:
Strict (4H) → Best for macro trends and high-timeframe structure.
Balanced (1H / 30m) → Great for active swing setups.
Sensitive (15m) → Captures short-term intraday reversals.
✅ Dynamic Bands & Smoothing
Deviation bands visualize statistical extremes in delta pressure — helping to identify exhaustion and divergence points.
✅ Smart Buy/Sell Signal Logic
Automatic label triggers when the CVD Overlay crosses its smoothed baseline:
🟢 BULL LONG → Rising CVD above the mean (buyers in control).
🔴 BEAR SHORT → Falling CVD below the mean (sellers in control).
✅ Persist Mode
Toggle to keep the last signal visible until a new one forms — ideal for traders who prefer clean chart annotations without noise.
✅ Clean, Minimal Overlay
Everything happens directly on your chart — no extra windows, no clutter. Designed for use with Smart Money Concepts, Fair Value Gaps (FVGs), or volume imbalance setups.
🧩 Use Case
CVD Pro is designed for traders who:
Use Smart Money Concepts (SMC) or ICT-style trading
Watch for FVG reactions, breaker blocks, and liquidity sweeps
Need to confirm order flow direction or momentum strength
Trade intraday or swing setups with precision entries and clear bias confirmation
⚡ Recommended Settings
4H / 1H: Use Strict mode for major structure and confirmation.
1H / 30m: Balanced mode for clear mid-term trend alignment.
15m: Sensitive mode to catch scalps and lower-TF shifts.
🧠 Pro Tips
Combine with RSI or Market Structure Breaks (MSS) for additional confluence.
A strong CVD divergence near a key FVG or 0.5–0.705 Fibonacci zone often signals reversal.
Persistent CVD crossover + price structure break = high-probability entry.
🧩 Credits
Created by Patrick S. ("Nova Labs")
Concept inspired by professional order-flow analytics and adaptive Z-Score normalization.
Would you like me to write a shorter “public summary” paragraph (for the short description at the top of TradingView, the one-liner users see before expanding)?
It’s usually a 2–3 sentence hook like:
“Overlay-based CVD indicator that merges volume delta with price structure. Detect true buying/selling pressure using adaptive normalization, deviation bands, and clean bullish/bearish crossover signals.”
First Passage Time - Distribution AnalysisThe First Passage Time (FPT) Distribution Analysis indicator is a sophisticated probabilistic tool that answers one of the most critical questions in trading: "How long will it take for price to reach my target, and what are the odds of getting there first?"
Unlike traditional technical indicators that focus on what might happen, this indicator tells you when it's likely to happen.
 Mathematical Foundation: First Passage Time Theory 
What is First Passage Time?
First Passage Time (FPT) is a concept in stochastic processes that measures the time it takes for a random process to reach a specific threshold for the first time. Originally developed in physics and mathematics, FPT has applications in:
 
 Quantitative Finance: Option pricing, risk management, and algorithmic trading
 Neuroscience: Modeling neural firing patterns
 Biology: Population dynamics and disease spread
 Engineering: Reliability analysis and failure prediction
 
 The Mathematics Behind It 
This indicator uses Geometric Brownian Motion (GBM), the same stochastic model used in the Black-Scholes option pricing formula:
dS = μS dt + σS dW
Where:
S = Asset price
μ = Drift (trend component)
σ = Volatility (uncertainty component)
dW = Wiener process (random walk)
Through Monte Carlo simulation, the indicator runs 1,000+ price path simulations to statistically determine:
 
 When each threshold (+X% or -X%) is likely to be hit
 Which threshold is hit first (directional bias)
 How often each scenario occurs (probability distribution)
 
 🎯 How This Indicator Works 
Core Algorithm Workflow: 
 
 Calculate Historical Statistics
 Measures recent price volatility (standard deviation of log returns)
 Calculates drift (average directional movement)
 Annualizes these metrics for meaningful comparison
 Run Monte Carlo Simulations
 Generates 1,000+ random price paths based on historical behavior
 Tracks when each path hits the upside (+X%) or downside (-X%) threshold
 Records which threshold was hit first in each simulation
 Aggregate Statistical Results
 Calculates percentile distributions (10th, 25th, 50th, 75th, 90th)
 Computes "first hit" probabilities (upside vs downside)
 Determines average and median time-to-target
 Visual Representation
 Displays thresholds as horizontal lines
 Shows gradient risk zones (purple-to-blue)
 Provides comprehensive statistics table
 
 📈 Use Cases 
1. Options Trading
 
 Selling Options: Determine if your strike price is likely to be hit before expiration
 Buying Options: Estimate probability of reaching profit targets within your time window
 Time Decay Management: Compare expected time-to-target vs theta decay
 Example: You're considering selling a 30-day call option 5% out of the money. The indicator shows there's a 72% chance price hits +5% within 12 days. This tells you the trade has high assignment risk.
 
2. Swing Trading
 
 Entry Timing: Wait for higher probability setups when directional bias is strong
 Target Setting: Use median time-to-target to set realistic profit expectations
 Stop Loss Placement: Understand probability of hitting your stop before target
 Example: The indicator shows 85% upside probability with median time of 3.2 days. You can confidently enter long positions with appropriate position sizing.
 
3. Risk Management
 
 Position Sizing: Larger positions when probability heavily favors one direction
 Portfolio Allocation: Reduce exposure when probabilities are near 50/50 (high uncertainty)
 Hedge Timing: Know when to add protective positions based on downside probability
 Example: Indicator shows 55% upside vs 45% downside—nearly neutral. This signals high uncertainty, suggesting reduced position size or wait for better setup.
 
4. Market Regime Detection
 
 Trending Markets: High directional bias (70%+ one direction)
 Range-bound Markets: Balanced probabilities (45-55% both directions)
 Volatility Regimes: Compare actual vs theoretical minimum time
 Example: Consistent 90%+ bullish bias across multiple timeframes confirms strong uptrend—stay long and avoid counter-trend trades.
 
 First Hit Rate (Most Important!) 
Shows which threshold is likely to be hit FIRST:
 
 Upside %: Probability of hitting upside target before downside
 Downside %: Probability of hitting downside target before upside
 These always sum to 100%
 
 ⚠️ Warning: If you see "Low Hit Rate" warning, increase this parameter! 
 Advanced Parameters 
Drift Mode
Allows you to explore different scenarios:
 
 Historical: Uses actual recent trend (default—most realistic)
 Zero (Neutral): Assumes no trend, only volatility (symmetric probabilities)
 50% Reduced: Dampens trend effect (conservative scenario)
 Use Case: Switch to "Zero (Neutral)" to see what happens in a pure volatility environment, useful for range-bound markets.
 
Distribution Type
 
 Percentile: Shows 10%, 25%, 50%, 75%, 90% levels (recommended for most users)
 Sigma: Shows standard deviation levels (1σ, 2σ)—useful for statistical analysis
 
 ⚠️ Important Limitations & Best Practices 
Limitations
 
 Assumes GBM: Real markets have fat tails, jumps, and regime changes not captured by GBM
 Historical Parameters: Uses recent volatility/drift—may not predict regime shifts
 No Fundamental Events: Cannot predict earnings, news, or macro shocks
 Computational: Runs only on last bar—doesn't give historical signals
 
Remember: Probabilities are not certainties. Use this indicator as part of a comprehensive trading plan with proper risk management.
Created by: Henrique Centieiro. feedback is more than welcome!
Micro SuiteWhat it is: One Pine v5 indicator that stacks several tools: EMA ribbon + a color-flipping 11/34 EMA trend line, multi-timeframe RSI pressure arrows, and a Bollinger Band re-entry system that marks Top/Bottom triggers (T/B) and later “r” confirmations. It also sprinkles in 3-Line Strike, Leledc exhaustion dots, and a small “Micro Dots” engine (ATR regime + VMA filter). Alerts for all of it. 
TradingView
The core signals you’ll actually use:
RSI arrows: Up arrow when current RSI(6) < 30 and selected higher-TF RSIs are also < 30; down arrow when > 70 cluster cools. Idea = stacked OB/OS “pressure.” 
TradingView
Bollinger re-entry (T/B + r):
T = first close back inside upper band; B = first close back inside lower band.
r = confirmation within N bars (price takes out the trigger bar’s high/low). These bars tint so they’re easy to see. 
TradingView
Trend filter: EMA-11 vs EMA-34 color flip + optional VMA trend line; helps you ignore counter-trend stabs. 
TradingView
Quick playbook (how to read it):
Reversal short: See a T near the top band → get the r within your window → bonus if a down RSI arrow or a Leledc high dot shows up.
Reversal long: Mirror that with B → r, plus an up RSI arrow/Leledc low dot.
Continuation: If Micro Dot stays green (or red) and 11>34 EMA holds, ignore isolated T/B traps. 
TradingView
Inputs that matter:
confirmBars for the T/B “r” window.
Which higher-TF RSIs must agree for arrows.
Show/hide and lengths for EMAs and BB.
Micro block: show dots, VMA line, and speed (Fast/Med/Slow). 
TradingView
Why people like it: You get trend, momentum, and mean-revert cues on one pane with ready-made alerts, so it’s easier to build a ruleset (e.g., “only take B→r longs when 11>34 and there’s an RSI up arrow”). 
TradingView
Caveats: It’s still just TA—OB/OS clusters can persist in trends; confirmations can miss V-shaped turns; and stacking signals can be late in fast markets. Pair it with risk rules (fixed R, ATR stops) and a higher-TF bias.
One-liner cheat sheet:
Longs: B → r + RSI up arrow + 11>34 (optional Micro Dot green).
Shorts: T → r + RSI down arrow + 11<34 (optional Micro Dot red). 
TradingView
Trend RiderTrend Rider  is an all-in-one trading tool that helps you catch reversals, confirm trends, and spot key market levels with precision. It blends EMA clouds, volume filters, Bollinger Bands, swing levels, and session ranges into one streamlined system.
 What makes Trend Rider powerful 
	•	Dual EMA Clouds – clearly show short-term vs. long-term trend direction.
	•	Buy/Sell Signals – triggered on EMA crossovers, confirmed by volume strength.
	•	BB Reversal Mode – filters trades with Bollinger volatility and proximity to band extremes.
	•	Swing Levels – auto-plot important Highs/Lows as dynamic support and resistance.
	•	Session Ranges – highlight U.S. session and weekend boxes to track liquidity and gaps.
	•	Timeframe Guard – optimized exclusively for the 15-minute chart for higher accuracy.
	•	Alerts – every signal can fire TradingView notifications on bar close for higher reliability.
 Core Value 
Instead of stacking multiple tools, Trend Rider merges everything into one: trend confirmation, volume analysis, volatility filters, and key levels. The result is cleaner charts, sharper signals, and faster decisions.
 Сreated with vibecoding using ChatGPT and Claude. 
HTF Candle Highs and Lows with Labels + High Probability Signals█ OVERVIEW
This indicator overlays Weekly, Daily, and H4 High/Low levels directly onto your chart, allowing traders to visualize key support and resistance zones from higher timeframes. It also includes high probability breakout signals that appear one candle after a confirmed breakout above or below these levels, filtered by volume and candle strength.
Use this tool to identify breakout opportunities with greater confidence and clarity.
█ FEATURES
• Plots Weekly, Daily, and H4 High and Low levels using request.security. • Customizable line colors, widths, and label sizes. • Toggle visibility for each timeframe independently. • Signals appear one candle after a confirmed breakout:   • Bullish: Close above HTF High, strong candle, high volume.   • Bearish: Close below HTF Low, strong candle, high volume. • Signal shapes match the color of the broken level for visual clarity.
█ HOW TO USE
1 — Enable the timeframes you want to track using the input toggles. 2 — Watch for triangle-shaped signals:   • Upward triangle = Bullish breakout.   • Downward triangle = Bearish breakout. 3 — Confirm the breakout:   • Candle closes beyond the HTF level by at least 0.1%.   • Candle body shows momentum (close > open for bullish, close < open for bearish).   • Volume exceeds 20-period average. 4 — Enter trade on the candle after the signal. 5 — Use the HTF level as a reference for stop-loss placement. 6 — Combine with other indicators (e.g., RSI, EMA) for confluence.
█ LIMITATIONS
• Signals may lag by one candle due to confirmation logic. • Not optimized for low-volume assets or illiquid markets. • Best used in trending environments; avoid during consolidation. • Does not include automatic alerts (can be added manually).
█ BEST PRACTICES
• Use on H1 or higher timeframes for cleaner signals. • Avoid trading during news events or low volatility. • Backtest thoroughly before live trading. • Adjust breakout percentage and volume filter based on asset volatility. • Maintain a trading journal to track performance.
BayesStack RSI [CHE]BayesStack RSI   — Stacked RSI with Bayesian outcome stats and gradient visualization
  Summary 
BayesStack RSI builds a four-length RSI stack and evaluates it with a simple Bayesian success model over a rolling window. It highlights bull and bear stack regimes, colors price with magnitude-based gradients, and reports per-regime counts, wins, and estimated win rate in a compact table. Signals seek to be more robust through explicit ordering tolerance, optional midline gating, and outcome evaluation that waits for events to mature by a fixed horizon. The design focuses on readable structure, conservative confirmation, and actionable context rather than raw oscillator flips.
  Motivation: Why this design? 
Classical RSI signals flip frequently in volatile phases and drift in calm regimes. Pure threshold rules often misclassify shallow pullbacks and stacked momentum phases. The core idea here is ordered, spaced RSI layers combined with outcome tracking. By requiring a consistent order with a tolerance and optionally gating by the midline, regime identification becomes clearer. A horizon-based maturation check and smoothed win-rate estimate provide pragmatic feedback about how often a given stack has recently worked.
  What’s different vs. standard approaches? 
 Reference baseline: Traditional single-length RSI with overbought and oversold rules or simple crossovers.
 Architecture differences:
   Four fixed RSI lengths with strict ordering and a spacing tolerance.
   Optional requirement that all RSI values stay above or below the midline for bull or bear regimes.
   Outcome evaluation after a fixed horizon, then rolling counts and a prior-smoothed win rate.
   Dispersion measurement across the four RSIs with a percent-rank diagnostic.
   Gradient coloring of candles and wicks driven by stack magnitude.
   A last-bar statistics table with counts, wins, win rate, dispersion, and priors.
 Practical effect: Charts emphasize sustained momentum alignment instead of single-length crosses. Users see when regimes start, how strong alignment is, and how that regime has recently performed for the chosen horizon.
  How it works (technical) 
The script computes RSI on four lengths and forms a “stack” when they are strictly ordered with at least the chosen tolerance between adjacent lengths. A bull stack requires a descending set from long to short with positive spacing. A bear stack requires the opposite. Optional gating further requires all RSI values to sit above or below the midline.
For evaluation, each detected stack is checked again after the horizon has fully elapsed. A bull event is a success if price is higher than it was at event time after the horizon has passed. A bear event succeeds if price is lower under the same rule. Rolling sums over the training window track counts and successes; a pair of priors stabilizes the win-rate estimate when sample sizes are small.
Dispersion across the four RSIs is measured and converted to a percent rank over a configurable window. Gradients for bars and wicks are normalized over a lookback, then shaped by gamma controls to emphasize strong regimes. A statistics table is created once and updated on the last bar to minimize overhead. Overlay markers and wick coloring are rendered to the price chart even though the indicator runs in a separate pane.
  Parameter Guide 
 Source — Input series for RSI. Default: close. Tips: Use typical price or hlc3 for smoother behavior.
 Overbought / Oversold — Guide levels for context. Defaults: seventy and thirty. Bounds: fifty to one hundred, zero to fifty. Tips: Narrow the band for faster feedback.
 Stacking tolerance (epsilon) — Minimum spacing between adjacent RSIs to qualify as a stack. Default: zero point twenty-five RSI points. Trade-off: Higher values reduce false stacks but delay entries.
 Horizon H — Bars ahead for outcome evaluation. Default: three. Trade-off: Longer horizons reduce noise but delay success attribution.
 Rolling window — Lookback for counts and wins. Default: five hundred. Trade-off: Longer windows stabilize the win rate but adapt more slowly.
 Alpha prior / Beta prior — Priors used to stabilize the win-rate estimate. Defaults: one and one. Trade-off: Larger priors reduce variance with sparse samples.
 Show RSI 8/13/21/34 — Toggle raw RSI lines. Default: on.
 Show consensus RSI — Weighted combination of the four RSIs. Default: on.
 Show OB/OS zones — Draw overbought, oversold, and midline. Default: on.
 Background regime — Pane background tint during bull or bear stacks. Default: on.
 Overlay regime markers — Entry markers on price when a stack forms. Default: on.
 Show statistics table — Last-bar table with counts, wins, win rate, dispersion, priors, and window. Default: on.
 Bull requires all above fifty / Bear requires all below fifty — Midline gate. Defaults: both on. Trade-off: Stricter regimes, fewer but cleaner signals.
 Enable gradient barcolor / wick coloring — Gradient visuals mapped to stack magnitude. Defaults: on. Trade-off: Clearer regime strength vs. extra rendering cost.
 Collection period — Normalization window for gradients. Default: one hundred. Trade-off: Shorter values react faster but fluctuate more.
 Gamma bars and shapes / Gamma plots — Curve shaping for gradients. Defaults: zero point seven and zero point eight. Trade-off: Higher values compress weak signals and emphasize strong ones.
 Gradient and wick transparency — Visual opacity controls. Defaults: zero.
 Up/Down colors (dark and neon) — Gradient endpoints. Defaults: green and red pairs.
 Fallback neutral candles — Directional coloring when gradients are off. Default: off.
 Show last candles — Limit for gradient squares rendering. Default: three hundred thirty-three.
 Dispersion percent-rank length / High and Low thresholds — Window and cutoffs for dispersion diagnostics. Defaults: two hundred fifty, eighty, and twenty.
 Table X/Y, Dark theme, Text size — Table anchor, theme, and typography. Defaults: right, top, dark, small.
  Reading & Interpretation 
 RSI stack lines: Alignment and spacing convey regime quality. Wider spacing suggests stronger alignment.
 Consensus RSI: A single line that summarizes the four lengths; use as a smoother reference.
 Zones: Overbought, oversold, and midline provide context rather than standalone triggers.
 Background tint: Indicates active bull or bear stack.
 Markers: “Bull Stack Enter” or “Bear Stack Enter” appears when the stack first forms.
 Gradients: Brighter tones suggest stronger stack magnitude; dull tones suggest weak alignment.
 Table: Count and Wins show sample size and successes over the window. P(win) is a prior-stabilized estimate. Dispersion percent rank near the high threshold flags stretched alignment; near the low threshold flags tight clustering.
  Practical Workflows & Combinations 
 Trend following: Enter only on new stack markers aligned with structure such as higher highs and higher lows for bull, or lower lows and lower highs for bear. Use the consensus RSI to avoid chasing into overbought or oversold extremes.
 Exits and stops: Consider reducing exposure when dispersion percent rank reaches the high threshold or when the stack loses ordering. Use the table’s P(win) as a context check rather than a direct signal.
 Multi-asset and multi-timeframe: Defaults travel well on liquid assets from intraday to daily. Combine with higher-timeframe structure or moving averages for regime confirmation. The script itself does not fetch higher-timeframe data.
  Behavior, Constraints & Performance 
 Repaint and confirmation: Stack markers evaluate on the live bar and can flip until close. Alert behavior follows TradingView settings. Outcome evaluation uses matured events and does not look into the future.
 HTF and security: Not used. Repaint paths from higher-timeframe aggregation are avoided by design.
 Resources: max bars back is two thousand. The script uses rolling sums, percent rank, gradient rendering, and a last-bar table update. Shapes and colored wicks add draw overhead.
 Known limits: Lag can appear after sharp turns. Very small windows can overfit recent noise. P(win) is sensitive to sample size and priors. Dispersion normalization depends on the collection period.
  Sensible Defaults & Quick Tuning 
Start with the shipped defaults.
 Too many flips: Increase stacking tolerance, enable midline gates, or lengthen the collection period.
 Too sluggish: Reduce stacking tolerance, shorten the collection period, or relax midline gates.
 Sparse samples: Extend the rolling window or increase priors to stabilize P(win).
 Visual overload: Disable gradient squares or wick coloring, or raise transparency.
  What this indicator is—and isn’t 
This is a visualization and context layer for RSI stack regimes with simple outcome statistics. It is not a complete trading system, not predictive, and not a signal generator on its own. Use it with market structure, risk controls, and position management that fit your process.
 Metadata 
- Pine version: v6
- Overlay: false (price overlays are drawn via forced overlay where applicable)
- Primary outputs: Four RSI lines, consensus line, OB/OS guides, background tint, entry markers, gradient bars and wicks, statistics table
- Inputs with defaults: See Parameter Guide
- Metrics and functions used: RSI, rolling sums, percent rank, dispersion across RSI set, gradient color mapping, table rendering, alerts
- Special techniques: Ordered RSI stacking with tolerance, optional midline gating, horizon-based outcome maturation, prior-stabilized win rate, gradient normalization with gamma shaping
- Performance and constraints: max bars back two thousand, rendering of shapes and table on last bar, no higher-timeframe data, no security calls
- Recommended use-cases: Regime confirmation, momentum alignment, post-entry management with dispersion and recent outcome context
- Compatibility: Works across assets and timeframes that support RSI
- Limitations and risks: Sensitive to parameter choices and market regime changes; not a standalone strategy
- Diagnostics: Statistics table, dispersion percent rank, gradient intensity
 Disclaimer 
The content provided, including all code and materials, is strictly for educational and informational purposes only. It is not intended as, and should not be interpreted as, financial advice, a recommendation to buy or sell any financial instrument, or an offer of any financial product or service. All strategies, tools, and examples discussed are provided for illustrative purposes to demonstrate coding techniques and the functionality of Pine Script within a trading context.
Any results from strategies or tools provided are hypothetical, and past performance is not indicative of future results. Trading and investing involve high risk, including the potential loss of principal, and may not be suitable for all individuals. Before making any trading decisions, please consult with a qualified financial professional to understand the risks involved.
By using this script, you acknowledge and agree that any trading decisions are made solely at your discretion and risk.
Best regards and happy trading
Chervolino.
Do not use this indicator on Heikin-Ashi, Renko, Kagi, Point-and-Figure, or Range charts, as these chart types can produce unrealistic results for signal markers and alerts.
Best MA Finder: Sharpe/Sortino ScannerThis script, Best MA Finder: Sharpe/Sortino Scanner, is a tool designed to identify the moving average (SMA or EMA) that best acts as a dynamic trend threshold on a chart, based on risk-adjusted historical performance. It scans a wide range of MA lengths (SMA or EMA) and selects the one whose simple price vs MA crossover delivered the strongest results using either the Sharpe ratio or the Sortino ratio. Reading it is intuitive: when price spent time above the selected MA, conditions were on average more favorable in the backtest; below, less favorable. It is a trend and risk gauge, not an overbought or oversold signal.
What it does:
- Runs individual long-only crossover backtests for many MA lengths across short to very long horizons.
- For each length, measures the total number of trades, the annualized Sharpe ratio, and the annualized Sortino ratio.
- Uses the chosen metric value (Sharpe or Sortino) as the score to rank candidates.
- Applies a minimum trade filter to discard statistically weak results.
- Optionally applies a local stability filter to prefer a length that also outperforms its close neighbors by at least a small margin.
- Selects the optimal MA and displays it on the chart with a concise summary table.
How to use it:
- Choose MA type: SMA or EMA.
- Choose the metric: Sharpe or Sortino.
- Set the minimum trade count to filter out weak samples.
- Select the risk-free mode:
  Auto: uses a short-term risk-free rate for USD-priced symbols when available.
  Manual: you provide a risk-free ticker.
  None: no risk-free rate.
- Optionally enable stability controls: neighbor radius and epsilon.
- Toggle the on-chart summary table as needed.
On-chart output:
- The selected optimal MA is plotted.
- The optional table shows MA length, number of trades, chosen metric value annualized, and the annual risk-free rate used.
Key features:
- Risk-adjusted optimization via Sharpe or Sortino for fair, comparable assessment.
- Broad MA scan with SMA and EMA support.
- Optional stability filter to avoid one-off spikes.
- Clear and auditable presentation directly on the chart.
Use cases:
- Traders who want a defensible, data-driven trend threshold without manual trial and error.
- Swing and trend-following workflows across timeframes and asset classes.
- Quick SMA vs EMA comparisons using risk-adjusted results.
Limitations:
- Not a full trading strategy with position sizing, costs, funding, slippage, or stops.
- Long-only, one position at a time.
- Discrete set of MA lengths, not a continuous optimizer.
- Requires sufficient price history and, if used, a reliable risk-free series.
This script is open-source and built from original logic. It does not replicate closed-source scripts or reuse significant external components.
Z-Score Trend Channels [BackQuant]Z-Score Trend Channels  
 A self-contained price-statistics framework that turns a rolling z-score into price channels, bias states, and trade markers. Run either trend-following or mean-reversion from the same tool with clear, on-chart context. 
 What it is 
  
  A rolling statistical map that measures how far price is from its recent average in standard-deviation units (z-score).
  Adaptive channels drawn in price space from fixed z thresholds, so the rails breathe with volatility.
  A simple trend proxy from z-score momentum to separate trending from ranging conditions.
  On-chart signals for pullback entries, stretched extremes, and practical exits.
  
 Core idea (plain English math) 
  
  Rolling mean and volatility  - Over a lookback you get the average price and its standard deviation.
  Z-score  - How many standard deviations the current price is above or below its average: z = (price - mean) / stdev. z near 0 means near average; positive is above; negative is below.
  Noise control  - An EMA smooths the raw z to reduce jitter and false flickers.
  Channels back in price  - Fixed z levels are converted back to price to form the upper, lower, and extreme rails.
  Trend proxy  - A smoothed change in z is used as a lightweight trend-strength line. Positive strength with positive z favors uptrend; negative strength with negative z favors downtrend.
  
 What you see on the chart 
  
  Channels and fills  - Mean, upper, lower, and optional extreme lines. The area mean->upper tints with the bearish color, mean->lower tints with the bullish color.
  Background tint (optional)  - Soft green, red, or neutral based on detected trend state.
  Signals  - Bullish Entry (triangle up) when z exits the oversold zone upward; Bearish Entry (triangle down) when z exits the overbought zone downward; Extreme markers (diamonds) at the extreme bands with a one-bar turn.
  Table  - Current z, trend state, trend strength, distance to bands, market state tag, and a quick volatility regime label.
  Edge labels  - MEAN, OB, and OS labels slightly projected forward with level values.
  
 Inputs you will actually use 
  
  Z-Score Period  - Lookback for mean and stdev. Larger = slower and steadier rails, smaller = more reactive.
  Smoothing Period  - EMA on z. Lower = earlier but choppier flips; higher = later but cleaner.
  Price Source  - Default hlc3. Choose close if you prefer session-close logic.
  Upper and Lower Thresholds  - Default around +2.0 and -2.0. Tighten for more signals, widen for fewer and stronger.
  Extreme Upper and Lower  - Deeper stretch guards, e.g., +/- 2.5.
  Strength Period  - EMA on z momentum. Sets how fast the trend proxy flips.
  Trend Threshold  - Minimum absolute z to accept a directional bias.
  Visual toggles  - Channels, signals, background tint, stats table, colors, and optional last-bar trend label.
  
 How to use it: trend-following playbook 
  
  Read the state  - Uptrend when z > Trend Threshold and trend strength > 0. Downtrend when z < -Trend Threshold and trend strength < 0. Neutral otherwise.
  Entries  - In an uptrend, prefer Bullish Entry signals that fire near the lower channel. In a downtrend, prefer Bearish Entry signals that fire near the upper channel.
  Stops  - Conservative: beyond the extreme channel on your side. Tighter: just outside the standard band that framed the signal.
  Exits  - For longs, exit or trim on a cross back through z = 0 or a clean tag of the upper threshold. For shorts, mirror with z = 0 up-cross or tag of the lower threshold. You can also reduce if trend strength flips against you.
  Adds  - In strong trends, additional signals near your side’s band can be add points. Avoid adding once z hovers near the opposite band for several bars.
  
 How to use it: mean-reversion playbook 
  
  Find stretch  - Standard reversions: Bullish Entry when z leaves the oversold zone upward; Bearish Entry when z leaves the overbought zone downward. Aggressive reversions: Extreme markers at extreme bands with a one-bar turn.
  Entries  - Take the signal as price exits the zone. Prefer setups where trend strength is near zero or tilting against the prior push.
  Targets  - First target is the mean line. A runner can aim for the opposite standard channel if momentum keeps flipping.
  Stops  - Outside the extreme band beyond your entry. If fading without extremes, place risk just beyond the opposite standard band.
  Filters  - Optional: skip counter-trend fades against a very strong trend state unless your risk is tight and predefined.
  
 Reading the stats table 
  
  Current Z-Score  - Magnitude and sign of displacement now.
  Trend State  - Uptrend, Downtrend, or Ranging.
  Trend Strength  - Smoothed z momentum. Higher absolute values imply stronger directional conviction.
  Distance to Upper/Lower  - Percent distance from price to each band, useful for sizing targets or judging room left.
  Market State  - Overbought, Oversold, Extreme OB, Extreme OS, or Normal.
  Volatility Regime  - High, Normal, or Low relative to recent distribution. Expect bands to widen in High and tighten in Low.
  
 Parameter guidance (conceptual) 
  
  Z-Score Period  - Choose longer for a structural mean, shorter for a reactive mean.
  Smoothing Period  - Lower for earlier but noisier reads; higher for slower but steadier reads.
  Thresholds  - Start around +/- 2.0. Tighten for scalping or quiet ranges. Widen for noisy or fast markets.
  Trend Threshold and Strength Period  - Raise to avoid weak, transient bias. Lower to capture earlier regime shifts.
  
 Practical examples 
  
  Trend pullback long  - State shows Uptrend. Price tests the lower channel; z dips near or below the lower threshold; a Bullish Entry prints. Stop just below extreme lower; first target mean; keep a runner if trend strength stays positive.
  Mean-revert short  - State is Ranging. z tags the extreme upper, an Extreme Bearish marker prints, then a Bearish Entry prints on the leave. Stop above extreme upper; target the mean; consider a runner toward the lower channel if strength turns negative.
  
 Potential Questions you might have 
  
  Why z-score instead of fixed offsets  - Because the bands adapt with volatility. When the tape gets quiet the rails tighten, when it runs hot the rails expand. Your entries stay normalized.
  Do I need both modes  - No. Many users run only trend pullbacks or only mean-reversions. The tool lets you toggle what you need and keep the chart readable.
  Multi-timeframe workflow  - A common approach is to set bias from a higher timeframe’s trend state and execute on a lower timeframe’s signals that align with it.
  
 Summary 
  Z-Score Trend Channels gives you an adaptive mean, volatility-aware rails, a simple trend lens, and clear signals. Trade the trend by buying pullbacks in green and selling pullbacks in red, or fade stretched extremes back to the mean with defined risk. One framework, two strategies, consistent logic. 
Multi Momentum 10/21/42/63 — Histogram + 2xSMAMY MM INDICATOR INDIRED BY KARADI
It averages four rate-of-change snapshots of price, all anchored at today’s close.
If “Show as %” is on, the value is multiplied by 100.
Each term is a simple momentum/ROC over a different lookback.
Combining 10, 21, 42, 63 bars blends short, medium, and intermediate horizons into one number.
Positive MM → average upward pressure across those horizons; negative MM → average downward pressure.
Why those lengths?
They roughly stack into ~2× progression (10→21≈2×10, 21→42=2×21, 63≈1.5×42). That creates a “multi-scale” momentum that’s less noisy than a single fast ROC but more responsive than a long ROC alone.
How to read the panel
Gray histogram = raw Multi-Momentum value each bar.
SMA Fast/Slow lines (defaults 12 & 26 over the MM values) = smoothing of the histogram to show the trend of momentum itself.
Typical signals
Zero-line context:
Above 0 → bullish momentum regime on average.
Below 0 → bearish regime.
Crosses of SMA Fast & Slow: momentum trend shifts (fast above slow = improving momentum; fast below slow = deteriorating).
Histogram vs SMA lines: widening distance suggests strengthening momentum; narrowing suggests momentum is fading.
Divergences: price makes a new high/low but MM doesn’t → potential exhaustion.
Compared to a classic ROC
A single ROC(20) is very sensitive to that one window.
MM averages several windows, smoothing idiosyncrasies (e.g., a one-off spike 21 bars ago) and reducing “lookback luck.”
Settings & customization
Lookbacks (10/21/42/63): you can tweak for your asset/timeframe; the idea is to mix short→medium horizons.
Percent vs raw ratio: percent is easier to compare across symbols.
SMA lengths: shorter = more reactive but choppier; longer = smoother but slower.
Practical tips
Use regime + signal: trade longs primarily when MM>0 and fast SMA>slow SMA; consider shorts when MM<0 and fast
Pairs Trading Scanner [BackQuant]Pairs Trading Scanner  
 What it is 
 This scanner analyzes the relationship between your  chart symbol  and a chosen  pair symbol  in real time. It builds a normalized “spread” between them, tracks how tightly they move together (correlation), converts the spread into a Z-Score (how far from typical it is), and then prints clear  LONG / SHORT / EXIT  prompts plus an at-a-glance dashboard with the numbers that matter.
 Why pairs at all? 
  
  Markets co-move. When two assets are statistically related, their relationship (the spread) tends to oscillate around a mean.
  Pairs trading doesn’t require calling overall market direction you trade the  relative mispricing  between two instruments.
  This scanner gives you a robust, visual way to find those dislocations, size their significance, and structure the trade.
  
 How it works (plain English) 
  
  Step 1   Pick a partner:  Select the  Pair Symbol  to compare against your chart symbol. The tool fetches synchronized prices for both.
  Step 2   Build a spread:  Choose a  Spread Method  that defines “relative value” (e.g., Log Spread, Price Ratio, Return Difference, Price Difference). Each lens highlights a different flavor of divergence.
  Step 3   Validate relationship:  A rolling  Correlation  checks if the pair is moving together enough to be tradable. If correlation is weak, the scanner stands down.
  Step 4   Standardize & score:  The spread is normalized (mean & variability over a lookback) to form a  Z-Score . Large absolute Z means “stretched,” small means “near fair.”
  Step 5   Signals:  When the Z-Score crosses user-defined thresholds  with sufficient correlation , entries print:
  LONG  = long chart symbol / short pair symbol,
  SHORT  = short chart symbol / long pair symbol,
  EXIT  = mean reversion into the exit zone or correlation failure.
  
 Core concepts (the three pillars) 
  
  Spread Method    Your definition of “distance” between the two series.
  Guidance: 
  
  Log Spread:  Focuses on proportional differences; robust when prices live on different scales.
  Price Ratio:  Classic relative value; good when you care about “X per Y.”
  Return Difference:  Emphasizes recent performance gaps; nimble for momentum-to-mean plays.
  Price Difference:  Straight subtraction; intuitive for similar-scale assets (e.g., two ETFs).
  
  Correlation    A rolling score of co-movement. The scanner requires it to be above your  Min Correlation  before acting, so you’re not trading random divergence.
  Z-Score    “How abnormal is today’s spread?” Positive = chart richer than pair; negative = cheaper. Thresholds define entries/exits with transparent, statistical context.
  
 What you’ll see on the chart 
  
  Correlation plot  (blue line) with a dashed  Min Correlation  guide. Above the line = green zone for signals; below = hands off.
  Z-Score plot  (white line) with colored, dashed  Entry  bands and dotted  Exit  bands. Zero line for mean.
  Normalized spread  (yellow) for a quick “shape read” of recent divergence swings.
  Signal markers :
  LONG  (green label) when Z < –Entry and corr OK,
  SHORT  (red label) when Z > +Entry and corr OK,
  EXIT  (gray label) when Z returns inside the Exit band or correlation drops below the floor.
  Background tint  for active state (faint green for long-spread stance, faint red for short-spread stance).
  
 The two built-in dashboards 
  Statistics Table (top-right) 
  
  Pair Symbol    Your chosen partner.
  Correlation    Live value vs. your minimum.
  Z-Score    How stretched the spread is now.
  Current / Pair Prices    Real-time anchors.
  Signal State    NEUTRAL / LONG / SHORT.
  Price Ratio    Context for ratio-style setups.
  
 Analysis Table (bottom-right) 
  
  Avg Correlation    Typical co-movement level over your window.
  Max |Z|    The recent extremes of dislocation.
  Spread Volatility    How “lively” the spread has been.
  Trade Signal    A human-readable prompt (e.g., “LONG A / SHORT B” or “NO TRADE” / “LOW CORRELATION”).
  Risk Level    LOW / MEDIUM / HIGH based on current stretch (absolute Z).
  
 Signals logic (plain English) 
  
  Entry (LONG):  The spread is unusually negative (chart cheaper vs pair)  and  correlation is healthy. Expect mean reversion upward in the spread: long chart, short pair.
  Entry (SHORT):  The spread is unusually positive (chart richer vs pair)  and  correlation is healthy. Expect mean reversion downward in the spread: short chart, long pair.
  Exit:  The spread relaxes back toward normal (inside your exit band), or correlation deteriorates (relationship no longer trusted).
  
 A quick, repeatable workflow 
  
  1) Choose your pair  in context (same sector/theme or known macro link). Think: “Do these two plausibly co-move?”
  2) Pick a spread lens  that matches your narrative (ratio for relative value, returns for short-term performance gaps, etc.).
  3) Confirm correlation  is above your floor no corr, no trade.
  4) Wait for a stretch  (Z beyond Entry band) and a printed  LONG / SHORT .
  5) Manage to the mean  (EXIT band) or correlation failure; let the scanners’ state/labels keep you honest.
  
 Settings that matter (and why) 
  
  Spread Method    Defines the “mispricing” you care about.
  Correlation Period    Longer = steadier regime read, shorter = snappier to regime change.
  Z-Score Period    The window that defines “normal” for the spread; it sets the yardstick.
  Use Percentage Returns    Normalizes series when using return-based logic; keep on for mixed-scale assets.
  Entry / Exit Thresholds    Set your stretch and your target reversion zone. Wider entries = rarer but stronger signals.
  Minimum Correlation    The gatekeeper. Raising it favors quality over quantity.
  
 Choosing pairs (practical cheat sheet) 
  
  Same family:  two index ETFs, two oil-linked names, two gold miners, two L1 tokens.
  Hedge & proxy:  stock vs. sector ETF, BTC vs. BTC index, WTI vs. energy ETF.
  Cross-venue or cross-listing:  instruments that are functionally the same exposure but price differently intraday.
  
 Reading the cues like a pro 
  
  Divergence shape:  The yellow normalized spread helps you see rhythm fast spike and snap-back versus slow grind.
  Corr-first discipline:  Don’t fight the “Min Correlation” line. Good pairs trading starts with a relationship you can trust.
  Exit humility:  When Z re-centers, let the  EXIT  do its job. The edge is the journey to the mean, not overstaying it.
  
 Frequently asked (quick answers) 
  
  “Long/Short means what exactly?” 
  LONG  = long the chart symbol and short the pair symbol.
  SHORT  = short the chart symbol and long the pair symbol.
  “Do I need same price scales?”  No. The spread methods normalize in different ways; choose the one that fits your use case (log/ratio are great for mixed scales).
  “What if correlation falls mid-trade?”  The scanner will neutralize the state and print  EXIT . Relationship first; trade second.
  
 Field notes & patterns 
  
  Snap-back days:  After a one-sided session, return-difference spreads often flag cleaner intraday mean reversions.
  Macro rotations:  Ratio spreads shine during sector re-weights (e.g., value vs. growth ETFs); look for steady corr + elevated |Z|.
  Event bleed-through:  If one symbol reacts to news and its partner lags, Z often flags a high-quality, short-horizon re-centering.
  
 Display controls at a glance 
  
  Show Statistics Table    Live state & key numbers, top-right.
  Show Analysis Table    Context/risk read, bottom-right.
  Show Correlation / Spread / Z-Score    Toggle the sub-charts you want visible.
  Show Entry/Exit Signals    Turn markers on/off as needed.
  Coloring    Adjust Long/Short/Neutral and correlation line colors to match your theme.
  
 Alerts (ready to route to your workflow) 
  
  Pairs Long Entry    Z falls through the long threshold with correlation above minimum.
  Pairs Short Entry    Z rises through the short threshold with correlation above minimum.
  Pairs Trade Exit    Z returns to neutral or the relationship fails your correlation floor.
  Correlation Breakdown    Rolling correlation crosses your minimum; relationship caution.
  
 Final notes 
 The scanner is designed to keep you systematic: require relationship (correlation), quantify dislocation (Z-Score), act when stretched, stand down when it normalizes or the relationship degrades. It’s a full, visual loop for relative-value trading that stays out of your way when it should and gets loud only when the numbers line up.
OTFThis indicator identifies One Time Framing conditions directly on the chart. One Time Framing occurs when a bar’s high is higher than the previous bar’s high without breaking the previous low (for bullish OTF), or when a bar’s low is lower than the previous bar’s low without breaking the previous high (for bearish OTF).
This tool helps traders to spot continuation moves and trend confirmation within any timeframe. Customizable inputs allow users to select the desired time interval and highlight both bullish and bearish One Time Framing sequences.
How to use:
Apply this indicator on any timeframe to automatically highlight OTF events.
Use the visual markers to identify trend continuations or early reversals.
Adjust the settings panel for color preferences and OTF sensitivity.
No trading signals or strategies are provided; this indicator is strictly for identifying the OTF structure in market price action. Suitable for all levels of traders interested in market structure analysis.
Ighodalo Gold - CRT (Candles are ranges theory)This indicator is designed to automatically identify and display CRT (Candles are Ranges Theory) Candles on your chart. It draws the high and low of the identified range and extends them until price breaks out, providing clear levels of support and resistance.
The Candles are Ranges Theory (CRT) concept was originally developed and shared by a trader named Romeotpt (Raid). All credit for the trading methodology goes to him. This indicator simply makes spotting these specific candles easier.
What is a CRT Candle & How Is It Used?
A CRT candle is a single candle that has both the highest high AND the lowest low over a user-defined period. It is identified by analysing a block of recent candles and finding the one candle that contains the entire price range of that block.
Once a CRT candle is formed, its high and low act as an accumulation range.
A break above or below this range is the manipulation phase.
A reclaim of the range (price closing back inside) signifies a potential distribution phase.
On higher timeframes, this sequence can be interpreted as:
Candle 1: Accumulation
Candle 2: Manipulation
Candle 3: Distribution
Reversal (Turtle Soup):
A sweep of the high or low, followed by a quick reclaim (price closing back inside the range), can signify a reversal. According to the theory’s originator, Romeo, this reversal pattern is called “turtle soup.”
After a bearish reversal at the high, the target becomes the CRT low.
After a bullish reversal at the low, the target becomes the CRT high.
How to Use This Indicator
The indicator is flexible and can be adapted to your trading style. The most important settings are:
Max Lookback Period: Number of past candles ("n") the indicator checks within to find a CRT.
CRT Timeframe:
Select a timeframe (e.g., 1H): The indicator will look at the higher timeframe you selected and plot the most recent CRT range from that timeframe onto your current chart. This is useful for multi-timeframe analysis.
Enable Overlapping CRTs:
False (unchecked): Shows only one active CRT range at a time. The indicator won’t look for a new one until the current range is broken.
True (checked): Constantly searches for and displays all CRT ranges it finds, allowing multiple ranges to appear on the chart simultaneously.
Disclaimer & Notes
-This is a visualisation tool and not a standalone trading signal. Always use it alongside your own analysis and risk management strategy.
-All credit for the "Candles are Ranges Theory" (CRT) concept goes to its creator, Romeotpt (Raid).
"On the journey to the opposite side of the range, price often provides multiple turtle soup entry opportunities. Follow their footprints." — Raid, 2025
Volume Bubbles & Liquidity Heatmap [LuxAlgo]The  Volume Bubbles & Liquidity Heatmap  indicator highlights volume and liquidity clearly and precisely with its volume bubbles and liquidity heat map, allowing to identify key price areas.
Customize the bubbles with different time frames and different display modes: total volume, buy and sell volume, or delta volume.
🔶  USAGE 
  
The primary objective of this tool is to offer traders a straightforward method for analyzing volume on any selected timeframe.
By default, the tool displays buy and sell volume bubbles for the daily timeframe over the last 2,000 bars. Traders should be aware of the difference between the timeframe of the chart and that of the bubbles.
The tool also displays a liquidity heat map to help traders identify price areas where liquidity accumulates or is lacking.
🔹  Volume Bubbles 
The bubbles have three possible display modes:
 
 Total Volume: Displays the total volume of trades per bubble.
 Buy & Sell Volume: Each bubble is divided into buy and sell volume.
 Delta Volume: Displays the difference between buy and sell volume.
 
Each bubble represents the trading volume for a given period. By default, the timeframe for each bubble is set to daily, meaning each bubble represents the trading volume for each day.
The size of each bubble is proportional to the volume traded; a larger bubble indicates greater volume, while a smaller bubble indicates lower volume.
The color of each bubble indicates the dominant volume: green for buy volume and red for sell volume.
  
One of the tool's main goals is to facilitate simple, clear, multi-timeframe volume analysis.
The previous chart shows Delta Volume bubbles with various chart and bubble timeframe configurations.
  
To correctly visualize the bubbles, traders must ensure there is a sufficient number of bars per bubble. This is achieved by using a lower chart timeframe and a higher bubble timeframe.
As can be seen in the image above, the greater the difference between the chart and bubble timeframes, the better the visualization.
🔹  Liquidity Heatmap 
  
The other main element of the tool is the liquidity heatmap. By default, it divides the chart into 25 different price areas and displays the accumulated trading volume on each.
The image above shows a 4-hour BTC chart displaying only the liquidity heatmap. Traders should be aware of these key price areas and observe how the price behaves in them, looking for possible opportunities to engage with the market.
  
The main parameters for controlling the heatmap on the settings panel are Rows and Cell Minimum Size. Rows modifies the number of horizontal price areas displayed, while Cell Minimum Size modifies the minimum size of each liquidity cell in each row.
As can be seen in the above BTC hourly chart, the cell size is 24 at the top and 168 at the bottom. The cells are smaller on top and bigger on the bottom.
The color of each cell reflects the liquidity size with a gradient; this reflects the total volume traded within each cell. The default colors are:
 
 Red: larger liquidity
 Yellow: medium liquidity
 Blue: lower liquidity
 
🔹  Using Both Tools Together 
This indicator provides the means to identify directional bias and market timing.
The main idea is that if buyers are strong, prices are likely to increase, and if sellers are strong, prices are likely to decrease. This gives us a directional bias for opening long or short positions. Then, we combine our directional bias with price rejection or acceptance of key liquidity levels to determine the timing of opening or closing our positions.
Now, let's review some charts.
  
This first chart is BTC 1H with Delta Weekly Bubbles. Delta Bubbles measure the difference between buy and sell volume, so we can easily see which group is dominant (buyers or sellers) and how strong they are in any given week. This, along with the key price areas displayed by the Liquidity Heatmap, can help us navigate the markets.
We divided market behavior into seven groups, and each group has several bubbles, numbered from 1 to 17.
 
 Bubbles 1, 2, and 3: After strong buyers market consolidates with positive delta, prices move up next week.
 Bubbles 3, 4, and 5: Strength changes from buyers to sellers. Next week, prices go down.
 Bubbles 6 and 7: The market trades at higher prices, but with negative delta. Next week, prices go down.
 Bubbles 7, 8, and 9: Strength changes from sellers to buyers. Next weeks (9 and 10), prices go up.
 Bubbles 10, 11, and 12: After strong buyers prices trade higher with a negative delta. Next weeks (12 and 13) prices go down.
 Bubbles 12, 14, and 15: Strength changes from sellers to buyers; next week, prices increase.
 Bubbles 15 and 16: The market trades higher with a very small positive delta; next week, prices go down.
 
Current bubble/week 17 is not yet finished. Right now, it is trading lower, but with a smaller negative delta than last week. This may signal that sellers are losing strength and that a potential reversal will follow, with prices trading higher.
  
This is the same BTC 1H chart, but with price rejections from key liquidity areas acting as strong price barriers.
When prices reach a key area with strong liquidity and are rejected, it signals a good time to take action.
By observing price behavior at certain key price levels, we can improve our timing for entering or exiting the markets.
🔶  DETAILS 
🔹  Bubbles Display 
  
From the settings panel, traders can configure the bubbles with four main parameters: Mode, Timeframe, Size%, and Shape.
The image above shows five-minute BTC charts with execution over the last 3,500 bars, different display modes, a daily timeframe, 100% size, and shape one.
  
The Size % parameter controls the overall size of the bubbles, while the Shape parameter controls their vertical growth.
Since the chart has two scales, one for time and one for price, traders can use the Shape parameter to make the bubbles round.
The chart above shows the same bubbles with different size and shape parameters.
You can also customize data labels and timeframe separators from the settings panel.
🔶  SETTINGS 
 
 Execute on last X bars: Number of bars for indicator execution
 
🔹  Bubbles 
 
 Display Bubbles: Enable/Disable volume bubbles.
 Bubble Mode: Select from the following options: total volume, buy and sell volume, or the delta between buy and sell volume.
 Bubble Timeframe: Select the timeframe for which the bubbles will be displayed.
 Bubble Size %: Select the size of the bubbles as a percentage.
 Bubble Shape: Select the shape of the bubbles. The larger the number, the more vertical the bubbles will be stretched.
 
🔹  Labels 
 
 Display Labels: Enable/Disable data labels, select size and location.
 
🔹  Separators 
 
 Display Separators: Enable/Disable timeframe separators and select color.
 
🔹  Liquidity Heatmap 
 
 Display Heatmap: Enable/Disable liquidity heatmap.
 Heatmap Rows: select number of rows to be displayed.
 Cell Minimum Size: Select the minimum size for each cell in each row.
 Colors.
 
🔹  Style 
 
 Buy & Sell Volume Colors.
Smarter Money Concepts Dashboard [PhenLabs]📊Smarter Money Concepts Dashboard  
Version:  PineScript™v6 
📌Description
The Smarter Money Concepts Dashboard is a comprehensive institutional trading analysis tool that combines six of our most powerful smarter money concepts indicators into one unified suite. This advanced system automatically detects and visualizes Fair Value Gaps, Inverted FVGs, Order Blocks, Wyckoff Springs/Upthrusts, Wick Rejection patterns, and ICT Market Structure analysis.
Built for serious traders who need institutional-grade market analysis, this dashboard eliminates subjective interpretation by automatically identifying where smart money is likely positioned. The integrated real-time dashboard provides instant status updates on all active patterns, making it easy to monitor market conditions at a glance.
🚀Points of Innovation
● Multi-Module Integration: Six different SMC concepts unified in one comprehensive system
● Real-Time Dashboard Display: Live tracking of all active patterns with customizable positioning
● Advanced Volume Filtering: Institutional volume confirmation across all pattern types
● Automated Pattern Management: Smart memory system prevents chart clutter while maintaining relevant zones
● Probability-Based Wyckoff Detection: Mathematical probability calculations for spring/upthrust patterns
● Dual FVG System: Both standard and inverted Fair Value Gap detection with equilibrium analysis
🔧Core Components
● Fair Value Gap Engine: Detects standard FVGs with volume confirmation and equilibrium line analysis
● Inverted FVG Module: Advanced IFVG detection using RVI momentum filtering for inversion confirmation
● Order Block System: Institutional order block identification with customizable mitigation methods
● Wyckoff Pattern Recognition: Automated spring and upthrust detection with probability scoring
● Wick Rejection Analysis: High-probability reversal patterns based on wick-to-body ratios
● ICT Market Structure: Simplified institutional concepts with commitment tracking
🔥Key Features
● Comprehensive Pattern Detection: All major SMC concepts in one indicator with automatic identification
● Volume-Confirmed Signals: Multiple volume filters ensure only institutional-grade patterns are highlighted
● Interactive Dashboard: Real-time status display with active pattern counts and module status
● Smart Memory Management: Automatic cleanup of old patterns while preserving relevant market zones
● Full Alert System: Complete notification coverage for all pattern types and signal generations
● Customizable Display Options: Adjustable colors, transparency, and positioning for all visual elements
🎨Visualization
● Color-Coded Zones: Distinct color schemes for bullish/bearish patterns across all modules
● Dynamic Box Extensions: Automatically extending zones until mitigation or invalidation
● Equilibrium Lines: Fair Value Gap midpoint analysis with dotted line visualization
● Signal Markers: Clear spring/upthrust signals with directional arrows and probability indicators
● Dashboard Table: Professional-grade status panel with module activation and pattern counts
● Candle Coloring: Wick rejection highlighting with transparency-based visual emphasis
📖Usage Guidelines
Fair Value Gap Settings
● Days to Analyze: Default 15, Range 1-100 - Controls historical FVG detection period
● Volume Filter: Enables institutional volume confirmation for gap validity
● Min Volume Ratio: Default 1.5 - Minimum volume spike required for gap recognition
● Show Equilibrium Lines: Displays FVG midpoint analysis for precise entry targeting
Order Block Configuration
● Scan Range: Default 25 bars - Lookback period for structure break identification
● Volume Filter: Institutional volume confirmation for order block validation
● Mitigation Method: Wick or Close-based invalidation for different trading styles
● Min Volume Ratio: Default 1.5 - Volume threshold for significant order block formation
Wyckoff Analysis Parameters
● S/R Lookback: Default 20 - Support/resistance calculation period for spring/upthrust detection
● Volume Spike Multiplier: Default 1.5 - Required volume increase for pattern confirmation
● Probability Threshold: Default 0.7 - Minimum probability score for signal generation
● ATR Recovery Period: Default 5 - Price recovery calculation for pattern strength assessment
Market Structure Settings
● Auto-Detect Zones: Automatic identification of high-volume thin zones
● Proximity Threshold: Default 0.20% - Price proximity requirements for zone interaction
● Test Window: Default 20 bars - Time period for zone commitment calculation
Display Customization
● Dashboard Position: Four corner options for optimal chart layout
● Text Size: Scalable from Tiny to Large for different screen configurations
● Pattern Colors: Full customization of all bullish and bearish zone colors
✅Best Use Cases
● Swing Trading: Identify major institutional zones for multi-day position entries
● Day Trading: Precise intraday entries at Fair Value Gaps and Order Block boundaries
● Trend Analysis: Market structure confirmation for directional bias establishment
● Risk Management: Clear invalidation levels provided by all pattern boundaries
● Multi-Timeframe Analysis: Works across all timeframes from 1-minute to monthly charts
⚠️Limitations
● Market Condition Dependency: Performance varies between trending and ranging market environments
● Volume Data Requirements: Requires accurate volume data for optimal pattern confirmation
● Lagging Nature: Some patterns confirmed after initial price movement has begun
● Pattern Density: High-volatility markets may generate excessive pattern signals
● Educational Tool: Requires understanding of smart money concepts for effective application
💡What Makes This Unique
● Complete SMC Integration: First indicator to combine all major smart money concepts comprehensively
● Real-Time Dashboard: Instant visual feedback on all active institutional patterns
● Advanced Volume Analysis: Multi-layered volume confirmation across all detection modules
● Probability-Based Signals: Mathematical approach to Wyckoff pattern recognition accuracy
● Professional Memory Management: Sophisticated pattern cleanup without losing market relevance
🔬How It Works
1. Pattern Detection Phase:
● Multi-timeframe scanning for institutional footprints across all enabled modules
● Volume analysis integration confirms patterns meet institutional trading criteria
● Real-time pattern validation ensures only high-probability setups are displayed
2. Signal Generation Process:
● Automated zone creation with precise boundary definitions for each pattern type
● Dynamic extension system maintains relevance until mitigation or invalidation occurs
● Alert system activation provides immediate notification of new pattern formations
3. Dashboard Update Cycle:
● Live status monitoring tracks all active patterns and module states continuously
● Pattern count updates provide instant feedback on current market condition density
● Commitment tracking for market structure analysis shows institutional engagement levels
 💡Note: 
This indicator represents institutional trading concepts and should be used as part of a comprehensive trading strategy. Pattern recognition accuracy improves with understanding of smart money principles. Combine with proper risk management and multiple confirmation methods for optimal results.
Trendline Breakout Strategy [KedArc Quant] Description
A single, rule-based system that builds two trendlines from confirmed swing pivots and trades their breakouts, with optional retest, trend-regime gates (EMA / HTF EMA), and ATR-based risk. All parts serve one decision flow: structure → breakout → gated entry → managed risk.
What it does (for traders)
Draws Up line (teal) through the last two Higher Lows and Down line (red) through the last two Lower Highs, then extends them forward.
Long when price breaks above red; Short when price breaks below teal.
Optional Retest entry: after a break, wait for a pullback toward the broken line within an ATR-scaled buffer.
Uses ATR stop and R-multiple target so risk is consistent across symbols/timeframes.
Labels HL1/HL2/LH1/LH2 so non-coders can verify which pivots built each line.
Why these components are combined
Pure breakout systems on trendlines suffer from three practical issues:
False breaks in chop → solved by trend-regime gates (EMA / HTF EMA) that only allow trades aligned with the prevailing trend.
Uneven volatility across markets/timeframes → solved by ATR-based stop/target, normalizing distance so R-multiples are comparable.
First break whipsaws near wedge apices → mitigated by the optional retest rule that demands a pullback/hold before entry.
These modules are not separate indicators with their own signals. They are support roles inside one method.
The pivot engine defines structure, the breakout detector defines signal, the regime gates decide if we’re allowed to take that signal, and the ATR module sizes risk.
Together they make the trendline breakout usable, testable, and explainable.
How it works (mechanism; each component explained)
1) Pivot engine (structure, non-repainting)
Swings are confirmed with ta.pivotlow/high(L, R). A pivot only exists after R bars (no look-ahead), so once plotted, the line built from those pivots will not repaint.
2) Trendline builder (geometry)
Teal line updates when two consecutive pivot lows satisfy HL2.price > HL1.price (and HL2 occurs after HL1).
Red line updates when two consecutive pivot highs satisfy LH2.price < LH1.price.
Lines are extended right and their current value is read every bar via line.get_price().
3) Breakout detector (signal)
On every bar, compute:
crossover(close, redLine) ⇒ Long breakout
crossunder(close, tealLine) ⇒ Short breakdown
4) Regime gates (trend filters, not separate signals)
EMA gate: allow longs only if close > EMA(len), shorts only if close < EMA(len).
HTF EMA gate (optional): same rule on a higher timeframe to avoid fighting the larger trend.
These do not create entries; they simply permit or block the breakout signal.
5) Retest module (optional confirmation)
After a breakout, record the line price. A valid retest occurs if price pulls back within an ATR-scaled buffer toward that broken line and then closes back in the breakout direction.
This reduces first-tick fakeouts.
6) Risk module (position exit)
Initial stop = ATR(len) × atrMult from entry.
Target = tpR × (ATR × atrMult) (e.g., 2R).
This keeps results consistent across instruments/timeframes.
Entries & exits
Long entry
Base: close breaks above red and passes EMA/HTF gates.
Retest (if enabled): after the break, price pulls back near the broken red line (within the ATR buffer) and holds; then enter.
Short entry
Mirror logic with teal (break below & gates), optionally with a retest.
Exit
strategy.exit places ATR stop & R-multiple target automatically.
Optional “flip”: close if the opposite base signal triggers.
How to use it (step-by-step)
Timeframe: 1–15m for intraday, 1–4h for swing.
Start defaults: Pivot L/R = 5, EMA len = 200, ATR len = 14, ATR mult = 2, TP = 2R, Retest = ON.
Tune sensitivity:
Faster lines (more trades): set L/R = 3–4.
Fewer counter-trend trades: enable HTF EMA (e.g., 60-min or Daily).
Visual audit: labels HL1/HL2 & LH1/LH2 show which pivots built each line—verify by eye.
Alerts: use Long breakout, Short breakdown, and Retest alerts to automate.
Originality (why it merits publication)
Trades the visualization: many “auto-trendline” tools only draw lines; this one turns them into testable, alertable rules.
Integrated design: each component has a defined role in the same pipeline—no unrelated indicators bolted together.
Transparent & non-repainting: pivot confirmation removes look-ahead; labels let non-coders understand the setup that produced each signal.
Notes & limitations
Lines update only after pivot confirmation; that lag is intentional to avoid repainting.
Breakouts near an apex can whipsaw; prefer Retest and/or HTF gate in choppy regimes.
Backtests are idealized; forward-test and size risk appropriately.
⚠️ Disclaimer 
This script is provided for educational purposes only.
Past performance does not guarantee future results.
Trading involves risk, and users should exercise caution and use proper risk management when applying this strategy.
Multipower Entry SecretMultipower Entry Secret indicator is designed to be the ultimate trading companion for traders of all skill levels—especially those who struggle with decision-making due to unclear or overwhelming signals. Unlike conventional trading systems cluttered with too many lines and confusing alerts, this indicator provides a clear, adaptive, and actionable guide for market entries and exits.
Key Points:
Clear Buy/Sell/Wait Signals:
The script dynamically analyzes price action, candle patterns, volume, trend strength, and higher time frame context. This means it gives you “Buy,” “Sell,” or “Wait” signals based on real, meaningful market information—filtering out the noise and weak trades.
Multi-Timeframe Adaptive Analysis:
It synchronizes signals between higher and current timeframes, ensuring you get the most reliable direction—reducing the risk of getting caught in fake moves or sudden reversals.
Automatic Support, Resistance & Liquidity Zones:
Key levels like support, resistance, and liquidity zones are auto-detected and displayed directly on the chart, helping you make precise decisions without manual drawing.
Real-Time Dashboard:
All relevant information, such as trend strength, market intent, volume sentiment, and the reason behind each signal, is neatly summarized in a dashboard—making monitoring effortless and intuitive.
Customizable & Beginner-Friendly:
Whether you’re a newcomer wanting straightforward guidance or a professional needing advanced customization, the indicator offers flexible options to adjust analysis depth, timeframes, sensitivity, and more.
Visual & Clutter-Free:
The design ensures that your chart remains clean and readable, showing only the most important information. This minimizes mental overload and allows for instant decision-making.
Who Will Benefit?
Beginners who want to learn trading logic, avoid common traps, and see the exact reason behind every signal.
Advanced traders who require adaptive multi-timeframe analytics, fast execution, and stress-free monitoring.
Anyone who wants to save screen time, reduce analysis paralysis, and have more confidence in every trade they take.
1. No Indicator Clutter
Intent:
Many traders get confused by charts filled with too many indicators and signals. This often leads to hesitation, missed trades, or taking random, risky trades.
In this Indicator:
You get a clean and clutter-free chart. Only the most important buy/sell/wait signals and relevant support/resistance/liquidity levels are shown. These update automatically, removing the “overload” and keeping your focus sharp, so your decision-making is faster and stress-free.
2. Exact Entry Guide
Intent:
Traders often struggle with entry timing, leading to FOMO (fear of missing out) or getting trapped in sudden market reversals.
In this Indicator:
The system uses powerful adaptive logic to filter out weak signals and only highlight the strongest market moves. This not only prevents you from entering late or on noise, but also helps avoid losses from false breakouts or whipsaws. You get actionable suggestions—when to enter, when to hold back—so your entries are high-conviction and disciplined.
3. HTF+LTF Logic: Multitimeframe Sync Analysis
Intent:
Most losing trades happen when you act only on the short-term chart, ignoring the bigger market trend.
In this Indicator:
Signals are based on both the current chart timeframe (LTF) and a higher (HTF, like hourly/daily) timeframe. The indicator synchronizes trend direction, momentum, and structure across both levels, quickly adapting to show you when both are aligned. This filtering results in “only trade with the bigger trend”—dramatically increasing your win rate and market confidence.
4. Auto Support/Resistance & Liquidity Zones
Intent:
Drawing support/resistance and liquidity zones manually is time-consuming and error-prone, especially for beginners.
In this Indicator:
The system automatically identifies and plots the most crucial support/resistance levels and liquidity zones on your chart. This is based on adaptive, real-time price and volume analysis. These zones highlight where major institutional activity, trap setups, or real breakouts/reversals are most likely, removing guesswork and giving you a clear reference for entries, exits, and stop placements.
5. Clear Action/Direction
Intent:
Traders need certainty—what does the market want right now? Most indicators are vague.
In this Indicator:
Your dashboard always displays in plain words (like “BUY”, “SELL”, or “WAIT”) what action makes sense in the current market phase. Whether it’s a bull trap, volume spike, wick reversal, or exhaustion—it’s interpreted and explained clearly. No more confusion—just direct, real-time advice.
6. For Everyone (Beginner to Pro)
Intent:
Most advanced indicators are overwhelming for new traders; simple ones lack depth for professionals.
In this Indicator:
It is simple enough for a beginner—just add it to the chart and instantly see what action to consider. At the same time, it includes advanced adaptive analysis, multi-timeframe logic, and customizable settings so professional traders can fine-tune it for their strategies.
7. Ideal Usage and User Benefits
Instant Decision Support:
Whenever you’re unsure about a trade, just look at the indicator’s suggestion for clarity.
Entry Learning:
Beginners get real-time “practice” by not only seeing signals, but also the reason behind them—improving your chart reading and market understanding.
Screen Time & Stress Reduction:
Clear, relevant information only; no noise, less fatigue, faster decisions.
Makes Trading Confident & Simple:
The smart dashboard splits actionable levels (HTF, LTF, action) so you never miss a move, avoid traps, and stay aligned with high-probability trades.
8. Advanced Input Settings (Smart Customization)
Explained with Examples:
Enable Wick Analysis:
Finds candles with strong upper/lower wicks (signs of rejection/buying/selling force), alerting you to hidden reversals and protecting from FOMO entries.
Enable Absorption:
Detects when heavy order flow from one side is “absorbed” by the other (shows where institutional buyers/sellers are likely active, helps spot fake breakouts).
Enable Unusual Breakout:
Highlights real breakouts—large volatility plus high volume—so you catch genuine moves and avoid random spikes.
Enable Range/Expansion:
Smartly flags sudden range expansions—when the market goes from quiet to volatile—so you can act at the start of real trends.
Trend Bar Lookback:
Adjusts how many bars/candles are used in trend calculations. Short (fast trades, more signals), long (more reliability, fewer whipsaws).
Bull/Bear Bars for Strong Trend Min:
Sets how many candles in a row must support a trend before calling it “strong”—prevents flipping signals, keeps you disciplined.
Volume MA Length:
Lets you adjust how many bars back volume is averaged—fine-tune for your asset and trading style for best volume signals.
Swing Lookback Bars:
Set how many bars to use for swing high/low detection—short (quick swing levels), long (stronger support/resistance).
HTF (Bias Window):
Decide which higher timeframe the indicator should use for big-picture market mood. Adjustable for any style (scalp, swing, position).
Adaptive Lookback (HTF):
Choose how much HTF history is used for detecting major extremes/zones. Quick adjust for more/less sensitivity.
Show Support/Resistance, Liquidity Zones, Trendlines:
Toggle them on/off instantly per your needs—keeps your chart relevant and tailored.
9. Live Dashboard Sections Explained
Intent HTF:
Shows if the bigger timeframe currently has a Bullish, Bearish, or Neutral (“Chop”) intent, based on strict volume/price body calculations. Instant clarity—no more guessing on trend bias.
HTF Bias:
Clear message about which side (buy/sell/sideways) controls the market on the higher timeframe, so you always trade with the “big money.”
Chart Action:
The central action for the current bar—Whether to Buy, Sell, or Wait—calculated from all indicator logic, not just one rule.
TrendScore Long/Short:
See how many candles in your chosen window were bullish or bearish, at a glance. Instantly gauge market momentum.
Reason (WHY):
Every time a signal appears, the “reason” cell tells you the primary logic (breakout, wick, strong trend, etc.) behind it. Full transparency and learning—never trade blindly.
Strong Trend:
Shows if the market is currently in a powerful trend or not—helping you avoid choppy, risky entries.
HTF Vol/Body:
Displays current higher timeframe volume and candle body %—helping spot when big players are active for higher probability trades.
Volume Sentiment:
A real-time analysis of market psychology (strong bullish/bearish, neutral)—making your decision-making much more confident.
10. Smart and User-Friendly Design
Multi-timeframe Adaptive:
All calculations can now be drawn from your choice of higher or current timeframe, ensuring signals are filtered by larger market context.
Flexible Table Position:
You can set the live dashboard/summary anywhere on the chart for best visibility.
Refined Zone Visualization:
Liquidity and order blocks are visually highlighted, auto-tuning for your settings and always cleaning up to stay clutter-free.
Multi-Lingual & Beginner Accessible:
With Hindi and simple English support, descriptions and settings are accessible for a wide audience—anyone can start using powerful trading logic with zero language barrier.
Efficient Labels & Clear Reasoning:
Signal labels and reasons are shown/removed dynamically so your chart stays informative, not messy.
Every detail of this indicator is designed to make trading both simpler and smarter—helping you avoid the common pitfalls, learn real price action, stay in sync with the market’s true mood, and act with discipline for higher consistency and confidence.
This indicator makes professional-grade market analysis accessible to everyone. It’s your trusted assistant for making smarter, faster, and more profitable trading decisions—providing not just signals, but also the “why” behind every action. With auto-adaptive logic, clear visuals, and strong focus on real trading needs, it lets you focus on capturing the moves that matter—every single time.
Kalman Adjusted Average True Range [BackQuant]Kalman Adjusted Average True Range  
  A volatility-aware trend baseline that fuses a Kalman price estimate with ATR “rails” to create a smooth, adaptive guide for entries, exits, and trailing risk. 
 Built on my original Kalman 
 This indicator is based on my original Kalman Price Filter:
 
 That core smoother is used here to estimate the “true” price path, then blended with ATR to control step size and react proportionally to market noise.
 What it plots 
  
  Kalman ATR Line   the main baseline that turns up/down with the filtered trend.
  Optional Moving Average of the Kalman ATR   a secondary line for confluence (SMA/Hull/EMA/WMA/DEMA/RMA/LINREG/ALMA).
  Candle Coloring   (optional) paint bars by the baseline’s current direction.
  
 Why combine Kalman + ATR? 
  
  Kalman  reduces measurement noise and produces a stable path without the lag of heavy MAs.
  ATR rails  scale the baseline’s step to current volatility, so it’s calm in chop and more responsive in expansion.
  The result is a single, intelligible line you can trade around: slope-up = constructive; slope-down = caution.
  
 How it works (plain English) 
  
  Each bar, the Kalman filter updates an internal state (tunable via  Process Noise ,  Measurement Noise , and  Filter Order ) to estimate the underlying price.
  An ATR band (Period × Factor) defines the allowed per-bar adjustment. The baseline cannot “jump” beyond those rails in one step.
  A direction flip is detected when the baseline’s slope changes sign (upturn/downturn), and alerts are provided for both.
  
 Typical uses 
  
  Trend confirmation   Trade in the baseline’s direction; avoid fading a firmly rising/falling line.
  Pullback timing   Look for entries when price mean-reverts toward a rising baseline (or exits on tags of a falling one).
  Trailing risk   Use the baseline as a dynamic guide; many traders set stops a small buffer beyond it (e.g., a fraction of ATR).
  Confluence   Enable the MA overlay of the Kalman ATR; alignment (baseline above its MA and rising) supports continuation.
  
 Inputs & what they do 
  Calculation 
  
  Kalman Price Source   which price the filter tracks (Close by default).
  Process Noise   how quickly the filter can adapt.  Higher  = more responsive (but choppier).
  Measurement Noise   how much you distrust raw price.  Higher  = smoother (but slower to turn).
  Filter Order (N)   depth of the internal state array.  Higher  = slightly steadier behavior.
  
 Kalman ATR 
  
  Period   ATR lookback. Shorter = snappier; longer = steadier.
  Factor   scales the allowed step per bar. Larger factors permit faster drift; smaller factors clamp movement.
  
 Confluence (optional) 
  
  MA Type & Period   compute an MA on the  Kalman ATR line , not on price.
  Sigma (ALMA)  if ALMA is selected, this input controls the curve’s shape. (Ignored for other MA types.)
  
 Visuals 
  
  Plot Kalman ATR  toggle the main line.
  Paint Candles  color bars by up/down slope.
  Colors   choose long/short hues.
  
 Signals & alerts 
  
  Trend Up   baseline turns upward (slope crosses above 0).
 Alert: “Kalman ATR Trend Up”
  Trend Down  baseline turns downward (slope crosses below 0).
 Alert: “Kalman ATR Trend Down”
  
 These are  state flips , not “price crossovers,” so you avoid many one-bar head-fakes.
 How to start (fast presets) 
  
  Swing (daily/4H)  ATR Period 7–14, Factor 0.5–0.8, Process Noise 0.02–0.05, Measurement Noise 2–4, N = 3–5.
  Intraday (5–15m)  ATR Period 5–7, Factor 0.6–1.0, Process Noise 0.05–0.10, Measurement Noise 2–3, N = 3–5.
  Slow assets / FX  raise Measurement Noise or ATR Period for calmer lines; drop Factor if the baseline feels too jumpy.
  
 Reading the line 
  
  Rising & curving upward  momentum building; consider long bias until a clear downturn.
  Flat & choppy   regime uncertainty; many traders stand aside or tighten risk.
  Falling & accelerating   distribution lower; short bias until a clean upturn.
  
 Practical playbook 
  
  Continuation entries   After a Trend Up alert, wait for a minor pullback toward the baseline; enter on evidence the line keeps rising.
  Exit/reduce   If long and the baseline flattens then turns down, trim or exit; reverse logic for shorts.
  Filters   Add a higher-timeframe check (e.g., only take longs when the daily Kalman ATR is rising).
  Stops   Place stops just beyond the baseline (e.g., baseline − x% ATR for longs) to avoid “tag & reverse” noise.
  
 Notes 
  
  This is a  guide  to state and momentum, not a guarantee. Combine with your process (structure, volume, time-of-day) for decisions.
  Settings are asset/timeframe dependent; start with the presets and nudge Process/Measurement Noise until the baseline “feels right” for your market.
  
 Summary 
 Kalman ATR takes the noise-reduction of a Kalman price estimate and couples it with volatility-scaled movement to produce a clean, adaptive baseline. If you liked the original Kalman Price Filter (), this is its trend-trading cousin purpose-built for cleaner state flips, intuitive trailing, and confluence with your existing






















