Volume Sentiment Breakout Channels [AlgoAlpha]🟠 OVERVIEW 
This tool visualizes breakout zones based on  volume sentiment within dynamic price channels . It identifies high-impact consolidation areas, quantifies buy/sell dominance inside those zones, and then displays real-time shifts in sentiment strength. When the market breaks above or below these sentiment-weighted channels, traders can interpret the event as a change in conviction, not just a technical breakout.
🟠 CONCEPTS 
The script builds on two layers of logic:
 
   Channel Detection : A volatility-based algorithm locates price compression areas using normalized highs and lows over a defined lookback. These “boxes” mark accumulation or distribution ranges.
   Volume Sentiment Profiling : Each channel is internally divided into small bins, where volume is aggregated and signed by candle direction. This produces a granular sentiment map showing which levels are dominated by buyers or sellers.
 
When a breakout occurs, the script clears the previous box and forms a new one, letting traders visually track transitions between phases of control. The colored gradients and text updates continuously reflect the internal bias—green for net-buying, red for net-selling—so you can see conviction strength at a glance.
🟠 FEATURES 
 
  Volume-weighted sentiment map inside each box, with gradient color intensity proportional to participation.
  
  Dynamic text display of current and overall sentiment within each channel.
  
  Real-time trail lines to show active bullish/bearish trend extensions after breakout.
  
 
🟠 USAGE 
 
   Setup : Add the script to your chart and enable  Strong Closes Only  if you prefer cleaner breakouts. Use shorter normalization length (e.g., 50–80) for fast markets; longer (100–200) for smoother transitions.
   Read Signals : Transparent boxes mark active sentiment channels. Green gradients show buy-side dominance, red shows sell-side. The middle dashed line is the equilibrium of the channel. “▲” appears when price breaks upward, “▼” when it breaks downward.
  
   Understanding Sentiment : The sentiment profile can be used to show the probability of the price moving up or down at respective price levels.
  
 
Penunjuk dan strategi
Session Streaks [LuxAlgo]The  Session Streaks  tool allows traders to identify whether a session is bullish or bearish on the chart. It also shows the current session streak, or the number of consecutive bullish or bearish sessions.
The tool features a dashboard with information about the session streaks of the underlying product on the chart.
🔶  USAGE 
  
Analyzing session streaks is commonly used for market timing by studying the number of consecutive sessions over time and how long they last before the market changes direction.
We identify a bullish session as one in which the closing price is equal to or greater than the opening price, and a bearish session as one in which the closing price is below the opening price.
Each session is labeled according to its bias (bullish or bearish) and the number of consecutive sessions of the same type that conform the current streak.
🔹  Dashboard 
  
The dashboard at the top shows information about the current session.
Under the "Streaks" header, historical information about session streaks is displayed, divided into bullish and bearish categories.
 
 Number: Total number of streaks.
 Median: The average duration of those streaks. We chose the median over the mean to avoid misrepresentation due to outliers.
 Mode: The most common streak duration.
 
As the image shows, for this particular market, there are more bullish streaks than bearish ones. Bullish streaks have an average duration that is longer than that of bearish streaks, and both have the same most common streak duration.
If the current session is bullish and the median streak duration for bullish sessions is three, then we could consider scenarios in which the next two sessions are bullish.
🔶  DETAILS 
🔹  Streaks On Larger Timeframes 
  
On timeframes lower than or equal to Daily, the tool identifies each consecutive session, but this behavior changes on larger timeframes.
On timeframes larger than daily, the tool identifies the last session of each bar. Let's use the chart in the image as a reference.
At the top of the image, there is a daily chart where each session corresponds to each candle. One candle equals one day.
In the middle, we have a weekly chart where each session is the last session of each week, which is usually Friday for the Nasdaq 100 futures contract. The levels and labels displayed correspond to the last session within each candle, which is the last day of each week.
The levels and labels on the monthly chart correspond to the last session of each month, which is the last day of each month.
🔹  Gradient Style 
  
Traders can choose between two different color gradients for the session background. Each gradient provides different information about price behavior within each session.
 
  Horizontal: Green indicates prices at the top of the session range and red indicates prices at the bottom.
  Vertical: Green indicates prices that are equal to or greater than the open price and red indicates prices that are below the open price of the session.
 
🔶  SETTINGS 
🔹  Dashboard 
 
  Dashboard: Enable or disable the dashboard.
  Position: Select the location of the dashboard.
  Size: Select the dashboard size.
 
🔹  Style 
 
  Bullish: Select a color for bullish sessions.
  Bearish: Select a color for bearish sessions.
  Transparency: Select a transparency level from 100 to 0.
  Gradient: Select a horizontal or vertical gradient.
💻 RSI Dual-Band Reversal Strategy (Hacker Mode)This 💻 RSI Dual-Band Reversal Strategy (Hacker Mode) is a mean-reversion trading strategy built on the Relative Strength Index (RSI) indicator.
It identifies potential trend reversals when price momentum reaches extreme overbought or oversold levels — then enters trades expecting the price to revert.
⚙️ Strategy Concept
The RSI measures market momentum on a scale of 0–100.
When RSI is too low, it signals an oversold market → potential buy.
When RSI is too high, it signals an overbought market → potential sell.
This strategy sets two reversal zones using dual RSI bands:
Zone	RSI Range	Meaning	Action
Upper Band	80–90	Overbought	Prepare to Sell
Lower Band	10–20	Oversold	Prepare to Buy
🧩 Code Breakdown
1. Input Parameters
rsiLength     = input.int(14)
upperBandHigh = input.float(90.0)
upperBandLow  = input.float(80.0)
lowerBandLow  = input.float(10.0)
lowerBandHigh = input.float(20.0)
You can adjust:
RSI Length (default 14) → sensitivity of the RSI.
Upper/Lower Bands → control when buy/sell triggers occur.
2. RSI Calculation
rsi = ta.rsi(close, rsiLength)
Calculates the RSI of the closing price over 14 periods.
3. Signal Logic
buySignal  = ta.crossover(rsi, lowerBandHigh)
sellSignal = ta.crossunder(rsi, upperBandLow)
Buy Signal: RSI crosses up through 20 → market rebounding from oversold.
Sell Signal: RSI crosses down through 80 → market turning from overbought.
4. Plotting
RSI line (lime green)
Bands:
🔴 80–90 (Sell Zone)
🟢 10–20 (Buy Zone)
Gray midline at 50 for reference.
Triangle markers for signals:
🟢 “BUY” below chart
🔴 “SELL” above chart
5. Trading Logic
if (buySignal)
    strategy.entry("Buy", strategy.long)
if (sellSignal)
    strategy.entry("Sell",  CRYPTO:BTCUSD  strategy.short  OANDA:XAUUSD  )
Opens a long position on a buy signal.
Opens a short position on a sell signal.
No explicit stop loss or take profit — positions reverse when an opposite signal appears.
🧠 How It Works (Step-by-Step Example)
RSI drops below 20 → oversold → buy signal triggers.
RSI rises toward 80 → overbought → sell signal triggers.
Strategy flips position, always staying in the market (either long or short).
📈 Visual Summary
Imagine the RSI line oscillating between 0 and 100:
100 ────────────────────────────────
 90 ───── Upper Band High (Sell Limit)
 80 ───── Upper Band Low  (Sell Trigger)
 50 ───── Midline
 20 ───── Lower Band High (Buy Trigger)
 10 ───── Lower Band Low  (Buy Limit)
  0 ────────────────────────────────
When RSI moves above 80 → SELL
When RSI moves below 20 → BUY
⚡ Strategy Profile
Category	Description
Type	Mean Reversion
Entry Rule	RSI crosses up 20 → Buy
Exit/Reverse Rule	RSI crosses down 80 → Sell
Strengths	Simple, effective in sideways/range markets, minimal lag
Weaknesses	Weak in strong trends, no stop-loss or take-profit logic
💡 Suggested Improvements
You can enhance this script by adding:
Stop loss & take profit levels (e.g., % or ATR-based).
Trend filter (e.g., trade only in direction of 200 EMA).
RSI smoothing to reduce noise.
Ichimoku Average with Margin█ OVERVIEW
“Ichimoku Average with Margin” is a technical analysis indicator based on an average of selected Ichimoku system lines, enhanced with a dynamic safety margin (tolerance). Designed for traders seeking a simple yet effective tool for trend identification with breakout confirmation. The indicator offers flexible settings, line and label coloring, visual fills, and alerts for trend changes.
█ CONCEPT
The Ichimoku Cloud (Ichimoku Kinko Hyo) is an excellent, comprehensive technical analysis system, but for many traders—especially beginners—it remains difficult to interpret due to multiple overlapping lines and time displacements.
Experimentally, I decided to create a simplified version based on its foundations: combining selected lines into a single readable average (avgLine) and introducing a dynamic safety margin that acts as a buffer against market noise.
This is not the full Ichimoku system—it’s merely a clear method for determining trend, accessible even to beginners. The trend changes only after the price closes beyond the margin, eliminating false signals.
█ FEATURES
Ichimoku Lines:
- Tenkan-sen (Conversion Line) – Donchian average over 9 periods
- Kijun-sen (Base Line) – Donchian average over 26 periods
- Senkou Span A – average of Tenkan and Kijun
- Senkou Span B – Donchian average over 52 periods
- Chikou Span – close price (no offset)
Dynamic Average (avgLine):
- Arithmetic mean of only the enabled Ichimoku lines – full component selection flexibility.
Safety Margin (tolerance):
Calculated as:
- tolerance = multiplier × SMA(|open - close|, periods)
- Default: multiplier 1.8, period 100.
Trend Detection:
- Uptrend → when price > avgLine + tolerance
- Downtrend → when price < avgLine - tolerance
- Trend changes only after full margin breakout.
- Margin can be set to 0 – then signals trigger on avgLine crossover.
Signal Labels:
- “Buy” (green, upward arrow) – on shift to uptrend
- “Sell” (red, downward arrow) – on shift to downtrend
Visual Fills:
- Between avgLine and marginLine
- Between avgLine and price (with transparency)
- Colors: green (uptrend), red (downtrend)
Alerts:
- Trend Change Up – price crosses above margin
- Trend Change Down – price crosses below margin
█ HOW TO USE
Add to Chart: Paste code in Pine Editor or find in the indicator library.
Settings:
Ichimoku Parameters:
- Conversion Line Length → default 9
- Base Line Length → default 26
- Leading Span B Length → default 52
- Average Body Periods → default 100
- Tolerance Multiplier → default 1.8
Line Selection:
- Enable/disable: Tenkan, Kijun, Span A, Span B, Chikou
Visual Settings:
- Uptrend Color → default green
- Downtrend Color → default red
- Fill Between Price & Avg → enables shadow fill
Signal Interpretation:
- Average Line (avgLine): Primary trend reference level.
- Margin (marginLine): Buffer – price must break it to change trend. Set to 0 for signals on avgLine crossover.
- Buy/Sell Labels: Appear only on confirmed trend change.
- Fills: Visualize distance between price, average, and margin.
- Alerts: Set in TradingView → notifications on trend change.
█ APPLICATIONS
The indicator works well in:
- Trend-following: Enter on Buy/Sell, exit on reversal.
- Breakout confirmation: Ideal for breakout strategies with false signal protection.
- Noise filtering: Margin eliminates consolidation fluctuations.
Adjusting margin to trading style:
- Short-term trading (scalping, daytrading): Reduce or set margin to 0 → more and faster signals (but more false ones).
- Long-term strategies (swing, position): Increase margin (e.g. 2.0–3.0) → fewer signals, higher quality.
Entry signals are not limited to Buy/Sell labels – use like moving averages:
- Test and bounce off avgLine as support/resistance
- avgLine breakout as momentum signal
- Pullback to margin as trend continuation entry
Combine with:
- Support/resistance levels
- Fair Value Gaps (FVG)
- Volume or other momentum indicators
█ NOTES
- Works on all markets and timeframes.
- Adjust multiplier and periods to instrument volatility.
- Higher multiplier → fewer signals, higher quality.
- Disable unused Ichimoku lines to simplify the average.
[AS] MACD-v  & Hist [Alex Spiroglou | S.M.A.R.T. TRADER SYSTEMS]    MACD-v & MACD-v Histogram  
=======================================
  Volatility Normalised Momentum 📈
     Twice Awarded Indicator 🏆
=======================================
 =======================================
✅ 1. INTRODUCTION TO THE MACD-v ✅
======================================= 
I created the MACD-v in 2015,
as a way to deal with the limitations
of well known indicators like the Stochastic, RSI, MACD.
I decided to publicly share a very small part of my research
in the form of a research paper I wrote in 2022,
titled  "MACD-v: Volatility Normalised Momentum". 
That paper was awarded twice:
 
1. The "Charles H. Dow" Award (2022), 
for outstanding research in Technical Analysis,
by the Chartered Market Technicians Association (CMTA)
 2. The "Founders" Award (2022), 
for advances in Active Investment Management,
by the National Association of Active Investment Managers (NAAIM)
  
=======================================
 ===================================================
❌ 2. WHY CREATE THE MACD-v ?
THE LIMITATIONS OF CONVENTIONAL MOMENTUM INDICATORS
==================================================== 
Technical Analysis indicators focused on momentum,
come in two general categories,
each with its own set of limitations:
 (i) Range Bound Oscillators (RSI, Stochastics, etc) 
These usually have a scaling of 0-100,
and thus have the advantage of having normalised readings,
that are comparable across time and securities.
However they have the following limitations (among others):
1. Skewing effect of steep trends
2. Indicator values do not adjust with and reflect true momentum 
    (indicator values are capped to 100)
 (ii) Unbound Oscillators (MACD, RoC, etc) 
These are boundless indicators,
and can expand with the market,
without being limited by a 0-100 scaling,
and thus have the advantage of really measuring momentum.
They have the main following limitations (among others):
1. Subjectivity of overbought / oversold levels
2. Not comparable across time
3. Not comparable across securities
  
=======================================
 =======================================
💡 3. THE SOLUTION TO SOLVE THESE LIMITATIONS
======================================= 
In order to deal with these limitations,
I decided to create an indicator,
that would be the "Best of two worlds".
A unique & hybrid indicator,
that would have objective normalised readings
(similar to Range Bound Oscillators - RSI)
but would also be able to have no upper/lower boundaries
(similar to Unbound Oscillators - MACD).
This would be achieved by "normalising" a boundless oscillator (MACD)
=======================================
 ==================================================
⛔ 4. DEEP DIVE INTO THE 5 LIMITATIONS OF THE MACD
================================================== 
A Bloomberg study found that the MACD
is the most popular indicator after the RSI,
but the MACD has 5 BIG limitations.
 Limitation 1: MACD values are not comparable across Time 
The raw MACD values shift 
as the underlying security's absolute value changes across time,
making historical comparisons obsolete
e.g S&P 500 maximum MACD was 1.56 in 1957-1971,
but reached 86.31 in 2019-2021 - not indicating 55x stronger momentum, 
but simply different price levels.
  
 Limitation 2:  MACD values are not comparable across Assets 
Traditional MACD cannot compare momentum between different assets.
S&P 500 MACD of 65 versus EUR/USD MACD of -0.5 
reflects absolute price differences, not momentum differences
  
 Limitation 3: MACD values cannot be Systematically Classified 
Due to limitations #1 & #2, it is not possible to create 
a momentum level classification scale
where one can define "fast", "slow", "overbought", "oversold" momentum
making systematic analysis impossible
  
 Limitation 4: MACD Signal Line gives false crossovers in low-momentum ranges 
In range-bound, low momentum environments, 
most of the MACD signal line crossovers are false (noise)
Since there is no objective momentum classification system (limitation #3),
it is not possible to filter these signals out,
by avoiding them when momentum is low
  
 Limitation 5: MACD Signal Line gives late crossovers in high momentum regimes. 
Signal lag in strong trends not good at timing the turning point
— In high-momentum moves, MACD crossovers may come late.
Since there is no objective momentum classification system (limitation #3),
it is not possible to filter these signals out,
by avoiding them when momentum is high
  
===================================================================
 
===================================================================
🏆 5. MACD-v : THE SOLUTION TO THE LIMITATIONS OF THE MACD , RSI, etc 
==================================================================== 
MACD-v is a volatility normalised momentum indicator.
It remedies these 5 limitations of the classic MACD,
while creating a tool with unique properties.
 Formula:   × 100 
MACD-V enhances the classic MACD by normalizing for volatility, 
transforming price-dependent readings into standardized momentum values. 
This resolves key limitations of traditional MACD and adds significant analytical power.
 Core Advantages of MACD-V 
 Advantage 1: Time-Based Stability 
MACD-V values are consistent and comparable over time. 
A reading of 100 has the same meaning today as it did in the past
(unlike traditional MACD which is influenced by changes in price and volatility over time)
  
 Advantage 2: Cross-Market Comparability 
MACD-V provides universal scaling. 
Readings (e.g., ±50) apply consistently across all asset classes—stocks, 
bonds, commodities, or currencies,
allowing traders to compare momentum across markets reliably.
 Advantage 3: Objective Momentum Classification 
MACD-V includes a defined 5-range momentum lifecycle 
with standardized thresholds (e.g., -150 to +150). 
This offers an objective framework for analyzing market conditions 
and supports integration with broader models.
  
 Advantage 4: False Signal Reduction in Low-Momentum Regimes 
MACD-V introduces a "neutral zone" (typically -50 to +50) 
to filter out these low-probability signals.
 Advantage 5: Improved Signal Timing in High-Momentum Regimes 
MACD-V identifies extremely strong trends,
allowing for more precise entry and exit points.
 
 Advantage 6: Trend-Adaptive Scaling 
Unlike bounded oscillators like RSI or Stochastic, 
MACD-V dynamically expands with trend strength, 
providing clearer momentum insights without artificial limits.
 Advantage 7: Enhanced Divergence Detection 
MACD-V offers more reliable divergence signals 
by avoiding distortion at extreme levels, 
a common flaw in bounded indicators (RSI, etc)
  
====================================================================
 =======================================
⚒️ 5. HOW TO USE THE MACD-v: 7 CORE PATTERNS 
         HOW TO USE THE MACD-v Histogram: 2 CORE PATTERNS 
======================================= 
>>>>>>  BASIC USE  (RANGE RULES) <<<<<<
The MACD-v has 7 Core Patterns (Ranges) :
 1. Risk Range (Overbought) 
 Condition: MACD-V > Signal Line and MACD-V > +150
 Interpretation: Extremely strong bullish momentum—potential exhaustion or reversal zone.
 2. Retracing 
 Condition: MACD-V < Signal Line and MACD-V > -50
 Interpretation: Mild pullback within a bullish trend.
 3. Rundown 
 Condition: MACD-V < Signal Line and -50 > MACD-V > -150
 Interpretation: Momentum is weakening—bearish pressure building.
 4. Risk Range (Oversold) 
 Condition: MACD-V < Signal Line and MACD-V < -150
 Interpretation: Extreme bearish momentum—potential for reversal or capitulation.
 5. Rebounding 
 Condition: MACD-V > Signal Line and MACD-V > -150
 Interpretation: Bullish recovery from oversold or weak conditions.
 6. Rallying 
 Condition: MACD-V > Signal Line and MACD-V > +50
 Interpretation: Strengthening bullish trend—momentum accelerating.
 7. Ranging (Neutral Zone) 
 Condition: MACD-V remains between -50 and +50 for 20+ bars
 Interpretation: Sideways market—low conviction and momentum.
  
 The MACD-v Histogram has 2 Core Patterns (Ranges) : 
 1. Risk (Overbought) 
 Condition: Histogram > +40
 Interpretation: Short-term bullish momentum is stretched—possible overextension or reversal risk.
 2. Risk (Oversold) 
 Condition: Histogram < -40
 Interpretation: Short-term bearish momentum is stretched—potential for rebound or reversal.
  
=======================================
 
=======================================
📈 6. ADVANCED PATTERNS WITH MACD-v 
======================================= 
Thanks to its volatility normalization, 
the MACD-V framework enables the development 
of a wide range of advanced pattern recognition setups, 
trading signals, and strategic models. 
These patterns go beyond basic crossovers, 
offering deeper insight into momentum structure, 
regime shifts, and high-probability trade setups.
These are not part of this script
=======================================
 
===========================================================
⚙️ 7. FUNCTIONALITY - HOW TO ADD THE INDICATORS TO YOUR CHART
=========================================================== 
The script allows you to see :
 1.	MACD-v  
The indicator with the ranges (150,50,0,-50,-150)
and colour coded according to its 7 basic patterns
  
 2.	MACD-v Histogram 
The indicator The indicator with the ranges (40,0,-40)
and colour coded according to its 2 basic ranges / patterns
  
 3.	MACD-v Heatmap 
   You can see the MACD-v in a Multiple Timeframe basis,
   using a colour-coded Heatmap
   Note that lowest timeframe in the heatmap must be the one on the chart
   i.e. if you see the daily chart, then the Heatmap will be Daily, Weekly, Monthly 
     
 4. MACD-v Dashboard 
   You can see the MACD-v for 7 markets,
   in a multiple timeframe basis
  
=======================================
 
=======================================
🤝 CONTRIBUTIONS 🤝
======================================= 
I would like to thank the following people:
1.	Mike Christensen for coding the indicator
@TradersPostInc, @Mik3Christ3ns3n, 
2.	@Indicator-Jones For allowing me to use his Scanner
3.	@Daveatt For allowing me to use his heatmap
=======================================
 =======================================
⚠️ LEGAL - Usage and Attribution Notice ⚠️
======================================= 
Use of this Script is permitted 
for personal or non-commercial purposes, 
including implementation by coders and TradingView users. 
However, any form of paid redistribution, 
resale, or commercial exploitation is strictly prohibited.
Proper attribution to the original author is expected and appreciated, 
in order to acknowledge the source 
and maintain the integrity of the original work.
Failure to comply with these terms, 
or to take corrective action within 48 hours of notification, 
will result in a formal report to TradingView’s moderation team,
and  will actively pursue account suspension and removal of the infringing script(s). 
 Continued violations may result in further legal action, as deemed necessary. 
=======================================
 =======================================
⚠️ DISCLAIMER ⚠️
======================================= 
This indicator is For Educational Purposes Only (F.E.P.O.).
I am just Teaching by Example (T.B.E.)
It does not constitute investment advice.
There are no guarantees in trading - except one.
You will have losses in trading. 
I can guarantee you that with 100% certainty.
The author is not responsible for any financial losses
or trading decisions made based on this indicator. 🙏
Always perform your own analysis and use proper risk management. 🛡️
=======================================
TRI - Support/Resistance ZonesTRI - SUPPORT/RESISTANCE ZONES v1.0 
 DESCRIPTION: 
Professional support and resistance level indicator based on body pivot analysis.
Unlike traditional indicators that use wicks (high/low), this tool identifies key levels 
using candle bodies (open/close), providing more reliable and significant price zones.
 KEY FEATURES: 
 
 Body-based pivot detection for more meaningful levels
 Automatic level validation (excludes breached levels)
 Smart level filtering (avoids cluttered charts)
 Configurable number of support/resistance levels (1-5 each)
 Visual customization (colors, transparency, line extension)
 Real-time breakout alerts for resistance and support levels
 Clean and intuitive interface with price labels
 
 HOW IT WORKS: 
The indicator scans historical price action to identify pivot points based on candle bodies.
Only valid levels (not breached since formation) are displayed. Levels are automatically 
filtered by proximity to avoid visual clutter while maintaining the most relevant zones.
Breakout alerts trigger when price closes above resistance or below support.
 BEST USE: 
Ideal for swing trading, day trading, and identifying key decision points.
Works on all timeframes and asset classes.
Quantum Fluxtrend [CHE]  Quantum Fluxtrend   — A dynamic Supertrend variant with integrated breakout event tracking and VWAP-guided risk management for clearer trend decisions.
  Summary 
The Quantum Fluxtrend   builds on traditional Supertrend logic by incorporating a midline derived from smoothed high and low values, creating adaptive bands that respond to market range expansion or contraction. This results in fewer erratic signals during volatile periods and smoother tracking in steady trends, while an overlaid event system highlights breakout confirmations, potential traps, or continuations with visual lines, labels, and percentage deltas from the close. Users benefit from real-time VWAP calculations anchored to events, providing dynamic stop-loss suggestions to help manage exits without manual adjustments. Overall, it layers signal robustness with actionable annotations, reducing noise in fast-moving charts.
  Motivation: Why this design? 
Standard Supertrend indicators often generate excessive flips in choppy conditions or lag behind in low-volatility drifts, leading to whipsaws that erode confidence in trend direction. This design addresses that by centering bands around a midline that reflects recent price spreads, ensuring adjustments are proportional to observed variability. The added event layer captures regime shifts explicitly, turning abstract crossovers into labeled milestones with trailing VWAP for context, which helps traders distinguish genuine momentum from fleeting noise without over-relying on raw price action.
  What’s different vs. standard approaches? 
- Baseline reference: Diverges from the classic Supertrend, which uses average true range for fixed offsets from a median price.
- Architecture differences:
  - Bands form around a central line averaged from smoothed highs and lows, with offsets scaled by half the range between those smooths.
  - Regime direction persists until a clear breach of the prior opposite band, preventing premature reversals.
  - Event visualization draws persistent lines from flip points, updating labels based on price sustainment relative to the trigger level.
  - VWAP resets at each event, accumulating volume-weighted prices forward for a trailing reference.
- Practical effect: Charts show fewer direction changes overall, with color-coded annotations that evolve from initial breakout to continuation or trap status, making it easier to spot sustained moves early. VWAP lines provide a volume-informed anchor that curves with price, offering visual cues for adverse drifts.
  How it works (technical) 
The process starts by smoothing high and low prices over a user-defined period to form upper and lower references. A midline sits midway between them, and half the spread acts as a base for band offsets, adjusted by a multiplier to widen or narrow sensitivity. On each bar, the close is checked against the previous bar's opposite band: crossing above expands the lower band downward in uptrends, or below contracts the upper band upward in downtrends, creating a ratcheting effect that locks in direction until breached.
Persistent state tracks the current regime, seeding initial bands from the smoothed values if no prior data exists. Flips trigger new horizontal lines at the breach level, styled by direction, alongside labels that monitor sustainment—price holding above for up-flips or below for down-flips keeps the regime, while reversal flags a trap.
Separately, at each flip, a dashed VWAP line initializes at the breach price and extends forward, accumulating the product of typical prices and volumes divided by total volume. This yields a curving reference that updates bar-by-bar. Warnings activate if price strays adversely from this VWAP, tinting the background for quick alerts.
No higher timeframe data is pulled, so all computations run on the chart's native resolution, avoiding lookahead biases unless repainting is enabled via input.
  Parameter Guide 
SMA Length — Controls smoothing of highs and lows for midline and range base; longer values dampen noise but increase lag. Default: 20. Trade-offs: Shortens responsiveness in trends (e.g., 10–14) but risks more flips; extend to 30+ for stability in ranging markets.
Multiplier — Scales band offsets from the half-range; higher amplifies to capture bigger swings. Default: 1.0. Trade-offs: Above 1.5 widens for volatile assets, reducing false signals; below 0.8 tightens for precision but may miss subtle shifts.
Show Bands — Toggles visibility of basic and adjusted band lines for reference. Default: false. Tip: Enable briefly to verify alignment with price action.
Show Background Color — Displays red tint on VWAP adverse crosses for visual warnings. Default: false. Trade-offs: Helps in live monitoring but can clutter clean charts.
Line Width — Sets thickness for event and VWAP lines. Default: 2. Tip: Thicker (3–5) for emphasis on key levels.
+Bars after next event — Extends old lines briefly before cleanup on new flips. Default: 20. Trade-offs: Longer preserves history (40+) at resource cost; shorter keeps charts tidy.
Allow Repainting — Permits live-bar updates for smoother real-time view. Default: false. Tip: Disable for backtest accuracy.
Extension 1 Settings (Show, Width, Size, Decimals, Colors, Alpha) — Manages dotted connector from event label to current close, showing percentage change. Defaults: Shown, width 2, normal size, 2 decimals, lime/red for gains/losses, gray line, 90% transparent background. Trade-offs: Fewer decimals for clean display; adjust alpha for readability.
Extension 2 Settings (Show, Method, Stop %, Ticks, Decimals, Size, Color, Inherit, Alpha) — Positions stop label at VWAP end, offset by percent or ticks. Defaults: Shown, percent method, 1.0%, 20 ticks, 4 decimals, normal size, white text, inherit tint, 0% alpha. Trade-offs: Percent for proportional risk; ticks for fixed distance in tick-based assets.
Alert Toggles — Enables notifications for breakouts, continuations, traps, or VWAP warnings. All default: true. Tip: Layer with chart alerts for multi-condition setups.
  Reading & Interpretation 
The main Supertrend line colors green for up-regimes (price above lower band) and red for down (below upper band), serving as a dynamic support/resistance trail. Flip shapes (up/down triangles) mark regime changes at band breaches.
Event lines extend horizontally from flips: green for bull, red for bear. Labels start blank and update to "Bull/Bear Cont." if price sustains the direction, or "Trap" if it reverses, with colors shifting lime/red/gray accordingly. A dotted vertical links the trailing label to the current close, mid-labeled with the percentage delta (positive green, negative red).
VWAP dashes yellow (bull) or orange (bear) from the event, curving to reflect volume-weighted average. At its end, a left-aligned label shows suggested stop price, annotated with offset details. Background red hints at weakening if price crosses VWAP opposite the regime.
Deltas near zero suggest consolidation; widening extremes signal momentum buildup or exhaustion.
  Practical Workflows & Combinations 
- Trend following: Enter long on green flip shapes confirmed by higher highs, using the event line as initial stop below. Trail stops to VWAP for bull runs, exiting on trap labels or red background warnings. Filter with volume spikes to avoid low-conviction breaks.
- Exits/Stops: Conservative: Set hard stops at suggested SL labels. Aggressive: Hold through minor traps if delta stays positive, but cut on regime flip. Pair with momentum oscillators for overbought pullbacks.
- Multi-asset/Multi-TF: Defaults suit forex/stocks on 15m–4H; for crypto, bump multiplier to 1.5 for volatility. Scale SMA length proportionally across timeframes (e.g., double for daily). Combine with structure tools like Fibonacci for confluence on event lines.
  Behavior, Constraints & Performance 
Live bars update lines and labels dynamically if repainting is allowed, but signals confirm on close for stability—flips only trigger post-bar. No higher timeframe calls, so no inherent lookahead, though volume weighting assumes continuous data.
Resources cap at 1000 bars back, 50 lines/labels max; events prune old ones on new flips to stay under budget, with brief extensions for visibility. Arrays or loops absent, keeping it lightweight.
Known limits include lag in extreme gaps (e.g., overnight opens) where bands may not adjust instantly, and VWAP sensitivity to sparse volume in illiquid sessions.
  Sensible Defaults & Quick Tuning 
Start with SMA 20, multiplier 1.0 for balanced response across majors. For choppy pairs: Lengthen SMA to 30, multiplier 0.8 to tighten bands and cut flips. For trending equities: Shorten to 14, multiplier 1.2 for quicker entries. If traps dominate, enable bands to inspect range compression; for sluggish signals, reduce extension bars to focus on recent events.
  What this indicator is—and isn’t 
This serves as a visualization and signal layer for trend regimes and breakouts, highlighting sustainment via annotations and risk cues through VWAP—ideal atop price action for confirmation. It is not a standalone system, predictive oracle, or risk calculator; always integrate with broader analysis, position sizing, and stops. Use responsibly as an educational tool.
  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
Nqaba Goldminer StrategyThis indicator plots the New York session key timing levels used in institutional intraday models.
It automatically marks the 03:00 AM, 10:00 AM, and 2:00 PM (14:00) New York times each day:
Vertical lines show exactly when those time windows open — allowing traders to identify major global liquidity shifts between London, New York, and U.S. session overlaps.
Horizontal lines mark the opening price of the 5-minute candle that begins at each of those key times, providing precision reference levels for potential reversals, continuation setups, and intraday bias shifts.
Users can customize each line’s color, style (solid/dashed/dotted), width, and horizontal-line length.
A history toggle lets you display all past occurrences or just today’s key levels for a cleaner chart.
These reference levels form the foundation for strategies such as:
London Breakout to New York Reversal models
Opening Range / Session Open bias confirmation
Institutional volume transfer windows (London → NY → Asia)
The tool provides a simple visual structure for traders to frame intraday decision-making around recurring institutional time events.
Auto Fibonacci LevelsAuto Fibonacci Momentum Zones with Visible Range Table
 Overview and Originality 
The Auto Fibonacci Momentum Zones indicator offers a streamlined, static overlay of Fibonacci retracement levels inspired by extreme RSI momentum thresholds, enhanced with a dynamic table displaying the high and low of the currently visible chart range. This isn't a repackaged RSI oscillator or basic Fib drawer—common in TradingView's library—but a purposeful fusion of geometric harmony (Fibonacci ratios) with momentum psychology (RSI extremes at 35/85), projected as fixed horizontal reference lines on the price chart. The addition of the visible range table, powered by PineCoders' VisibleChart library, provides real-time context for the chart's current view, enabling traders to quickly assess range compression or expansion relative to these zones.  
This script's originality stems from its "static momentum mapping": by hardcoding Fib levels on a dynamic chart, it creates universal psychological support/resistance lines that transcend specific assets or timeframes. 
Unlike dynamic Fib tools that auto-adjust to price swings (risking noise in ranging markets) or standalone RSI plots (confined to panes), this delivers clean, bias-adjustable overlays for confluence analysis. The visible range table justifies the library integration—it's not a gratuitous add-on but a complementary tool that quantifies the "screen real estate" of price action, helping users correlate Fib touches with actual volatility. Drawn from original code (no auto-generation or public templates), it builds TradingView's body of knowledge by simplifying multi-tool workflows into one indicator, ideal for discretionary traders who value visual efficiency over algorithmic complexity.
 How It Works: Underlying Concepts 
Fibonacci retracements, derived from the Fibonacci sequence and the golden ratio (≈0.618), identify potential reversal points based on the idea that markets retrace prior moves in predictable proportions: shallow (23.6%, 38.2%), mid (50%), and deep (61.8%, 78.6%). 
Adjustable Outputs
1. The "Invert Fibs" toggle (default: true) for bearish/topping bias, can be flipped aligning with trend context.  
2. Fibonacci Levels: Seven semi-transparent horizontal lines are drawn using `hline()`:  
   - 0.0 at high (gray).  
   - 0.236: high - (range × 0.236) (light cyan, shallow pullback).  
   - 0.382: high - (range × 0.382) (teal, common retracement).  
   - 0.5: midpoint average (green, equilibrium).  
   - 0.618: high - (range × 0.618) (amber, golden pocket for reversals).  
   - 0.786: high - (range × 0.786) (orange, deep support).  
   - 1.0 at low (gray).  
Colors progress from cool (shallow) to warm (deep) for intuitive scanning.
3. Optional Fib Labels: Right-edge text labels (e.g., "0.618") appear only if enabled, positioned at the last bar + offset for non-cluttering visibility.  
4. Visible Range Table: Leveraging the VisibleChart library's `visible.high()` and `visible.low()` functions, a compact 2x2 table (top-right corner) updates on the last bar to show the extrema of bars currently in view. This mashup enhances utility: Fib zones provide fixed anchors, while the table's dynamic values reveal if price is "pinned" to a zone (e.g., visible high hugging 0.382 signals resistance). The library is invoked sparingly for performance, adding value by bridging static geometry with viewport-aware data—unavailable in built-ins without custom code.  
 How to Use It 
 1. Setup:  
 
 Add to any chart (e.g., 15M for scalps, Daily for swings). As an overlay, lines appear directly on price candles—adjust chart scaling if needed.  
 
 2. Input Tweaks:   
 
 Invert Fibs: Enable for downtrends (85 top), disable for uptrends (35 bottom).  
 Show Fibs: Toggle labels for ratio callouts (off for clean charts).  
 Show Table: Display/hide the visible high/low summary (red for high, green for low, formatted to 2 decimals).
 
 3. Trading Application:   
 
 Zone Confluence: Seek price reactions at each fibonacci level—e.g., a doji at 0.618 + rising volume suggests entry; use 0.0/1.0 as invalidation.
 Range Context: Check the table: If visible high/low spans <20% of the Fib arc (e.g., both near 0.5), anticipate breakout; wider spans signal consolidation.
 Multi-Timeframe: Overlay on higher TF for bias, lower for precision—e.g., Daily Fibs guide 1H entries.
 Enhancements: Pair with volume or candlesticks; set alerts on line crosses via TradingView's built-in tools. Backtest on your symbols to validate (e.g., equities favor 0.382, forex the 0.786).  
 
This indicator automates advanced Fibonacci synthesis dynamically, eliminating manual measurement and calculations.
published by ozzy_livin
Automated Z-scoring - [JTCAPITAL]Automated Z-Scoring -   is a modified way to use  statistical normalization through Z-Scores  for analyzing price deviations, volatility extremes, and mean reversion opportunities in financial markets.
The indicator works by calculating in the following steps:
 
   Source Selection 
The indicator begins by selecting a user-defined price source (default is the  Close  price). Traders can modify this to use any indicator that is deployed on the chart, for accurate and fast Z-scoring.
   Mean Calculation 
A  Simple Moving Average (SMA)  is calculated over the selected  length  period (default 3000). This represents the long-term equilibrium price level or the “statistical mean” of the dataset. It provides the baseline around which all price deviations are measured.
   Standard Deviation Measurement 
The script computes the  Standard Deviation  of the price series over the same period. This value quantifies how far current prices tend to stray from the mean — effectively measuring market volatility. The larger the standard deviation, the more volatile the market environment.
   Z-Score Normalization 
The  Z-Score  is calculated as:
 (Current Price − Mean) ÷ Standard Deviation .
This normalization expresses how many standard deviations the current price is away from its long-term average. A Z-Score above 0 means the price is above average, while a negative score indicates it is below average.
   Visual Representation 
The Z-Score is plotted dynamically, with color-coding for clarity:
Bullish readings (Z > 0) are showing positive deviation from the mean.
Bearish readings (Z < 0) are showing negative deviation from the mean.
 Make sure to select the correct source for what you exactly want to Z-score. 
 
 Buy and Sell Conditions: 
While the indicator itself is designed as a  statistical framework  rather than a direct buy/sell signal generator, traders can derive actionable strategies from its behavior:
 Trend Following:  When the Z-Score crosses above zero after a prolonged negative period, it suggests a return to or above the mean — a possible bullish reversal or trend continuation signal. 
 Mean Reversion:  When the Z-score is below for example -1.5 it indicates a good time for a DCA buying opportunity.
 Trend Following:  When the Z-Score crosses below zero after being positive, it may indicate a momentum slowdown or bearish shift. 
 Mean Reversion:  When the Z-score is above for example 1.5 it indicates a good time for a DCA sell opportunity
 Features and Parameters: 
 Length  – Defines the period for both SMA and Standard Deviation. A longer length smooths the Z-Score and captures broader market context, while a shorter length increases responsiveness.
 Source  – Allows the user to choose which price data is analyzed (Close, Open, High, Low, etc.).
 Fill Visualization  – Highlights the magnitude of deviation between the Z-Score and the zero baseline, enhancing readability of volatility extremes.
 Specifications: 
 Mean (Simple Moving Average) 
The SMA calculates the average of the selected source over the defined length. It provides a central value to which the price tends to revert. In this indicator, the mean acts as the equilibrium point — the “zero” reference for all deviations.
 Standard Deviation 
Standard Deviation measures the dispersion of data points from their mean. In trading, it quantifies volatility. A high standard deviation indicates that prices are spread out (volatile), while a low value means they are clustered near the average (stable). The indicator uses this to scale deviations consistently across different market conditions.
 Z-Score 
The Z-Score converts raw price data into a standardized value measured in units of standard deviation.
A Z-Score of 0 = Price equals its mean.
A Z-Score of +1 = Price is one standard deviation above the mean.
A Z-Score of −1 = Price is one standard deviation below the mean.
This allows comparison of deviation magnitudes across instruments or timeframes, independent of price level.
 Length Parameter 
A long lookback period (e.g., 3000 bars) smooths temporary volatility and reveals long-term mean deviations — ideal for macro trend identification. Shorter lengths (e.g., 100–500) capture quicker oscillations and are useful for short-term mean reversion trades.
 Statistical Interpretation 
From a probabilistic perspective, if the distribution of prices is roughly normal:
About 68% of price observations lie within ±1 standard deviation (Z between −1 and +1).
About 95% lie within ±2 standard deviations.
Therefore, when the Z-Score moves beyond ±2, it statistically represents a rare event — often corresponding to price extremes or potential reversal zones.
 Practical Benefit of Z-Scoring in Trading 
Z-Scoring transforms raw price into a normalized volatility-adjusted metric. This allows traders to:
Compare instruments on a common statistical scale.
Identify mean-reversion setups more objectively.
Spot volatility expansions or contractions early.
Detect when price action significantly diverges from long-term equilibrium.
By automating this process,  Automated Z-Scoring -   provides traders with a powerful analytical lens to measure how “stretched” the market truly is — turning abstract statistics into a visually intuitive and actionable form.
Enjoy!
HTF Control Shift + FVG Interaction + Shift Lines
### 📘 **HTF Control Shift + FVG Interaction + Shift Lines**
This indicator combines **Higher Timeframe Control Shift detection**, **Fair Value Gap (FVG) tracking**, and **Shift Line projection** into one complete structure-based trading toolkit.
#### 🔍 **Features**
* **Control Shift Detection:**
  Highlights bullish or bearish “Control Shift” candles based on wick/body ratios — showing where aggressive control transitions occur.
* **Fair Value Gap Mapping:**
  Automatically detects and draws bullish or bearish FVGs on any chosen timeframe, with optional dynamic extension and mitigation tracking.
* **Shift Line Projection:**
  Extends high and low lines from each Control Shift candle to visualize structure and potential continuation or rejection zones.
* **Interaction Alerts:**
  Triggers alerts when:
  * A Bullish Control Shift interacts with a Bullish FVG
  * A Bearish Control Shift interacts with a Bearish FVG
  * Price breaks the high/low following an interaction
* **Visual Highlights:**
  Colored FVG zones, labeled interactions, and diamond markers for easy visual confirmation of key reaction points.
#### ⚙️ **How to Use**
1. Choose a **higher timeframe (HTF)** in settings (e.g., 15m, 1h, 4h).
2. Watch for **Control Shift candles** (yellow/orange bars) forming at or interacting with **FVG zones**.
3. A **Bullish Interaction + Break of High** often signals continuation.
   A **Bearish Interaction + Break of Low** may confirm rejection or trend reversal.
4. Use alerts to track live market structure shifts without constant chart watching.
#### 🧠 **Purpose**
Ideal for traders combining **Smart Money Concepts (SMC)** and **candle structure logic**, this tool visualizes where institutional aggression shifts align with **liquidity gaps** — helping anticipate **high-probability continuations or reversals**.
ma+ko Arrowsma+ko ARROWS is a clean Supertrend-based indicator that generates precise BUY and SELL arrows without repainting after candle close.
SigmaRevert: Z-Score Adaptive Mean Reversion [KedArc Quant]🔍 Overview
SigmaRevert is a clean, research-driven mean-reversion framework built on Z-Score deviation — a statistical measure of how far the current price diverges from its dynamic mean.
When price stretches too far from equilibrium (the mean), SigmaRevert identifies the statistical “sigma distance” and seeks reversion trades back toward it. Designed primarily for 5-minute intraday use, SigmaRevert automatically adapts to volatility via ATR-based scaling, optional higher-timeframe trend filters, and cooldown logic for controlled frequency
🧠 What “Sigma” Means Here
In statistics, σ (sigma) represents standard deviation, the measure of dispersion or variability.
SigmaRevert uses this concept directly:
Each bar’s price deviation from the mean is expressed as a Z-Score — the number of sigmas away from the mean.
When Z > 1.5, the price is statistically “over-extended”; when it returns toward 0, it reverts to the mean.
In short:
Sigma = Standard deviation distance
SigmaRevert = Trading the reversion of extreme sigma deviations
💡 Why Traders Use SigmaRevert
Quant-based clarity: removes emotion by relying on statistical extremes.
Volatility-adaptive: automatically adjusts to changing market noise.
Low drawdown: filters avoid over-exposure during strong trends.
Multi-market ready: works across stocks, indices, and crypto with parameter tuning.
Modular design: every component can be toggled without breaking the core logic.
🧩 Why This Is NOT a Mash-Up
Unlike “mash-up” scripts that randomly combine indicators, this strategy is built around one cohesive hypothesis:
“Price deviations from a statistically stable mean (Z-Score) tend to revert.”
Every module — ATR scaling, cooldown, HTF trend gating, exits — reinforces that single hypothesis rather than mixing unrelated systems (like RSI + MACD + EMA).
The structure is minimal yet expandable, maintaining research integrity and transparency.
⚙️ Input Configuration (Simplified Table)
 
 Core
   `maLen`         120            Lookback for mean (SMA)                              
    `zLen`          60             Window for Z-score deviation                         
    `zEntry`        1.5            Entry when Z  exceeds threshold 
    `zExit`         0.3            Exit when Z normalizes                               
 Filters (optional) 	  
    `useReCross`    false          Requires re-entry confirmation                       
    `useTrend`      false / true   Enables HTF SMA bias                                 
    `htfTF`         “60”           HTF timeframe (e.g. 60-min)                          
    `useATRDist`    false          Demands min distance from mean                       
    `atrK`          1.0            ATR distance multiplier                              
    `useCooldown`   false / true   Forces rest after exit                               
 Risk
    `useATRSL`      false / true   Adaptive stop-loss via ATR                           
    `atrLen`        14             ATR lookback                                         
    `atrX`          1.4            ATR multiplier for stop                              
 Session
    `useSession`    false          Restrict to market hours                             
    `sess`          “0915-1530”    NSE timing                                           
    `skipOpenBars`  0–3            Avoid early volatility                               
 UI 
    `showBands`     true           Displays ±1σ & ±2σ                                   
    `showMarks`     true           Shows triggers and exits                             
🎯 Entry & Exit Logic
Long Entry
 Trigger: `Z < -zEntry`
 Optional re-cross: prior Z < −zEntry, current Z −zEntry
 Optional trend bias: current close above HTF SMA
 Optional ATR filter: distance from mean ATR × K
Short Entry
 Trigger: `Z +zEntry`
 Optional re-cross: prior Z +zEntry, current Z < +zEntry
 Optional trend bias: current close below HTF SMA
 Optional ATR filter: distance from mean ATR × K
Exit Conditions
 Primary exit: `Z < zExit` (price normalized)
 Time stop: `bars since entry timeStop`
 Optional ATR stop-loss: ±ATR × multiplier
 Optional cooldown: no new trade for X bars after exit
🕒 When to Use
 Intraday (5m)       
	`maLen=120`, `zEntry=1.5`, `zExit=0.3`, `useTrend=false`, `cooldownBars=6`  Capture intraday oscillations        Minutes → hours 
 Swing (30m–1H)      
	`maLen=200`, `zEntry=1.8`, `zExit=0.4`, `useTrend=true`, `htfTF="D"`        Mean-reversion between daily pivots  1–2 days        
 Positional (4H–1D) 
	`maLen=300`, `zEntry=2.0`, `zExit=0.5`, `useTrend=true`                     Capture multi-day mean reversions    Days → weeks    
📘 Glossary
 Z-Score         
	Statistical measure of how far current price deviates from its mean, normalized by standard deviation. 
 Mean Reversion  
	The tendency of price to return to its average after temporary divergence.         
                    
 ATR             
	Average True Range — measures volatility and defines adaptive stop distances.         
                 
 Re-Cross        
	Secondary signal confirming reversal after an extreme.                           
                      
 HTF             
	Higher Timeframe — provides macro trend bias (e.g. 1-hour or daily).         
                          
 Cooldown        
	Minimum bars to wait before re-entering after a trade closes.                                          
❓ FAQ
Q1: Why are there no trades sometimes?
➡ Check that all filters are off. If still no trades, Z-scores might not breach the thresholds. Lower `zEntry` (1.2–1.4) to increase frequency.
Q2: Why does it sometimes fade breakouts?
➡ Mean reversion assumes overextension — disable it during strong trending days or use the HTF filter.
Q3: Can I use this for Forex or Crypto?
➡ Yes — but adjust session filters (`useSession=false`) and increase `maLen` for smoother means.
Q4: Why is profit factor so high but small overall gain?
➡ Because this script focuses on capital efficiency — low drawdown and steady scaling. Increase position size once stable.
Q5: Can I automate this on broker integration?
➡ Yes — the strategy uses standard `strategy.entry` and `strategy.exit` calls, compatible with TradingView webhooks.
🧭 How It Helps Traders
This strategy gives:
 Discipline: no impulsive trades — strict statistical rules.
 Consistency: removes emotional bias; same logic applies every bar.
 Scalability: works across instruments and timeframes.
 Transparency: all signals are derived from visible Z-Score math.
It’s ideal for quant-inclined discretionary traders who want rule-based entries but maintain human judgment for context (earnings days, macro news, etc.).
🧱 Final Notes
 Best used on liquid stocks with continuous price movement.
 Avoid illiquid or gap-heavy tickers.
 Validate parameters per instrument — Z behavior differs between equities and indices.
 Remember: Mean reversion works best in range-bound volatility, not during explosive breakouts.
⚠️ 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.
FVG MagicFVG Magic — Fair Value Gaps with Smart Mitigation, Inversion & Auto-Clean-up
FVG Magic finds every tradable Fair Value Gap (FVG), shows who powered it, and then manages each gap intelligently as price interacts with it—so your chart stays actionable and clean.
Attribution
This tool is inspired by the idea popularized in “Volumatic Fair Value Gaps  ” by BigBeluga (licensed CC BY-NC-SA 4.0). Credit to BigBeluga for advancing FVG visualization in the community.
Important: This is a from-scratch implementation—no code was copied from the original. I expanded the concept substantially with a different detection stack, a gap state machine (ACTIVE → 50% SQ → MITIGATED → INVERSED), auto-clean up rules, lookback/nearest-per-side pruning, zoom-proof volume meters, and timeframe auto-tuning for 15m/H1/H4.
What makes this version more accurate
Full-coverage detection (no “missed” gaps)
Default ICT-minimal rule (Bullish: low > high , Bearish: high < low ) catches all valid 3-candle FVGs.
Optional Strict filter (stricter structure checks) for traders who prefer only “clean” gaps.
Optional size percentile filter—off by default so nothing is hidden unless you choose to filter.
Correct handling of confirmations (wick vs close)
Mitigation Source is user-selectable: high/low (wick-based) or close (strict).
This avoids false “misses” when you expect wick confirmations (50% or full fill) but your logic required closes.
State-aware labelling to prevent misleading data
The Bull%/Bear% meter is shown only while a gap is ACTIVE.
As soon as a gap is 50% SQ, MITIGATED, or INVERSED, the meter is hidden and replaced with a clear tag—so you never read stale participation stats.
Robust zoom behaviour
The meter uses a fixed bar-width (not pixels), so it stays proportional and readable at any zoom level.
Deterministic lifecycle (no stale boxes)
Remove on 50% SQ (instant or delayed).
Inversion window after first entry: if price enters but doesn’t invert within N bars, the box auto-removes once fully filled.
Inversion clean up: after a confirmed flip, keep for N bars (context) then delete (or 0 = immediate).
Result: charts auto-maintain themselves and never “lie” about relevance.
Clarity near current price
Nearest-per-side (keep N closest bullish & bearish gaps by distance to the midpoint) focuses attention where it matters without altering detection accuracy.
Lookback (bars) ensures reproducible behaviour across accounts with different data history.
Timeframe-aware defaults
Sensible auto-tuning for 15m / H1 / H4 (right-extension length, meter width, inversion windows, clean up bars) to reduce setup friction and improve consistency.
What it does (under the hood)
Detects FVGs using ICT-minimal (default) or a stricter rule.
Samples volume from a 10× lower timeframe to split participation into Bull % / Bear % (sum = 100%).
Manages each gap through a state machine:
ACTIVE → 50% SQ (midline) → MITIGATED (full) → INVERSED (SR flip after fill).
Auto-clean up keeps only relevant levels, per your rules.
Dashboard (top-right) displays counts by side and the active state tags.
How to use it
First run (show everything)
Use Strict FVG Filter: OFF
Enable Size Filter (percentile): OFF
Mitigation Source: high/low (wick-based) or close (stricter), as you prefer.
Remove on 50% SQ: ON, Delay: 0
Read the context
While ACTIVE, use the Bull%/Bear% meter to gauge demand/supply behind the impulse that created the gap.
Confluence with your HTF structure, sessions, VWAP, OB/FVG, RSI/MACD, etc.
Trade interactions
50% SQ: often the highest-quality interaction; if removal is ON, the box clears = “job done.”
Full mitigation then rejection through the other side → tag changes to INVERSED (acts like SR). Keep for N bars, then auto-remove.
Keep the chart tidy (optional)
If too busy, enable Size Filter or set Nearest per side to 2–4.
Use Lookback (bars) to make behaviour consistent across symbols and histories.
Inputs (key ones)
Use Strict FVG Filter: OFF(default)/ON
Enable Size Filter (percentile): OFF(default)/ON + threshold
Mitigation Source: high/low or close
Remove on 50% SQ + Delay
Inversion window after entry (bars)
Remove inversed after (bars)
Lookback (bars), Nearest per side (N)
Right Extension Bars, Max FVGs, Meter width (bars)
Colours: Bullish, Bearish, Inversed fill
Suggested defaults (per TF)
15m: Extension 50, Max 12, Inversion window 8, Clean up 8, Meter width 20
H1: Extension 25, Max 10, Inversion window 6, Clean up 6, Meter width 15
H4: Extension 15, Max 8, Inversion window 5, Clean up 5, Meter width 10
Notes & edge cases
If a wick hits 50% or the far edge but state doesn’t change, you’re likely on close mode—switch to high/low for wick-based behaviour.
If a gap disappears, it likely met a clean up condition (50% removal, inversion window, inversion clean up, nearest-per-side, lookback, or max-cap).
Meters are hidden after ACTIVE to avoid stale percentages.
Bitcoin CME gaps multi-timeframe auto finder1. Overview 
The Bitcoin CME Gap Multi-Timeframe Detector automatically identifies price gaps in the Bitcoin CME (Chicago Mercantile Exchange) futures market and visually displays them on the TradingView chart.
Because the CME futures market closes for about an hour after each weekday session and remains closed over the weekend, price gaps frequently appear when trading resumes on Monday.
This indicator analyzes gaps across six major timeframes, from 5-minute to 1-day charts, allowing traders to easily identify structural imbalances and potential support/resistance zones.
It is the most accurate and feature-rich CME gaps indicator available on TradingView.
 2. Key Features 
■ Multi-Timeframe Gap Detection
 
 Analyzes 5m, 15m, 30m, 1h, 4h, and 1D charts simultaneously.
 This enables traders to observe both short-term volatility and mid-to-long-term structure, providing a multi-dimensional view of market dynamics.
 
■ Gap Direction Classification
 
 Up Gap: When the next candle’s open is higher than the previous candle’s high (default color: green tone)
 Down Gap: When the next candle’s open is lower than the previous candle’s low (default color: red tone)
 Gaps are color-coded to intuitively visualize potential support and resistance zones.
 
■ Highlight Function
 
 Gaps exceeding a user-defined threshold (%) are highlighted (default color: yellow).
 This helps quickly identify zones with abnormal volatility or sharp price dislocations.
 
■ Labels and Box Extension
 
 Each gap displays a percentage label indicating its relative size and significance.
 Gap zones are extended to the right as boxes, allowing traders to visually track when and how the gap gets filled over time.
 
■ Alert System
 
 When a gap forms on the selected timeframe (or across all timeframes), a TradingView alert is triggered.
 This enables real-time response to significant gap events.
 
 3. Trading Strategies 
■ Gap Fill Behavior
CME gaps statistically tend to get filled over time.
Gap boxes help distinguish between filled and unfilled gaps at a glance.
 
 Up Gap: Price tends to decline to fill the previous high–next open zone.
 Down Gap: Price often rises later to fill the previous low–next open zone.
 
■ Support & Resistance Levels
Gap zones frequently act as strong support or resistance.
When price retests a gap area, observing the reaction of buyers and sellers can provide valuable trading insights.
Overlapping gap boxes across multiple timeframes indicate high-confidence support/resistance zones.
■ Market Sentiment & Volatility Analysis
Large gaps usually result from shifts in market sentiment or major news events.
This indicator allows traders to detect volatility spikes early and prepare for potential trend reversals.
■ Combination with Other Technical Tools
While fully functional on its own, this indicator works even better when combined with tools like moving averages (MA), RSI, MACD, or Fibonacci retracements.
For example, if the bottom of a gap coincides with the 0.618 Fibonacci level, it may signal a strong rebound zone.
 4. Settings Options 
Minimum Gap % | Sets the minimum percentage movement required to detect a gap (lower values show smaller gaps)
Display Timeframes | Choose which timeframes to display (5m, 15m, 30m, 1h, 4h, 1D)
Box Colors	 | Assign colors for up and down gaps
Box Extension (Bars)	| Number of bars to extend gap boxes to the right
Show Labels | Toggle display of gap percentage labels
Label Position / Size | Adjust label position and size
Highlight Gap ≥ % | Highlight gaps exceeding a specified percentage
Highlight Colors | Set highlight color for labels and boxes
Enable Alerts | Enable or disable alerts
Alert Timeframe | Select timeframe(s) for alerts (“All” = all timeframes)
 5. Summary 
This indicator is a professional trading tool that provides quantitative and visual analysis of price gaps in the Bitcoin CME futures market.
By combining multi-timeframe detection, highlighting, and alert systems, it helps traders clearly identify zones of market imbalance and potential reversal areas.
Trend change[YI_YA_HA_]這是一個趨勢變化和盤整突破偵測指標。
This is a trend change and consolidation breakout detection indicator.
它能自動識別價格進入狹窄盤整區間。
It automatically identifies when price enters a tight consolidation range.
當價格突破箱型上緣,就判定為上升趨勢開始。
When price closes above the box top, it signals the start of an uptrend.
當價格突破箱型下緣,則觸發下跌趨勢警報。
When price closes below the box bottom, it triggers a downtrend alert.
程式會畫出黃色盤整箱體,突破後自動消失。
The script draws a yellow consolidation box that auto-deletes after breakout.
突破向上時,會從低點畫一條綠色趨勢線持續延伸。
On upward breakout, a green trendline is drawn from the low and extends right.
右側標籤即時顯示目前趨勢狀態與價格。
A label on the right shows the current trend status and price in real-time.
AG_STRATEGY📈 AG_STRATEGY — Smart Money System + Sessions + PDH/PDL
AG_STRATEGY is an advanced Smart Money Concepts (SMC) toolkit built for traders who follow market structure, liquidity and institutional timing.
It combines real-time market structure, session ranges, liquidity levels, and daily institutional levels — all in one clean, professional interface.
✅ Key Features
🧠 Smart Money Concepts Engine
Automatic detection of:
BOS (Break of Structure)
CHoCH (Change of Character)
Dual structure system: Swing & Internal
Historical / Present display modes
Optional structural candle coloring
🎯 Liquidity & Market Structure
Equal Highs (EQH) and Equal Lows (EQL)
Marks strong/weak highs & lows
Real-time swing confirmation
Clear visual labels + smart positioning
⚡ Fair Value Gaps (FVG)
Automatic bullish & bearish FVGs
Higher-timeframe compatible
Extendable boxes
Auto-filtering to remove noise
🕓 Institutional Sessions
Asia
London
New York
Includes:
High/Low of each session
Automatic range plotting
Session background shading
London & NY Open markers
📌 PDH/PDL + Higher-Timeframe Levels
PDH / PDL (Previous Day High/Low)
Dynamic confirmation ✓ when liquidity is swept
Multi-timeframe level support:
Daily
Weekly
Monthly
Line style options: solid / dashed / dotted
🔔 Built-in Alerts
Internal & swing BOS / CHoCH
Equal Highs / Equal Lows
Bullish / Bearish FVG detected
🎛 Fully Adjustable Interface
Colored or Monochrome visual mode
Custom label sizes
Extend levels automatically
Session timezone settings
Clean, modular toggles for each component
🎯 Designed For Traders Who
Follow institutional order flow
Enter on BOS/CHoCH + FVG + Liquidity sweeps
Trade London & New York sessions
Want structure and liquidity clearly mapped
Prefer clean charts with full control
💡 Why AG_STRATEGY Stands Out
✔ Professional SMC engine
✔ Real-time swing & internal structure
✔ Session-based liquidity tracking
✔ Non-cluttered chart — high clarity
✔ Supports institutional trading workflows
Structure Labels ( HH / HL / LH / LL )Here’s a clean and efficient Pine Script (v5) code that automatically detects and labels Higher Highs ( HH ), Lower Highs ( LH ), Higher Lows ( HL ), and Lower Lows ( LL ) on your  TradingView chart .
Trend scalping ROVTradingOnly trading with bullish or bearish trend. Working fine at m5 and m15 time frame
Tri-Align Crypto Trend (EMA + Slope)**Tri-Align Crypto Trend (EMA + Slope)**
Quickly see whether your coin is trending *with* Bitcoin. The indicator evaluates three pairs—**COIN/USDT**, **BTC/USDT**, and **COIN/BTC**—using a fast/slow EMA crossover plus the fast EMA’s slope. Each pair is tagged **Bullish / Bearish / Neutral** in a compact, color-coded table. Alerts fire when **all three** trends align (all bullish or all bearish).
**How to use**
1. Add the indicator to any crypto chart.
2. Set the three symbols (defaults: BNB/USDT, BTC/USDT, BNB/BTC) and optionally choose a signal timeframe.
3. Tune **Fast EMA**, **Slow EMA**, **Slope Lookback**, and **Min |Slope| %** to filter noise and require stronger momentum.
4. Create alerts: *Add alert →* choose the indicator and select **All Three Bullish**, **All Three Bearish**, or **All Three Aligned**.
**Logic**
* Bullish: `EMA_fast > EMA_slow` **and** fast EMA slope ≥ threshold
* Bearish: `EMA_fast < EMA_slow` **and** fast EMA slope ≤ −threshold
* Otherwise: Neutral
Tip: The **COIN/BTC** row reflects relative strength vs BTC—use it to avoid chasing coins that lag the benchmark. (For educational purposes; not financial advice.)
Checklist Core Functionality
Manual Trade Setup Checklist: Provides 5 key trading criteria that traders can manually check off when conditions are met
Visual Confirmation System: Displays a clean table with checkmarks (✅) for completed criteria
Real-time Progress Tracking: Shows which trading setup conditions have been satisfied
Checklist Items
Retrace < 78.6% - Fibonacci retracement level check
ATR Entry - Average True Range based entry condition
CHoCH+ - Change of Character (market structure shift)
5m EG - 5-minute entry guide/pattern
PullBack < 78.6% - Pullback depth limitation
Key Features
Customizable Display: Full control over colors, text sizes, and table positioning
Flexible Placement: Table can be positioned in 6 different locations on the chart
Reset Function: Quick reset button to clear all checkmarks and start fresh
Visual Scoring: Color-coded system (bullish/bearish/neutral) to indicate checklist progress
Entry Guidance: Shows either "🎯" for confirmed entry or "61.8%" for retracement level
Purpose
This indicator helps traders maintain discipline by ensuring all criteria are met before entering trades, reducing emotional decisions and enforcing a systematic approach to trading setups. It's particularly useful for price action traders who follow specific entry protocols and want to document their decision-making process directly on the chart.






















