AutoPivot Levels with Alerts [ChartWhizzperer] – Dynamic EditionAuto-Pivot Levels 4 methods with alerts   – Dynamic Edition 
Now with
- Live Mode
- 4 Pivot Methods
- 7 Session Types (5m, 15m, 30m, Hourly, Daily, Weekly, Monthly)
- PineConnector-Ready Alerts!
Free, Open Source, Pine Script v6-compliant.
NEW: Live Mode (Ultra-Dynamic, Repainting) – Switchable in UI!
Instantly switch between Classic (session-based, repaint-free) and Live (rolling window, real-time, repainting) using the simple checkbox in the settings!
Live Mode recalculates all pivots on every tick/bar, using the current high/low/close for the chosen session (5m, 15m, 30m, hourly, daily, weekly, monthly).
 Perfect for: 
- Scalping and high-frequency trading
- Real-time bot/automation setups (PineConnector-ready)
- Fast-moving or breakout markets
Classic Mode: For traditional, stable levels based on confirmed session data – ideal for backtesting and trading history.
 Four Calculation Methods (Choose What Fits YOU) 
1.  Classic 
   Standard pivot calculation.
   Based on previous session’s High, Low, Close.
   Simple, proven, and suitable for any asset.
2.  Fibonacci 
   Projects levels using Fibonacci ratios of the prior session’s range.
   Great for traders who want to align pivots with fib retracements and extensions.
3.  Camarilla 
   Uses unique multipliers for support/resistance, focusing on mean reversion and volatility.
   Popular among futures and forex day traders.
4.  Woodie 
   Puts extra weight on previous Close for more responsive pivots.
   Often used in trending or choppy conditions.
Switch methods anytime  in the UI  – the script recalculates instantly and keeps your chart clean!
 Level-Specific Alerts – PineConnector Ready! 
Dedicated alert for EVERY level and direction (Up/Down):
 Pivot (P), R1, R2, R3, S1, S2, S3 
 No configuration hassle: 
All alerts are pre-defined in the TradingView Alert Panel and work across all session types (5m → monthly).
 Machine-readable message format: 
PIVOT=R1 DIR=UP SYMBOL={{ticker}} PRICE={{close}}
Direct plug-and-play with PineConnector, webhooks, Discord, Telegram, bots, and other automation tools.
 Never miss a breakout, reversal, or key support/resistance touch! 
 Powerful Customization & Performance 
- Session selection: 5m, 15m, 30m, Hourly, Daily, Weekly, Monthly (choose what suits your trading style).
- Show/hide any level (Pivot, R1–R3, S1–S3) for minimal chart clutter.
- Color selection for each level to match your theme or highlight key pivots.
- Auto-cleanup: Old lines and labels are cleared on every recalculation or session change for maximum performance and visual clarity.
- Zero runtime errors: Strict Pine Script v6 practices for stability.
 How To Use – Quick Start 
1) Add the indicator to your TradingView chart.
2) Pick your calculation method (Classic, Fibonacci, Camarilla, Woodie).
3) Set session type (5m, 15m, 30m, Hourly, Daily, Weekly, Monthly).
4) Switch between Classic and Live Mode with a single click in settings.
5) Customize your levels (on/off, colors).
6) Open the Alert Panel, select any pre-configured alert (e.g. "R2 Cross Down"), and go live!
7) Connect with PineConnector or any webhook system instantly using the pre-formatted alert messages.
 Who Is It For? 
- Active scalpers & bot traders: Live Mode + PineConnector-ready alerts = instant, automated reactions.
- Swing and position traders: Use Classic Mode for stable, repaint-free levels.
- Strategy developers: Seamless integration into automated and manual trading workflows.
 License & Community 
Open Source, Non-Commercial:
Free for personal & educational use under CC BY-NC-SA 4.0.
 Feedback, bug reports & ideas: 
Drop a comment, or contact me for feature requests.
Trade smart. Trade dynamic. Unlock the true power of pivots – with ChartWhizzperer!
Supportandresitance
Previous D/W/M HLOCHey traders,
Here's a simple Multi-Timeframe indicator that essentially turns time and price into a box. It'll take the previous high, low, opening price, or closing price from one of the three timeframes of your choice (day, week, or month). For whatever reason I can't get the opening price to function consistently so if you find improvements feel free to let me know, this will help traders who prefer to use opening price over closing price.
Naturally this form of charting is classical and nature and some key figures you could use to study its usage are
- Richard W. Schabacker (1930s)
- Edwards & Magee (1948)
- Peter Brandt
- Stacey Burke (more on the intraday side - typically our preference)
It's usage put plainly:
- Quantifying Accumulation or Distribution
- Revealing Energy Build-Up (Compression)
- Framing Breakouts and False Breakouts
- Structuring Time
- Identifying opportunities to trade a daily, weekly, or monthly range. 
Luxy BIG beautiful Dynamic ORBThis is an advanced Opening Range Breakout (ORB) indicator that tracks price breakouts from the first 5, 15, 30, and 60 minutes of the trading session. It provides complete trade management including entry signals, stop-loss placement, take-profit targets, and position sizing calculations.
The ORB strategy is based on the concept that the opening range of a trading session often acts as support/resistance, and breakouts from this range tend to lead to significant moves.
  
 What Makes This Different? 
Most ORB indicators simply draw horizontal lines and leave you to figure out the rest. This indicator goes several steps further:
 Multi-Stage Tracking 
Instead of just one ORB timeframe, this tracks FOUR simultaneously (5min, 15min, 30min, 60min). Each stage builds on the previous one, giving you multiple trading opportunities throughout the session.
 Active Trade Management 
When a breakout occurs, the indicator automatically calculates and displays entry price, stop-loss, and multiple take-profit targets. These lines extend forward and update in real-time until the trade completes.
 Cycle Detection 
Unlike indicators that only show the first breakout, this tracks the complete cycle: Breakout → Retest → Re-breakout. You can see when price returns to test the ORB level after breaking out (potential re-entry).
 Failed Breakout Warning 
If price breaks out but quickly returns inside the range (within a few bars), the label changes to "FAILED BREAK" - warning you to exit or avoid the trade.
 Position Sizing Calculator 
Built-in risk management that tells you exactly how many shares to buy based on your account size and risk tolerance. No more guessing or manual calculations.
 Advanced Filtering 
Optional filters for volume confirmation, trend alignment, and Fair Value Gaps (FVG) to reduce false signals and improve win rate.
  
 Core Features Explained
 
### 1. Multi-Stage ORB Levels
The indicator builds four separate Opening Range levels:
 
 ORB 5  - First 5 minutes (fastest signals, most volatile)
 ORB 15  - First 15 minutes (balanced, most popular)
 ORB 30  - First 30 minutes (slower, more reliable)
 ORB 60  - First 60 minutes (slowest, most confirmed)
 
Each level is drawn as a horizontal range on your chart. As time progresses, the ranges expand to include more price action. You can enable or disable any stage and assign custom colors to each.
 How it works:  During the opening minutes, the indicator tracks the highest high and lowest low. Once the time period completes, those levels become your ORB high and low for that stage.
### 2. Breakout Detection
When price closes outside the ORB range, a label appears:
 
 BREAK UP  (green label above price) - Price closed above ORB High
 BREAK DOWN  (red label below price) - Price closed below ORB Low
 
The label shows which ORB stage triggered (ORB5, ORB15, etc.) and the cycle number if tracking multiple breakouts.
 Important:  Signals appear on bar close only - no repainting. What you see is what you get.
### 3. Retest Detection
After price breaks out and moves away, if it returns to test the ORB level, a "RETEST" label appears (orange). This indicates:
 
 The original breakout level is now acting as support/resistance
 Potential re-entry opportunity if you missed the first breakout
 Confirmation that the level is significant
 
The indicator requires price to move a minimum distance away before considering it a valid retest (configurable in settings).
### 4. Failed Breakout Detection
If price breaks out but returns inside the ORB range within a few bars (before the breakout is "committed"), the original label changes to "FAILED BREAK" in orange.
This warns you:
 
 The breakout lacked conviction
 Consider exiting if already in the trade
 Wait for better setup
 
 Committed Breakout:  The indicator tracks how many bars price stays outside the range. Only after staying outside for the minimum number of bars does it become a committed breakout that can be retested.
  
### 5. TP/SL Lines (Trade Management)
When a breakout occurs, colored horizontal lines appear showing:
 
 Entry Line  (cyan for long, orange for short) - Your entry price (the ORB level)
 Stop Loss Line  (red) - Where to exit if trade goes against you
 TP1, TP2, TP3 Lines  (same color as entry) - Profit targets at 1R, 2R, 3R
 
These lines extend forward as new bars form, making it easy to track your trade. When a target is hit, the line turns green and the label shows a checkmark.
 Lines freeze (stop updating) when: 
 
 Stop loss is hit
 The final enabled take-profit is hit
 End of trading session (optional setting)
 
### 6. Position Sizing Dashboard
The dashboard (bottom-left corner by default) shows real-time information:
 
 Current ORB stage and range size
 Breakout status (Inside Range / Break Up / Break Down)
 Volume confirmation (if filter enabled)
 Trend alignment (if filter enabled)
 Entry and Stop Loss prices
 All enabled Take Profit levels with percentages
 Risk/Reward ratio
 Position sizing: Max shares to buy and total risk amount
 
 Position Sizing Example: 
If your account is $25,000 and you risk 1% per trade ($250), and the distance from entry to stop loss is $0.50, the calculator shows you can buy 500 shares (250 / 0.50 = 500).
  
### 7. FVG Filter (Fair Value Gap)
Fair Value Gaps are price inefficiencies - gaps left by strong momentum where one candle's high doesn't overlap with a previous candle's low (or vice versa).
When enabled, this filter:
 
 Detects bullish and bearish FVGs
 Draws semi-transparent boxes around these gaps
 Only allows breakout signals if there's an FVG near the breakout level
 
 Why this helps:  FVGs indicate institutional activity. Breakouts through FVGs tend to be stronger and more reliable.
 Proximity setting:  Controls how close the FVG must be to the ORB level. 2.0x means the breakout can be within 2 times the FVG size - a reasonable default.
### 8. Volume & Trend Filters
 Volume Filter: 
Requires current volume to be above average (customizable multiplier). High volume breakouts are more likely to sustain.
 
 Set minimum multiplier (e.g., 1.5x = 50% above average)
 Set "strong volume" multiplier (e.g., 2.5x) that bypasses other filters
 Dashboard shows current volume ratio
 
 Trend Filter: 
Only shows breakouts aligned with a higher timeframe trend. Choose from:
 
 VWAP - Price above/below volume-weighted average
 EMA - Price above/below exponential moving average
 SuperTrend - ATR-based trend indicator
 Combined modes (VWAP+EMA, VWAP+SuperTrend) for stricter filtering
 
### 9. Pullback Filter (Advanced)
 Purpose: 
Waits for price to pull back slightly after initial breakout before confirming the signal. 
This reduces false breakouts from immediate reversals.
 How it works: 
- After breakout is detected, indicator waits for a small pullback (default 2%)
- Once pullback occurs AND price breaks out again, signal is confirmed
- If no pullback within timeout period (5 bars), signal is issued anyway
 Settings: 
 
 Enable Pullback Filter:  Turn this filter on/off
 Pullback %:  How much price must pull back (2% is balanced)
 Timeout (bars):  Max bars to wait for pullback (5 is standard)
 
 When to use: 
- Choppy markets with many fake breakouts
- When you want higher quality signals
- Combine with Volume filter for maximum confirmation
 Trade-off: 
- Better signal quality
- May miss some valid fast moves
- Slight entry delay
  
 How to Use This Indicator 
### For Beginners - Simple Setup
 
 Add the indicator to your chart (5-minute or 15-minute timeframe recommended)
 Leave all default settings - they work well for most stocks
 Watch for BREAK UP or BREAK DOWN labels to appear
 Check the dashboard for entry, stop loss, and targets
 Use the position sizing to determine how many shares to buy
 
 Basic Trading Plan: 
 
 Wait for a clear breakout label
 Enter at the ORB level (or next candle open if you're late)
 Place stop loss where the red line indicates
 Take profit at TP1 (50% of position) and TP2 (remaining 50%)
 
### For Advanced Traders - Customized Setup
 
 Choose which ORB stages to track (you might only want ORB15 and ORB30)
 Enable filters: Volume (stocks) or Trend (trending markets)
 Enable FVG filter for institutional confirmation
 Set "Track Cycles" mode to catch retests and re-breakouts
 Customize stop loss method (ATR for volatile stocks, ORB% for stable ones)
 Adjust risk per trade and account size for accurate position sizing
 
 Advanced Strategy Example: 
 
 Enable ORB15 only (disable others for cleaner chart)
 Turn on Volume filter at 1.5x with Strong at 2.5x
 Enable Trend filter using VWAP
 Set Signal Mode to "Track Cycles" with Max 3 cycles
 Wait for aligned breakouts (Volume + Trend + Direction)
 Enter on retest if you missed the initial break
 
### Timeframe Recommendations
 
 5-minute chart:  Scalping, very active trading, crypto
 15-minute chart:  Day trading, balanced approach (most popular)
 30-minute chart:  Swing entries, less screen time
 60-minute chart:  Position trading, longer holds
 
The indicator works on any intraday timeframe, but ORB is fundamentally a day trading strategy. Daily charts don't make sense for ORB.
 
 DEFAULT CONFIGURATION  
ON by Default:
• All 4 ORB stages (5/15/30/60)
• Breakout Detection
• Retest Labels
• All TP levels (1/1.5/2/3)
• TP/SL Lines (Detailed mode)
• Dashboard (Bottom Left, Dark theme)
• Position Size Calculator
OFF by Default (Optional Filters):
• FVG Filter
• Pullback Filter
• Volume Filter
• Trend Filter
• HTF Bias Check
• Alerts
Recommended for Beginners:
• Leave all defaults
• Session Mode: Auto-Detect
• Signal Mode: Track Cycles
• Stop Method: ATR
• Add Volume Filter if trading stocks
 Recommended for Advanced: 
• Enable ORB15 + ORB30 only (disable 5 & 60)
• Enable: Volume + Trend + FVG 
• Signal Mode: Track Cycles, Max 3 
• Stop Method: ATR or Safer 
• Enable HTF Daily bias check 
 
## Settings Guide
The settings are organized into logical groups. Here's what each section controls:
### ORB COLORS Section
 
 Show Edge Labels:  Display "ORB 5", "ORB 15" labels at the right edge of the levels
 Background:  Fill the area between ORB high/low with color
 Transparency:  How see-through the background is (95% is nearly invisible)
 Enable ORB 5/15/30/60:  Turn each stage on or off individually
 Colors:  Assign colors to each ORB stage for easy identification
 
### SESSION SETTINGS Section
 
 Session Mode:  Choose trading session (Auto-Detect works for most instruments)
 Custom Session Hours:  Define your own hours if needed (format: HHMM-HHMM)
 
Auto-Detect uses the instrument's natural hours (stocks use exchange hours, crypto uses 24/7).
### BREAKOUT DETECTION Section
 
 Enable Breakout Detection:  Master switch for signals
 Show Retest Labels:  Display retest signals
 Label Size:  Visual size for all labels (Small recommended)
 Enable FVG Filter:  Require Fair Value Gap confirmation
 Show FVG Boxes:  Display the gap boxes on chart
 Signal Mode:  "First Only" = one signal per direction per day, "Track Cycles" = multiple signals
 Max Cycles:  How many breakout-retest cycles to track (6 is balanced)
 Breakout Buffer:  Extra distance required beyond ORB level (0.1-0.2% recommended)
 Min Distance for Retest:  How far price must move away before retest is valid (2% recommended)
 Min Bars Outside ORB:  Bars price must stay outside for committed breakout (2 is balanced)
 
### TARGETS & RISK Section
 
 Enable Targets & Stop-Loss:  Calculate and show trade management
 TP1/TP2/TP3 checkboxes:  Select which profit targets to display
 Stop Method:  How to calculate stop loss placement
  - ATR: Based on volatility (best for most cases)
  - ORB %: Fixed % of ORB range
  - Swing: Recent swing high/low
  - Safer: Widest of all methods
 ATR Length & Multiplier:  Controls ATR stop distance (14 period, 1.5x is standard)
 ORB Stop %:  Percentage beyond ORB for stop (20% is balanced)
 Swing Bars:  Lookback period for swing high/low (3 is recent)
 
### TP/SL LINES Section
 
 Show TP/SL Lines:  Display horizontal lines on chart
 Label Format:  "Short" = minimal text, "Detailed" = shows prices
 Freeze Lines at EOD:  Stop extending lines at session close
 
### DASHBOARD Section
 
 Show Info Panel:  Display the metrics dashboard
 Theme:  Dark or Light colors
 Position:  Where to place dashboard on chart
 Toggle rows:  Show/hide specific information rows
 Calculate Position Size:  Enable the position sizing calculator
 Risk Mode:  Risk fixed $ amount or % of account
 Account Size:  Your total trading capital
 Risk %:  Percentage to risk per trade (0.5-1% recommended)
 
### VOLUME FILTER Section
 
 Enable Volume Filter:  Require volume confirmation
 MA Length:  Average period (20 is standard)
 Min Volume:  Required multiplier (1.5x = 50% above average)
 Strong Volume:  Multiplier that bypasses other filters (2.5x)
 
### TREND FILTER Section
 
 Enable Trend Filter:  Require trend alignment
 Trend Mode:  Method to determine trend (VWAP is simple and effective)
 Custom EMA Length:  If using EMA mode (50 for swing, 20 for day trading)
 SuperTrend settings:  Period and Multiplier if using SuperTrend mode
 
### HIGHER TIMEFRAME Section
 
 Check Daily Trend:  Display higher timeframe bias in dashboard
 Timeframe:  What TF to check (D = daily, recommended)
 Method:  Price vs MA (stable) or Candle Direction (reactive)
 MA Period:  EMA length for Price vs MA method (20 is balanced)
 Min Strength %:  Minimum strength threshold for HTF bias to be considered
  - For "Price vs MA": Minimum distance (%) from moving average
  - For "Candle Direction": Minimum candle body size (%)
  - 0.5% is balanced - increase for stricter filtering
  - Lower values = more signals, higher values = only strong trends
 
### ALERTS Section
 
 Enable Alerts:  Master switch (must be ON to use any alerts)
 Breakout Alerts:  Notify on ORB breakouts
 Retest Alerts:  Notify when price retests after breakout
 Failed Break Alerts:  Notify on failed breakouts
 Stage Complete Alerts:  Notify when each ORB stage finishes forming
 
After enabling desired alert types, click "Create Alert" button, select this indicator, choose "Any alert() function call".
## Tips & Best Practices
### General Trading Tips
 
 ORB works best on liquid instruments (stocks with good volume, major crypto pairs)
 First hour of the session is most important - that's when ORB is forming
 Breakouts WITH the trend have higher success rates - use the trend filter
 Failed breakouts are common - use the "Min Bars Outside" setting to filter weak moves
 Not every day produces good ORB setups - be patient and selective
 
### Position Sizing Best Practices
 
 Never risk more than 1-2% of your account on a single trade
 Use the built-in calculator - don't guess your position size
 Update your account size monthly as it grows
 Smaller accounts: use $ Amount mode for simplicity
 Larger accounts: use % of Account mode for scaling
 
### Take Profit Strategy
 
 Most traders use: 50% at TP1, 50% at TP2
 Aggressive: Hold through TP1 for TP2 or TP3
 Conservative: Full exit at TP1 (1:1 risk/reward)
 After TP1 hits, consider moving stop to breakeven
 TP3 rarely hits - only on strong trending days
 
### Filter Combinations
 
 Maximum Quality:  Volume + Trend + FVG (fewest signals, highest quality)
 Balanced:  Volume + Trend (good quality, reasonable frequency)
 Active Trading:  No filters or Volume only (many signals, lower quality)
 Trending Markets:  Trend filter essential (indices, crypto)
 Range-Bound:  Volume + FVG (avoid trend filter)
 
### Common Mistakes to Avoid
 
 Chasing breakouts - wait for the bar to close, don't FOMO into wicks
 Ignoring the stop loss - always use it, move it manually if needed
 Over-leveraging - the calculator shows MAX shares, you can buy less
 Trading every signal - quality > quantity, use filters
 Not tracking results - keep a journal to see what works for YOU
 
## Pros and Cons
### Advantages
 
 Complete all-in-one solution - from signal to position sizing
 Multiple timeframes tracked simultaneously
 Visual clarity - easy to see what's happening
 Cycle tracking catches opportunities others miss
 Built-in risk management eliminates guesswork
 Customizable filters for different trading styles
 No repainting - what you see is locked in
 Works across multiple markets (stocks, forex, crypto)
 
### Limitations
 
 Intraday strategy only - doesn't work on daily charts
 Requires active monitoring during first 1-2 hours of session
 Not suitable for after-hours or extended sessions by default
 Can produce many signals in choppy markets (use filters)
 Dashboard can be overwhelming for complete beginners
 Performance depends on market conditions (trends vs ranges)
 Requires understanding of risk management concepts
 
### Best For
 
 Day traders who can watch the first 1-2 hours of market open
 Traders who want systematic entry/exit rules
 Those learning proper position sizing and risk management
 Active traders comfortable with multiple signals per day
 Anyone trading liquid instruments with clear sessions
 
### Not Ideal For
 
 Swing traders holding multi-day positions
 Set-and-forget / passive investors
 Traders who can't watch market open
 Complete beginners unfamiliar with trading concepts
 Low volume / illiquid instruments
 
## Frequently Asked Questions
 Q: Why are no signals appearing? 
A: Check that you're on an intraday timeframe (5min, 15min, etc.) and that the current time is within your session hours. Also verify that "Enable Breakout Detection" is ON and at least one ORB stage is enabled. If using filters, they might be blocking signals - try disabling them temporarily.
 Q: What's the best ORB stage to use? 
A: ORB15 (15 minutes) is most popular and balanced. ORB5 gives faster signals but more noise. ORB30 and ORB60 are slower but more reliable. Many traders use ORB15 + ORB30 together.
 Q: Should I enable all the filters? 
A: Start with no filters to see all signals. If too many false signals, add Volume filter first (stocks) or Trend filter (trending markets). FVG filter is most restrictive - use for maximum quality but fewer signals.
 Q: How do I know which stop loss method to use? 
A: ATR works for most cases - it adapts to volatility. Use ORB% if you want predictable stop placement. Swing is for respecting chart structure. Safer gives you the most room but largest risk.
 Q: Can I use this for swing trading? 
A: Not really - ORB is fundamentally an intraday strategy. The ranges reset each day. For swing trading, look at weekly support/resistance or moving averages instead.
 Q: Why do TP/SL lines disappear sometimes? 
A: Lines freeze (stop extending) when: stop loss is hit, the last enabled take-profit is hit, or end of session arrives (if "Freeze at EOD" is enabled). This is intentional - the trade is complete.
 Q: What's the difference between "First Only" and "Track Cycles"? 
A: "First Only" shows one breakout UP and one DOWN per day maximum - clean but might miss opportunities. "Track Cycles" shows breakout-retest-rebreak sequences - more signals but busier chart.
 Q: Is position sizing accurate for options/forex? 
A: The calculator is designed for shares (stocks). For options, ignore the share count and use the risk amount. For forex, you'll need to adapt the lot size calculation manually.
 Q: How much capital do I need to use this? 
A: The indicator works for any account size, but practical day trading typically requires $25,000 in the US due to Pattern Day Trader rules. Adjust the "Account Size" setting to match your capital.
 Q: Can I backtest this strategy? 
A: This is an indicator, not a strategy script, so it doesn't have built-in backtesting. You can visually review historical signals or code a strategy script using similar logic.
 Q: Why does the dashboard show different entry price than the breakout label? 
A: If you're looking at an old breakout, the ORB levels may have changed when the next stage completed. The dashboard always shows the CURRENT active range and trade setup.
 Q: What's a good win rate to expect? 
A: ORB strategies typically see 40-60% win rate depending on market conditions and filters used. The strategy relies on positive risk/reward ratios (2:1 or better) to be profitable even with moderate win rates.
 Q: Does this work on crypto? 
A: Yes, but crypto trades 24/7 so you need to define what "session start" means. Use Session Mode = Custom and set your preferred daily reset time (e.g., 0000-2359 UTC).
## Credits & Transparency
### Development
This indicator was developed with the assistance of AI technology to implement complex ORB trading logic.
The strategy concept, feature specifications, and trading logic were designed by the publisher. The implementation leverages modern development tools to ensure:
 
 Clean, efficient, and maintainable code
 Comprehensive error handling and input validation
 Detailed documentation and user guidance
 Performance optimization
 
### Trading Concepts
This indicator implements several public domain trading concepts:
 
 Opening Range Breakout (ORB):  Trading strategy popularized by Toby Crabel, Mark Fisher and many more talanted traders.
 Fair Value Gap (FVG):  Price imbalance concept from ICT methodology
 SuperTrend:  ATR-based trend indicator using public formula
 Risk/Reward Ratio:  Standard risk management principle
 
All mathematical formulas and technical concepts used are in the public domain.
### Pine Script
Uses standard TradingView built-in functions:
 ta.ema(), ta.atr(), ta.vwap(), ta.highest(), ta.lowest(), request.security() 
No external libraries or proprietary code from other authors.
## Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice.
Trading involves substantial risk of loss and is not suitable for every investor. Past performance shown in examples is not indicative of future results.
The indicator provides signals and calculations, but trading decisions are solely your responsibility. Always:
 
 Test strategies on paper before using real money
 Never risk more than you can afford to lose
 Understand that all trading involves risk
 Consider seeking advice from a licensed financial advisor
 
The publisher makes no guarantees regarding accuracy, profitability, or performance. Use at your own risk.
---
 Version:  3.0
 Pine Script Version:  v6
 Last Updated:  October 2024
For support, questions, or suggestions, please comment below or send a private message.
---
 Happy trading, and remember: consistent risk management beats perfect entry timing every time.
Continuation Suite v1 — 5m/15mContinuation Suite v1 — 5m/15m (Non-Repainting, S/R + Trend Continuation)
What it does
Continuation Suite v1 is a practical intraday toolkit that combines non-repainting trend-continuation signals with auto-built Support/Resistance (S/R) from confirmed pivots. It’s designed for fast, liquid names on 5m charts with an optional 15m higher-timeframe (HTF) overlay. You get: stacked-EMA bias, disciplined pullback+reclaim entries, optional volume/volatility gates, a “Strong” signal tier, solid S/R lines or zones, and a compact dashboard for fast reads.
⸻
Why traders use it
	•	Clear bias using fast/mid/slow EMA stacking.
	•	Actionable entries that require a pullback, a reclaim, and (optionally) a minor break of prior extremes.
	•	Signal quality gates (volume vs SMA, ATR%, ADX/DI alignment, EMA spacing, slope).
	•	Non-repainting logic when “Confirm on Close” = ON. Intrabar previews show what’s forming, but confirmed signals only print on bar close.
	•	S/R that matters: confirmed-pivot lines or ATR-sized zones, optional HTF overlay, and auto de-dup to avoid clutter.
⸻
Signal construction (no magic, just rules)
Bullish continuation (base):
	1.	Trend: EMA fast > EMA mid > EMA slow
	2.	Pullback: price pulls into the stack (lowest low or close vs EMA fast/mid over a lookback)
	3.	Reclaim: close > EMA fast and close > open
	4.	Break filter (optional): current bar takes out the prior bar’s high
	5.	Filters: volume > SMA (if enabled) and ATR% ≤ max (if enabled)
	6.	Cooldown: a minimum bar gap between signals
Bearish continuation (base): mirror of the above.
Strong signals: base conditions plus ADX ≥ threshold, DI alignment (DI+>DI- for longs; DI->DI+ for shorts), minimum EMA-spacing %, and minimum fast-EMA slope.
Reference stops:
	•	Longs: lowest low over the pullback lookback
	•	Shorts: highest high over the pullback lookback
Alerts are included for: Bullish Continuation, Bearish Continuation, STRONG Bullish, STRONG Bearish.
⸻
S/R engine (current TF + optional HTF)
	•	Builds S/R from confirmed pivots only (left/right bars).
	•	Choose Lines (midlines) or Zones (ATR-sized).
	•	Zones merge when a new pivot lands near an existing zone’s mid (ATR-scaled epsilon).
	•	Touches counter tracks significance; you can require a minimum to draw.
	•	HTF overlay (default 15m) draws separate lines/zones with tiny TF tags on the right.
	•	De-dup option hides current-TF zones that sit too close to HTF zones (ATR-scaled), reducing overlap.
	•	Freeze on Close (optional) keeps arrays stable intrabar; snapshots show levels immediately as bars open.
⸻
Presets
	•	Auto: Detects QQQ-like tickers (QQQ, QLD, QID) or SoFi; else defaults to Custom.
	•	QQQ: Tighter ATR% and EMA settings geared to index-ETF behavior.
	•	SoFi: Wider ATR allowances and longer mid/slow for single-name behavior.
	•	Custom: Expose all key inputs to tune for your product.
⸻
Dashboard (top-right)
	•	Preset in use
	•	Bias (Bullish CONT / Bearish CONT / Neutral)
	•	Strong (Yes/No)
	•	Volatility (ATR% bucket)
	•	Trend (ADX bucket)
	•	HTF timeframe tag
	•	Volume (bucket or “off”)
	•	Signals mode (Close-Confirmed vs Intrabar)
⸻
Inputs you’ll actually adjust
Trend/Signals
	•	Fast/Mid/Slow EMA lengths
	•	Pullback lookback, Min bars between signals
	•	Volume filter (vol > SMA N)
	•	ATR% max filter (cap excessive volatility)
	•	Require break of prior bar’s high/low
	•	“Strong” gates: min EMA slope, min EMA spacing %, ADX length & threshold
Support/Resistance
	•	Lines vs Zones
	•	Pivot left/right bars
	•	Extend left/right (bars)
	•	Max pivots kept (current & HTF)
	•	Zone width (× ATR), Merge epsilon (× ATR), Min gap (× ATR)
	•	Min touches, Max zones per side near price
	•	De-dup current TF vs HTF (× ATR)
Repainting control
	•	Confirm on Close: when ON, signals/SR finalize on bar close (non-repainting)
	•	Freeze on Close: freeze S/R intrabar with snapshot updates
	•	Show previews: translucent intrabar labels for what’s forming
⸻
How to use it (straightforward)
	1.	Load on 5-minute chart (baseline). Keep Confirm on Close ON if you hate repainting.
	2.	Use Bias + Strong + S/R context. If a long prints into HTF resistance, you have information.
	3.	Manage risk off the reference stop (pullback extreme). If ATR% reads “Great,” widen expectations; if “Poor,” size down or pass.
	4.	Alerts: wire the four alert types to your workflow.
⸻
Notes and constraints
	•	Designed for liquid symbols. Thin books and synthetic “volume” will degrade the volume gate.
	•	S/R is pivot-based. On very choppy tape, touch counts help. Increase min touches or switch to Lines to declutter.
	•	If your chart timeframe isn’t 5m, behavior changes because lengths are in bars, not minutes. Tune lengths accordingly.
⸻
Disclaimers
This is a research tool. No signals are guaranteed. Markets change, outliers happen, slippage is real. Nothing here is financial advice—use your own judgment and risk management.
⸻
Author: DaddyScruff
License: MPL-2.0 (Mozilla Public License 2.0)
Rolling Midpoint of Price & VWAP with ATR BandsThe Rolling Midpoint of Price & VWAP with ATR Bands indicator is a dual-equilibrium concept that fuses price-range structure and traded-volume flow into one continuously updating hybrid model. Traditional VWAPs reset each session and reflect where trading occurred by volume, while midpoints used here reveal where price has structurally balanced between extremes. This script merges both ideas into a cohesive, dynamic system. The Rolling Price Midpoint (50 % of range) represents the structural fair-value line, calculated as the average of the highest high and lowest low over a selected window. The Rolling VWAP (Volume-Weighted Window) tracks the flow-based fair-value line by weighting each bar’s typical price by its volume. Together, these components form the Hybrid Equilibrium — the adaptive center of gravity that shifts as price and volume evolve. Surrounding this equilibrium, ATR Bands at ± 2.226 ATR and ± 5.382 ATR define volatility envelopes that expand and contract with market energy. The result is a living cloud that breathes with the market: compressing during phases of balance and widening during impulsive movements, offering traders a clear visual framework for understanding equilibrium, volatility, and directional bias in real time.
➖
⚙️ Auto-Preset System
The Auto-Preset System intelligently adjusts lookback windows for both the Price Midpoint and VWAP calculations according to the active chart timeframe.  
This ensures that the indicator automatically adapts to any trading style — from scalping on 1-minute charts to swing trading on daily or weekly charts — without manual tuning.
🔹 How It Works
When Auto-Preset mode is enabled, the script dynamically selects the most effective lookback lengths for each timeframe.  
These presets are optimized to balance responsiveness and stability, maintaining consistent real-world coverage (e.g., the same approximate duration of price data) across all intervals.
📊 Preset Mapping Table
| Chart Timeframe | Price Midpoint Lookback | VWAP Lookback |
|:----------------:|:-----------------------:|:--------------:|
|     1–3m          |         13 bars             |    21 bars 
|     5–10m        |          21 bars            |    34 bars 
|    15–30m       |          34 bars            |     55 bars 
|    1–2 hr         |          55 bars            |     89 bars 
|    4 hr-1D       |          89 bars            |     144 bars 
|    1W             |          144 bars           |    233 bars 
|    1M              |          233 bars          |     377 bars
⚡ Notes & Customization
- Manual Override: Turn off Auto-Preset Mode to specify your own custom lookback lengths.  
- Consistency Across Scales: These adaptive values keep the indicator visually coherent when switching between timeframes — avoiding distortions that can occur with static lengths.  
- Practical Benefit: Traders can maintain a single chart layout that self-tunes seamlessly, removing the need to manually recalibrate settings when shifting from short-term to long-term analysis.
In short, the Auto-Preset System is designed to make this hybrid equilibrium tool timeframe-aware — automatically scaling its logic so that the cloud behaves consistently, regardless of chart resolution.
➖
 🌐 Hybrid Equilibrium Envelope
The core hybrid midpoint acts as the mean of structural (price) and volumetric (VWAP) balance.  
ATR-based bands project natural expansion zones:
🔸+2.226 / –2.226 ATR → inner equilibrium (controlled trend)  
*🔸+5.382 / –5.382 ATR → outer volatility extension (over-stretch / reversion zones)
Color-coded fills show regime strength:
* 🟧 Upper Outer (+5.382) – strong bullish expansion  
* 🟩 Upper Inner (+2.226) – trending equilibrium  
* 🔴 Lower Inner (–2.226) – mild bearish control  
* 🟣 Lower Outer (–5.382) – volatility exhaustion
➖
🧭 Higher-Timeframe Framework
Two macro anchors — Price length of 144 and VWAP length of 233 — outline higher-timeframe bias zones. These help confirm when local momentum aligns with (or fades against) long-term structure.
Labels on the right show active lookback values for quick readout:
`$(13) V(21)` → current rolling pair  
`$144 / V233` → macro anchors
➖
🧩 Chart Examples
**AMD 15m (Equilibrium Expansion)**  
Price steadily rides above the hybrid midpoint as teal and orange (bullish) ATR zones widen, confirming a phase of controlled bullish volatility and healthy trend expansion.
 BTCUSD 1m (Volatility Compression)
Bitcoin coils tightly inside the teal-to-maroon equilibrium bands before breaking out.  
The hybrid midpoint flattens and ATR envelopes contract, signaling a state of balance before volatility expansion.  
ETHUSD 15m (Transition from Compression → Impulse)
Ethereum transitions from purple-zone compression into a clear upper-band expansion.  
The hybrid midpoint breaks above the macro VWAP 233, confirming the shift from equilibrium to directional momentum.  
SOFI 1m (Micro Bias Reversal)
SOFI’s intraday structure flips as price reclaims the hybrid midpoint.  
The macro VWAP 233 flattens, signaling a transition from oversold lower bands back toward equilibrium and early trend recovery.  
➖
🎯 How to Use
1. Bias Detection – Price > Hybrid Midpoint → bullish; < → bearish.  
2. Volatility Gauge – Watch band spacing for compression / expansion cycles.  
3. Confluence Checks – Align Hybrid Midpoint with HTF 233 VWAP for strong continuation signals.  
4. Mean Reversion Zones – Outer bands highlight areas where probability of snap-back increases.  
➖
🔧 Inputs & Customization
Auto Presets toggle  
🔸Manual Lookback Overrides** for fine-tuning  
🔸Plot Window Length** (show recent vs full history)  
🔸ATR Sensitivity & Fill Opacity** controls  
🔸Label Padding / Font Size** for cleaner overlay visuals  
➖
🧮 Formula Highlights
➖Rolling Midpoint = (highest(high,N) + lowest(low,N)) / 2
➖Rolling VWAP = Σ(Typical Price×Vol) / Σ(Vol)
➖Hybrid = (PriceMid + VWAP) / 2
➖Upper₂ = Hybrid + ATR×2.226
➖Lower₂ = Hybrid − ATR×2.226
➖Upper₅ = Hybrid + ATR×5.382
➖Lower₅ = Hybrid − ATR×5.382
➖
 🎯 Ideal For
➡️ Traders who want adaptive fair-value zones that evolve with both price and volume.  
➡️ Analysts who shift between scalping, swing, and position timeframes, and need a tool that self-adjusts.  
➡️ Those who rely on visual structure clarity to confirm setups across changing volatility conditions.  
➡️ Anyone seeking a hybrid model that unites structural range logic (midpoint) and flow-based balance (VWAP).
➖
🏁 Final Word
This script is more than a visual overlay — it’s a complete trend and structure framework built to adapt with market rhythm. It helps traders visualize equilibrium, momentum, and volatility as one cohesive system. Whether you’re seeking clean trend alignment, dynamic support/resistance, or early warning signs of reversals, this indicator is tuned to help you react with confidence — not hindsight.
➖
Remember — no single indicator should ever stand alone. For best results, pair it with price action context, higher-timeframe structure, and complementary tools such as moving averages or trendlines. Use it to confirm setups, not define them in isolation.
💡 Turn logic into clarity, structure into trades, and uncertainty into confidence.
Volumatic Fair Value Gaps [BigBeluga]🔵 OVERVIEW 
The  Volumatic Fair Value Gaps   indicator detects and plots  size-filtered  Fair Value Gaps (FVGs) and immediately analyzes the  bullish vs. bearish volume composition  inside each gap. When an FVG forms, the tool samples volume from a  10× lower timeframe , splits it into Buy and Sell components, and overlays two compact bars whose percentages always sum to 100%. Each gap also shows its  total traded volume . A live dashboard (top-right) summarizes how many  bullish  and  bearish  FVGs are currently active and their cumulative volumes—offering a quick read on directional participation and trend pressure.
 🔵 CONCEPTS 
 
   FVGs (Fair Value Gaps) : Imbalance zones between three consecutive candles where price “skips” trading. The script plots bullish and bearish gaps and extends them until mitigated.
  
   Size Filtering : Only significant gaps (by relative size percentile) are drawn, reducing noise and emphasizing meaningful imbalances.
 
// Gap Filters
float diff         =  close  > open  ? (low - high ) / low * 100 : (low  - high) / high *100
float sizeFVG   = diff / ta.percentile_nearest_rank(diff, 1000, 100) * 100
bool  filterFVG = sizeFVG > 15
 
  
   Volume Decomposition : For each FVG, the indicator inspects a 10× lower timeframe and aggregates volume of bullish vs. bearish candles inside the gap’s span.
   100% Split Bars : Two inline bars per FVG display the  % Bull  and  % Bear  shares; their total is always 100%.
   Total Gap Volume : A numeric label at the right edge of the FVG shows the total traded volume associated with that gap.
  
   Mitigation Logic : Gaps are removed when price closes through (or touches via high/low—user-selectable) the opposite boundary.
  
   Dashboard Summary : Counts and sums the active bullish/bearish FVGs and their total volumes to gauge directional dominance.
  
 
 🔵 FEATURES 
 
   Bullish & Bearish FVG plotting  with independent color controls and visibility toggles.
   Adaptive size filter  (percentile-based) to keep only impactful gaps.
   Lower-TF volume sampling  at 10× faster resolution for more granular Buy/Sell breakdown.
   Per-FVG volume bars : two horizontal bars showing  Bull %  and  Bear %  (sum = 100%).
   Per-FVG total volume label  displayed at the right end of the gap’s body.
   Mitigation source option : choose  close  or  high/low  for removing/invalidating gaps.
   Overlap control : older overlapped gaps are cleaned to avoid clutter.
   Auto-extension : active gaps extend right until mitigated.
   Dashboard : shows count of bullish/bearish gaps on chart and cumulative volume totals for each side.
   Performance safeguards : caps the number of active FVG boxes to maintain responsiveness.
 
 🔵 HOW TO USE 
 
   Turn on/off FVG types : Enable  Bullish FVG  and/or  Bearish FVG  depending on your focus.
   Tune the filter : The script already filters by relative size; if you need fewer (stronger) signals, increase the percentile threshold in code or reduce the number of displayed boxes.
   Choose mitigation source :
 
   close  — stricter; gap is removed when a closing price crosses the boundary.
   high/low  — more sensitive; a wick through the boundary mitigates the gap.
 
   Read the per-FVG bars :
 
  A higher  Bull %  inside a  bullish gap  suggests constructive demand backing the imbalance.
  A higher  Bear %  inside a  bearish gap  suggests supply is enforcing the imbalance.
 
   Use total gap volume : Larger totals imply more meaningful interest at that imbalance; confluence with structure/HTF levels increases relevance.
   Watch the dashboard : If bullish counts and cumulative volume exceed bearish, market pressure is likely skewed upward (and vice versa). Combine with trend tools or market structure for entries/exits.
   Optional: hide volume bars : Disable  Volume Bars  when you want a cleaner FVG map while keeping total volume labels and the dashboard.
 
 🔵 CONCLUSION 
 Volumatic Fair Value Gaps   blends precise FVG detection with lower-timeframe volume analytics to show not only  where  imbalances exist but also  who  powers them. The per-gap Bull/Bear % bars, total volume labels, and the cumulative dashboard together provide a fast, high-signal read on directional participation. Use the tool to prioritize higher-quality gaps, align with trend bias, and time mitigations or continuations with greater confidence.
Interval Highlighter with High/Low AlertsInterval Highlighter with High/Low Alerts 
 Overview: 
This Pine Script indicator enhances chart analysis by highlighting specific time intervals and marking the highest and lowest prices within those periods. It supports three customizable modes:
 Date Range:   Highlight a user-defined period with background shading and plot the highest and lowest prices.
 
 Days of the Week:   Highlight specific weekdays with background colors and plot the highest and lowest prices for each day. 
 Intraday Interval:   Highlight a specific intraday time range (e.g., 12:30 PM to 4:30 PM) with background shading and plot the highest and lowest prices within that interval. 
 Alerts  are triggered when the price touches any of the highlighted high or low levels, providing real-time notifications for potential trading opportunities.
High and low lines extend to the right and remain visible after the interval ends. This ensures they act as actionable reference points for alerts between intervals, allowing users to monitor critical levels until a new interval of the same category forms.
 Features: 
 Customizable Time Intervals:   Define specific date ranges, weekdays, or intraday intervals to highlight on the chart. 
 High/Low Tracking:   Automatically plots the highest and lowest prices within the defined intervals. 
 Real-Time Alerts:   Set up alerts to notify when the price touches any of the highlighted high or low levels. 
 Actionable Lines:   High/low lines remain visible after interval completion to serve as reference points for alerts. 
 Visual Enhancements:   Customize background colors and line styles for each interval type. 
 Usage: 
Apply the indicator to your chart.
Configure the desired modes (Date Range, Days of the Week, Intraday Interval) in the settings.
Customize the appearance settings to match your preferences.
Set up alerts based on the highlighted high/low levels.
Disclaimer:
This indicator is designed to assist in identifying potential areas of interest based on historical high and low levels within specified intervals. It is not intended as a standalone trading signal. Users should employ additional technical analysis tools and conduct thorough research before making trading decisions.
Machine Learning-Inspired Supply & Demand Zones [AlgoPoint]This indicator is a Smart Supply & Demand Zone tool, developed with principles inspired by Machine Learning (ML). It intelligently filters out market noise, allowing you to focus only on the most significant zones where institutional order flow is likely present.
 💡 How It Works: Why Is This Indicator "Smart"? 
Unlike traditional indicators that only measure simple price movements, this script uses an algorithm that asks the same critical questions an experienced market analyst would to qualify a zone:
- 1. Price Imbalance: How fast and aggressively did the price leave the zone? Our algorithm measures the body size of the "departure candle" relative to the current market volatility (ATR). A zone is only considered if it was formed by an explosive move that is statistically significant, indicating a major imbalance between buyers and sellers.
- 2. Volume Confirmation: Did the "smart money" participate in this move? The script checks if the volume on the departure candle was significantly higher than the recent average volume. A spike in volume confirms that the move was backed by institutional interest, adding strength and validity to the zone.
- 3. Valid Pivot Structure: Did the zone originate from a meaningful swing high or low? The algorithm first identifies a valid pivot structure, ensuring that zones are not drawn from insignificant or random price fluctuations.
Only when a potential zone passes these three critical tests—our "quality filter"—is it drawn on your chart.
 🚀 Features & How to Use 
Using the indicator is straightforward. You will see two primary types of boxes on your chart:
* 🟥 Red Box (Supply Zone): An area of potential resistance where selling pressure is likely to be strong. Look for potential shorting opportunities as the price approaches this zone.
* 🟩 Green Box (Demand Zone): An area of potential support where buying pressure is likely to be strong. Look for potential long opportunities as the price pulls back into this zone.
 Dynamic Zone Management 
This indicator is not static; it lives and breathes with the market:
- Fresh Zone: A newly formed zone appears in its full, vibrant color. These are the highest-probability zones as they have not yet been re-tested.
- Broken / Flipped Zone: You have full control over what happens when a zone is broken! In the settings, you can choose:
    - Delete Zone: The zone will be removed completely when the price closes through it.
    - Show as Broken (Flip): When broken, the zone will turn gray, stop extending, and remain on your chart. This is extremely useful for identifying Support/Resistance Flips, where a broken demand zone becomes new resistance, or a broken supply zone becomes new support.
 ⚙️ Settings & Customization 
Fine-tune the indicator to match your personal trading style via the settings menu:
- Breakout Behavior: The most powerful feature. Choose between Delete Zone and Show as Broken (Flip) to customize your chart.
- Zone Finding Logic: Control the indicator's sensitivity.
    - Selective: Requires both strong imbalance and high volume. Finds fewer, but higher-quality, zones.
    - Moderate: Requires either strong imbalance or high volume. Finds more potential zones.
- Sensitivity Settings: Adjust the ATR Multiplier and Volume Multiplier to make the criteria for a "strong" zone stricter or looser.
Wick Pressure Zones [BigBeluga]
The  Wick Pressure Zones   indicator highlights areas where  extreme wick activity  occurred, signaling strong buy or sell pressure. By measuring unusually long upper or lower wicks and mapping them into  gradient volume zones , the tool helps traders identify levels where liquidity was absorbed, leaving behind footprints of supply and demand imbalances. These zones often act as  support, resistance, or liquidity sweep magnets .
 🔵 CONCEPTS 
 
   Extreme Wicks : Large upper or lower shadows indicate aggressive rejection — upper wicks suggest selling pressure, lower wicks suggest buying pressure.
  
   Volumatic Gradient Zones : From each detected wick, the indicator projects a layered gradient zone, proportional to the wick’s size, showing where most pressure occurred.
  
   Liquidity Footprints : These zones mark levels where significant buy/sell volume was executed, often becoming reaction points on future retests.
  
   Automatic Expiration : Zones persist until price decisively trades through them, after which they are cleared to keep the chart clean.
 
 🔵 FEATURES 
 
   Automatic Wick Detection : Identifies extreme upper and lower wick events using percentile filtering and Realative Strength Index.
   Gradient Zone Visualization : Builds a 10-layer zone from the wick top/bottom, shading intensity according to pressure strength.
   Volume Labels : Each zone is annotated with the bar’s volume at the origin point for added context.
   Dynamic Zone Extension : Zones extend to the right as long as they remain relevant; once price closes through them, they are removed.
   Support & Resistance Mapping : Upper wick zones (red) behave like supply/resistance, lower wick zones (green) like demand/support.
   Clutter Control : Limits the number of active zones (default 10) to keep charts responsive.
   Background Highlighting : Optional background shading when new wick zones appear (red for sell, green for buy).
   
 
 🔵 HOW TO USE 
 
   Look for Upper Wick Zones (red) : Indicate strong selling pressure; watch for resistance, reversals, or liquidity sweeps above.
   Look for Lower Wick Zones (green) : Indicate strong buying pressure; watch for support or liquidity sweeps below.
   Trade Retests : When price returns to a zone, expect a reaction (bounce or rejection) due to leftover liquidity.
  
  
   Combine with Context : Align wick pressure zones with HTF support/resistance, order blocks, or volume profile for stronger signals.
   Use Volume Labels : High-volume wicks indicate more significant liquidity events, making the zone more likely to act as a strong reaction point.
 
 🔵 CONCLUSION 
The  Wick Pressure Zones   is a powerful way to visualize hidden liquidity and aggressive rejections. By mapping extreme wick events into dynamic, volume-annotated zones, it shows traders where the market absorbed heavy buy/sell pressure. These levels frequently act as magnets or turning points, making them valuable for timing entries, stop placement, or fade strategies.
Smart Money Footprint & Cost Basis Engine [AlgoPoint]Smart Money Footprint & Cost Basis Engine  
 
This indicator is a comprehensive market analysis tool designed to identify the "footprints" of Smart Money (institutions, whales) and pinpoint high-probability reaction zones. Instead of relying on lagging averages, this engine analyzes the very structure of the market to find where large players have shown their hand.
 How It Works: The Core Logic
 The indicator operates on a multi-stage confirmation process to identify and validate Smart Money zones:
 Smart Money Detection (The Trigger):  The engine first scans the chart for signs of intense, urgent buying or selling. It does this by identifying Fair Value Gaps (FVGs) created by large, high-volume Displacement Candles. This is our initial Point of Interest (POI).
Cost Basis Calculation (The Average Price): Once a potential Smart Money move is detected, the indicator calculates the Volume-Weighted Average Price (VWAP) for that specific move. This gives us a highly accurate estimate of the average price at which the large players entered their positions.
 Historical Confirmation (The "Memory"):  This is the indicator's most unique feature. It checks its historical database to see if a similar Smart Money move (in the same direction) has occurred in the same price area in the past. If a match is found, the zone's significance is confirmed.
 Verified Cost Basis Zone (The Final Output):  A zone that passes all the above checks is drawn on the chart as a high-probability Verified Cost Basis Zone. These are the "memory zones" where the market is likely to react upon a re-visit.
 How to Use This Indicator
 Cost Basis Zones (The Boxes):
 Green Boxes:  Bullish zones where Smart Money likely accumulated positions. When the price returns here, a BUY reaction is expected.
 Red Boxes:  Bearish zones where Smart Money likely distributed positions. When the price returns here, a SELL reaction is expected.
 Zone Strength (★★★):  Each zone is created with a star rating. More stars indicate a higher-confidence zone (based on factors like volume intensity and historical confirmation).
 BUY/SELL Signals:  A signal is only generated when the price enters a zone AND the confirmation filters (if enabled in the settings) are passed.
 Zone Statuses:
 
 Green/Red:  Active and waiting to be tested.
 Gray:  The zone has been tested, and a signal was produced.
 Dark Gray (Invalidated):  The zone was broken decisively and is no longer considered valid support/resistance.
 Key Settings
 Signal Accuracy Filters:  You can enable/disable three powerful filters to balance signal quantity and quality:
 Momentum Confirmation (Stoch):  Waits for momentum to align with the zone's direction.
 Candlestick Confirmation (Engulfing):  Waits for a strong reversal candle inside the zone.
 Lower Timeframe MSS Confirmation:  The most advanced filter; waits for a trend shift on a lower timeframe before giving a signal.
 Historical Confirmation:
 
 Require Historical Confirmation:  Toggle the "Memory" feature on/off. Turn it off to see all potential SM zones.
 Tolerance Calculation Method:  Choose between a dynamic ATR Multiplier (recommended for all-around use) or a fixed Percentage to define the zone size.
FibonacciRetracementHi all!
This library will help you draw Fibonacci retracement levels (zones). The code is from my indicator "Fibonacci retracement" (). You can see that description for more information about the behaviour and example of how to use this library. The code is almost the same with the addition of alerts. If the alert frequency is 'alert.freq_once_per_bar_close' alert messages will be concatenated and have a header saying how many messages it contains (if it's more than 1).
Hope this is of help!
Library   "FibonacciRetracement" 
 ConcateAlerts(context) 
  Concatenates all alerts from the bar to one string (separated by new lines) and clears alert messages on the current bar.
  Parameters:
     context (Context) 
 AddAlert(context, message, unshiftInsteadOfPush) 
  Parameters:
     context (Context) 
     message (string) 
     unshiftInsteadOfPush (bool) 
 Range(context, structure, settings) 
  Will return values if new levels/zones should be drawn.
  Parameters:
     context (Context) : The 'Context' for the Fibonacci retracement.
     structure (Structure type from mickes/PriceAction/1) : The current 'Structure' from the 'MarketStructure' library.
     settings (Settings) : The 'Settings' object for the 'Context'.
  Returns: A tuple with the start and end pivot if new zones should be drawn, ' ' otherwise.
 DrawAll(context, settings, start, end) 
  Draws lines and labels for the zone. It will also set the 'Price' value that will be used for absolute positions.
  Parameters:
     context (Context) : The 'Context' for the Fibonacci retracement.
     settings (Settings) : The 'Settings' object for the 'Context'.
     start (Pivot type from mickes/PriceAction/1) 
     end (Pivot type from mickes/PriceAction/1) 
 AlertActive(context, settings) 
  Will alert for all zones that are active. If multiple alert messages are added they will be concatenated (separated by a new line) with a header saying how many messages the alert contains.
  Parameters:
     context (Context) : The 'Context' for the Fibonacci retracement. This contains the zones that will be alerted if price (wick or close according to the settings) enters it.
     settings (Settings) : The 'Settings' object for the 'Context'.
 TrendlineSettings 
  Holds all the values for 'TrendlineSettings'.
  Fields:
     Enabled (series bool) : If the trendline should be visible or not.
     Color (series color) : The color of the trendline.
     Style (series string) : The style of the trendline (as a string).
 GenericZonesSettings 
  Holds all the values for 'GenericZonesSettings', that will be applicable to all drawn objects.
  Fields:
     ExtendRight (series bool) : If all lines should extend to the right or not.
     Style (series string) : The style of all drawn lines
     Reverse (series bool) : If true, all lines will be reversed.
     Prices (series bool) : If price levels should be shown or not.
     Levels (series bool) : If levels should be shown or not.
     LevelsValue (series string) : Either 'Value' or 'Percent'. Defined if value or percentage should be shown.
     FontSize (series int) : The for size of the text in labels drawn.
     LabelsPosition (series string) : Coul be 'Left', 'Rigth' or 'Adapt'. 'Adapt' will try to adapt the labels position to the prices.
 ZoneSettings 
  Holds all the values for 'ZoneSettings'.
  Fields:
     Enabled (series bool) : If this zone is enabled or not.
     Level (series float) : The level of the zone.
     Color (series color) : The color that will be displayed.
     Price (series float) : The price of the level. Will be set internally.
 Settings 
  Holds all the values for 'Settings'.
  Fields:
     PivotLeftLength (series int) : The left length used to find pivots through the 'MarketStructure' library.
     PivotRightLength (series int) : The right length used to find pivots through the 'MarketStructure' library.
     Trendline (TrendlineSettings) : The settings for the 'Trendline' object.
     GenericZonesSettings (GenericZonesSettings) : The setting applicable to all zones.
     AlertFrequency (series string) : The frequency for the alerts. If 'alert.freq_once_per_bar_close', alert messages will be concatenated and have a header saying how many messages it contains (if it's more than 1).
     AlertPrice (series string) : The price that has to enter a zone. Can be 'Close' (the closing price) or 'Wick' (the whole candle needs to be in the zone).
     Zone1 (ZoneSettings) : The 'ZoneSettings' that represents this zone.
     Zone2 (ZoneSettings) : The 'ZoneSettings' that represents this zone.
     Zone3 (ZoneSettings) : The 'ZoneSettings' that represents this zone.
     Zone4 (ZoneSettings) : The 'ZoneSettings' that represents this zone.
     Zone5 (ZoneSettings) : The 'ZoneSettings' that represents this zone.
     Zone6 (ZoneSettings) : The 'ZoneSettings' that represents this zone.
     Zone7 (ZoneSettings) : The 'ZoneSettings' that represents this zone.
     Zone8 (ZoneSettings) : The 'ZoneSettings' that represents this zone.
     Zone9 (ZoneSettings) : The 'ZoneSettings' that represents this zone.
     Zone10 (ZoneSettings) : The 'ZoneSettings' that represents this zone.
     Zone11 (ZoneSettings) : The 'ZoneSettings' that represents this zone.
     Zone12 (ZoneSettings) : The 'ZoneSettings' that represents this zone.
     Zone13 (ZoneSettings) : The 'ZoneSettings' that represents this zone.
     Zone14 (ZoneSettings) : The 'ZoneSettings' that represents this zone.
     Zone15 (ZoneSettings) : The 'ZoneSettings' that represents this zone.
     Zone16 (ZoneSettings) : The 'ZoneSettings' that represents this zone.
     Zone17 (ZoneSettings) : The 'ZoneSettings' that represents this zone.
     Zone18 (ZoneSettings) : The 'ZoneSettings' that represents this zone.
     Zone19 (ZoneSettings) : The 'ZoneSettings' that represents this zone.
     Zone20 (ZoneSettings) : The 'ZoneSettings' that represents this zone.
     Zone21 (ZoneSettings) : The 'ZoneSettings' that represents this zone.
     Zone22 (ZoneSettings) : The 'ZoneSettings' that represents this zone.
     Zone23 (ZoneSettings) : The 'ZoneSettings' that represents this zone.
     Zone24 (ZoneSettings) : The 'ZoneSettings' that represents this zone.
 Context 
  Holds all the values for 'Context'.
  Fields:
     Lines (array) : All the drawn lines for the current 'Context'.
     Labels (array) : All the drawn labels for the current 'Context'.
     Boxes (array) : All the drawn boxes for the current 'Context'.
     Alerts (array) : All the alert messages on the current tick.
     Start (series int) : The start bar index of the current 'Context'.
Advanced Trend Momentum [Alpha Extract]The Advanced Trend Momentum   indicator provides traders with deep insights into market dynamics by combining exponential moving average analysis with RSI momentum assessment and dynamic support/resistance detection. This sophisticated multi-dimensional tool helps identify trend changes, momentum divergences, and key structural levels, offering actionable buy and sell signals based on trend strength and momentum convergence.
🔶 CALCULATION
The indicator processes market data through multiple analytical methods:
Dual EMA Analysis: Calculates fast and slow exponential moving averages with dynamic trend direction assessment and ATR-normalized strength measurement.
RSI Momentum Engine: Implements RSI-based momentum analysis with enhanced overbought/oversold detection and momentum velocity calculations.
Pivot-Based Structure: Identifies and tracks dynamic support and resistance levels using pivot point analysis with configurable level management.
Signal Integration: Combines trend direction, momentum characteristics, and structural proximity to generate high-probability trading signals.
Formula:
 
 Fast EMA = EMA(Close, Fast Length)
 Slow EMA = EMA(Close, Slow Length)
 Trend Direction = Fast EMA > Slow EMA ? 1 : -1
 Trend Strength = |Fast EMA - Slow EMA| / ATR(Period) × 100
 RSI Momentum = RSI(Close, RSI Length)
 Momentum Value = Change(Close, 5) / ATR(10) × 100
 Pivot Support/Resistance = Dynamic pivot arrays with configurable lookback periods
 Bullish Signal = Trend Change + Momentum Confirmation + Strength > 1%
 Bearish Signal = Trend Change + Momentum Confirmation + Strength > 1%
 
🔶 DETAILS
Visual Features:
 
 Trend EMAs: Fast and slow exponential moving averages with dynamic color coding (bullish/bearish)
 Enhanced RSI: RSI oscillator with color-coded zones, gradient fills, and reference bands at overbought/oversold levels
 Trend Fill: Dynamic gradient between EMAs indicating trend strength and direction
 Support/Resistance Lines: Horizontal levels extending from pivot-based calculations with configurable maximum levels
 Momentum Candles: Color-coded candlestick overlay reflecting combined trend and momentum conditions
 Divergence Markers: Diamond-shaped signals highlighting bullish and bearish momentum divergences
 Analysis Table: Real-time summary of trend direction, strength percentage, RSI value, and momentum reading
 
Interpretation:
 
 Trend Direction: Bullish when Fast EMA crosses above Slow EMA with strength confirmation
 Trend Strength > 1%: Strong trending conditions with institutional participation
 RSI > 70: Overbought conditions, potential selling opportunity
 RSI < 30: Oversold conditions, potential buying opportunity
 Momentum Divergence: Price and momentum moving opposite directions signal potential reversals
 Support/Resistance Proximity: Dynamic levels provide optimal entry/exit zones
 Combined Signals: Trend changes with momentum confirmation generate high-probability opportunities
 
🔶 EXAMPLES
Trend Confirmation: Fast EMA crossing above Slow EMA with trend strength exceeding 1% and positive momentum confirms strong bullish conditions.
Example: During institutional accumulation phases, EMA crossovers with momentum confirmation have historically preceded significant upward moves, providing optimal long entry points.
 
 15min
 
 
 4H
 
Momentum Divergence Detection: RSI reaching overbought levels while momentum decreases despite rising prices signals potential trend exhaustion.
Example: Bearish divergence signals appearing at resistance levels have marked major market tops, allowing traders to secure profits before corrections.
Support/Resistance Integration: Dynamic pivot-based levels combined with trend and momentum signals create high-probability trading zones.
Example: Bullish trend changes occurring near established support levels offer optimal risk-reward entries with clearly defined stop-loss levels.
Multi-Dimensional Confirmation: The indicator's combination of trend, momentum, and structural analysis provides comprehensive market validation.
Example: When trend direction aligns with momentum characteristics near key structural levels, the confluence creates institutional-grade trading opportunities with enhanced probability of success.
🔶 SETTINGS
Customization Options:
 
 Trend Analysis: Fast EMA Length (default: 12), Slow EMA Length (default: 26), Trend Strength Period (default: 14)
 Support & Resistance: Pivot Length for level detection (default: 10), Maximum S/R Levels displayed (default: 3), Toggle S/R visibility
 Momentum Settings: RSI Length (default: 14), Oversold Level (default: 30), Overbought Level (default: 70)
 Visual Configuration: Color schemes for bullish/bearish/neutral conditions, transparency settings for fills, momentum candle overlay toggle
 Display Options: Analysis table visibility, divergence marker size, alert system configuration
 
The Advanced Trend Momentum   indicator provides traders with comprehensive insights into market dynamics through its sophisticated integration of trend analysis, momentum assessment, and structural level detection. By combining multiple analytical dimensions into a unified framework, this tool helps identify high-probability opportunities while filtering out market noise through its multi-confirmation approach, enabling traders to make informed decisions across various market cycles and timeframes.
OHLC Lines – Yesterday & Today (Minimalist Option)This indicator draws horizontal lines representing the Open, High, Low, and Close (OHLC) levels of yesterday and today directly on your chart. It automatically updates each day, showing only the lines for the previous day and the current day, keeping your chart clean and focused.
Features:
Display Yesterday’s OHLC levels.
Display Today’s OHLC levels.
Optional Minimalist Mode with customizable color, width, and line style.
Lines automatically update each day and remove old lines.
Fully customizable colors, visibility, and line width for each OHLC level.
Use Case:
Perfect for traders who want to monitor key daily price levels, identify support/resistance zones, or incorporate OHLC levels into intraday strategies.
Clean Pivot Lines with AlertsTechnical Overview 
This Script is designed for detecting untouched pivot highs and lows. It draws horizontal levels only when those pivots remain unviolated within a configurable lookback window and removes them automatically upon price breaches or sweeps.
Key components include:
 
 Pivot detection logic : Utilizes ta.pivothigh()/ta.pivotlow() (or equivalent via request.security for HTF) with parameterized pivotLength to ensure flexibility and adaptability to different timeframes.
 Cleanliness filtering : Checks lookbackBars prior to line creation to skip levels already violated, ensuring only uncontaminated pivots are used.
 Dynamic level tracking : Stores active levels in arrays (highLines, lowLines) for continuous real-time monitoring.
 Violation logic : Detects both close-based breaks (breakAbove/breakBelow) and wick-based sweeps (sweepAbove/sweepBelow), triggering alerts and automatic teardown.
 Periodic housekeeping : Every N (10) confirmed bars, re-verifies “clean” status and removes silently invalidated levels—maintaining chart hygiene and avoiding stale overlays.
 Customization options : Supports pivot timeframe override, colors, line width/style, lookback length, and alert toggling.
 
 Utility 
This overlay script provides a disciplined workflow for drawing meaningful support/resistance levels, filtering out contaminated pivot points, and signaling validations (breaks/sweeps) with alerts. Its modular design and HTF support facilitate integration into systematic workflows, offering far more utility than mere static pivot plots.
 Usage Instructions 
1. Adjust `pivot_timeframe`, `pivot_length`, and `lookback_bars` to suit your strategy timeframe and volatility structure.  
2. Customize visual parameters as required.  
3. Enable alerts to receive in-platform messages upon pivot violations.  
4. Use HTF override only if analyzing multi-timeframe pivot behavior; otherwise, leave empty to default to chart timeframe.  
 Performance & Limitations 
- Pivot lines confirmation lags by `pivot_length` bars; real-time signals may be delayed.  
- Excessive active lines may impact performance on low-TF charts.  
- The “clean” logic is contingent on the `lookback_bars` parameter; choose sufficiently high values to avoid false cleanliness.  
- Alerts distinguish between closes beyond and wick-only breaches to aid strategic nuance.
Hann Window FIR Filter Ribbon [BigBeluga]🔵 OVERVIEW 
The  Hann Window FIR Filter Ribbon   is a trend-following visualization tool based on a family of FIR filters using the Hann window function. It plots a smooth and dynamic ribbon formed by six Hann filters of progressively increasing length. Gradient coloring and filled bands reveal trend direction and compression/expansion behavior. When short-term trend shifts occur (via filter crossover), it automatically anchors visual support/resistance zones at the nearest swing highs or lows.
 🔵 CONCEPTS 
 
   Hann FIR Filter:  A finite impulse response filter that uses a Hann (cosine-based) window for weighting past price values, resulting in a non-lag, ultra-smooth output.
 
hannFilter(length)=>
    var float hann = na  // Final filter output
    float filt = 0
    float coef = 0
    for i = 1 to length
        weight = 1 - math.cos(2 * math.pi * i / (length + 1))  
        filt += price  * weight
        coef += weight
    hann := coef != 0 ? filt / coef : na
 
   Ribbon Stack:  The indicator plots 6 Hann FIR filters with increasing lengths, creating a smooth "ribbon" that adapts to price shifts and visually encodes volatility.
   Gradient Coloring:  Line colors and fill opacity between layers are dynamically adjusted based on the distance between the filters, showing momentum expansion or contraction.
  
   Dynamic Swing Zones:  When the shortest filter crosses its nearest neighbor, a swing high/low is located, and a triangle-style level is anchored and projected to the right.
   Self-Extending Levels:  These dynamic levels persist and extend until invalidated or replaced by a new opposite trend break.
  
 
 🔵 FEATURES 
 
  Plots 6 Hann FIR filters with increasing lengths (controlled by Ribbon Size input).
  Automatically colors each filter and the fill between them with smooth gradient transitions.
  Detects trend shifts via filter crossover and anchors visual resistance (red) or support (green) zones.
  
  Support/resistance zones are triangle-style bands built around recent swing highs/lows.
  Levels auto-extend right and adapt in real time until invalidated by price action.
  
  Ribbon responds smoothly to price and shows contraction or expansion behavior clearly.
  No lag in crossover detection thanks to FIR architecture.
  Adjustable sensitivity via Length and Ribbon Size inputs.
 
 🔵 HOW TO USE 
 
  Use the  ribbon gradient  as a visual trend strength and smooth direction cue.
  Watch for  crossover of shortest filters  as early trend change signals.
  Monitor  support/resistance zones  as potential high-probability reaction points.
  Combine with other tools like momentum or volume to confirm trend breaks.
  Adjust ribbon thickness and length to suit your trading timeframe and volatility preference.
 
 🔵 CONCLUSION 
 Hann Window FIR Filter Ribbon   blends digital signal processing with trading logic to deliver a visually refined, non-lagging trend tool. The adaptive ribbon offers insight into momentum compression and release, while swing-based levels give structure to potential reversals. Ideal for traders who seek smooth trend detection with intelligent, auto-adaptive zone plotting.
Lorentzian Key Support and Resistance Level Detector [mishy]🧮 Lorentzian Key S/R Levels Detector 
 Advanced Support & Resistance Detection Using Mathematical Clustering 
 The Problem 
Traditional S/R indicators fail because they're either subjective (manual lines), rigid (fixed pivots), or break when price spikes occur. Most importantly, they don't tell you where prices actually spend time, just where they touched briefly.
 The Solution: Lorentzian Distance Clustering 
This indicator introduces a  novel approach  by using  Lorentzian distance  instead of traditional Euclidean distance for clustering. This is groundbreaking for financial data analysis.
Data Points Clustering:   
 🔬 Why Euclidean Distance Fails in Trading 
 Traditional K-means uses Euclidean distance: 
•  Formula:   distance = (price_A - price_B)² 
•  Problem:  Squaring amplifies differences exponentially
•  Real impact:  One 5% price spike has 25x more influence than a 1% move
•  Result:  Clusters get pulled toward outliers, missing real support/resistance zones
 Example scenario: 
 Prices:   ← flash spike
Euclidean: Centroid gets dragged toward 150
Actual S/R zone: Around 100 (where prices actually trade) 
 ⚡ Lorentzian Distance: The Game Changer 
 Our approach uses Lorentzian distance: 
•  Formula:   distance = log(1 + (price_difference)² / σ²) 
•  Breakthrough:  Logarithmic compression keeps outliers in check
•  Real impact:  Large moves still matter, but don't dominate
•  Result:  Clusters focus on where prices actually spend time
 Same example with Lorentzian: 
 Prices:   ← flash spike
Lorentzian: Centroid stays near 100 (real trading zone)
Outlier (150): Acknowledged but not dominant 
 🧠 Adaptive Intelligence 
The  σ parameter  isn't fixed,it's calculated from market disturbance/entropy:
•  High volatility:  σ increases, making algorithm more tolerant of large moves
•  Low volatility:  σ decreases, making algorithm more sensitive to small changes
•  Self-calibrating:  Adapts to any instrument or market condition automatically
 Why this matters:  Traditional methods treat a 2% move the same whether it's in a calm or volatile market. Lorentzian adapts the sensitivity based on current market behavior.
 🎯 Automatic K-Selection (Elbow Method) 
Instead of guessing how many S/R levels to draw, the indicator:
• Tests 2-6 clusters and calculates WCSS (tightness measure)
• Finds the "elbow" - where adding more clusters stops helping much
• Uses sharpness calculation to pick the optimal number automatically
 Result:  Perfect balance between detail and clarity.
 How It Works 
1.  Collect  recent closing prices
2.  Calculate entropy  to adapt to current market volatility
3.  Cluster prices  using Lorentzian K-means algorithm
4.  Auto-select  optimal cluster count via statistical analysis
5.  Draw levels  at cluster centers with deviation bands
 📊 Manual K-Selection Guide (Using WCSS & Sharpness Analysis) 
When you disable auto-selection, use both  WCSS  and  Sharpness  metrics from the analysis table to choose manually:
 What WCSS tells you: 
• Lower WCSS = tighter clusters = better S/R levels
• Higher WCSS = scattered clusters = weaker levels
 What Sharpness tells you: 
• Higher positive values = optimal elbow point = best K choice
• Lower/negative values = poor elbow definition = avoid this K
• Measures the "sharpness" of the WCSS curve drop-off
 Decision strategy using both metrics: 
 K=2: WCSS = 150.42 | Sharpness = -     | Selected = 
K=3: WCSS = 89.15  | Sharpness = 22.04 | Selected = ✓ ← Best choice
K=4: WCSS = 76.23  | Sharpness = 1.89  | Selected = 
K=5: WCSS = 73.91  | Sharpness = 1.43  | Selected =  
 Quick decision rules: 
• Pick K with  highest positive Sharpness  (indicates optimal elbow)
• Confirm with  significant WCSS drop  (30%+ reduction is good)
• Avoid K values with negative or very low Sharpness (<1.0)
• K=3 above shows: Big WCSS drop (41%) + High Sharpness (22.04) = Perfect choice
 Why this works: 
The algorithm finds the "elbow" where adding more clusters stops being useful. High Sharpness pinpoints this elbow mathematically, while WCSS confirms the clustering quality.
Elbow Method Visualization:  
 Traditional clustering problems: 
❌ Price spikes distort results
❌ Fixed parameters don't adapt
❌ Manual tuning is subjective
❌ No way to validate choices
 Lorentzian solution: 
☑️ Outlier-resistant distance metric
☑️ Entropy-based adaptation to volatility
☑️ Automatic optimal K selection
☑️ Statistical validation via WCSS & Sharpness
 Features 
 Visual: 
• Color-coded levels (red=highest resistance, green=lowest support)
• Optional deviation bands showing cluster spread
•  Strength scores on labels:  Each cluster shows a reliability score.
• Higher scores (0.8+) = very strong S/R levels with tight price clustering
• Lower scores (0.6-0.7) = weaker levels, use with caution
• Based on cluster tightness and data point density
• Clean line extensions and labels
 Analytics: 
• WCSS analysis table showing why K was chosen
• Cluster metrics and statistics
• Real-time entropy monitoring
 Control: 
• Auto/manual K selection toggle
• Customizable sample size (20-500 bars)
• Show/hide bands and metrics tables
 The Result 
You get  mathematically validated S/R levels  that focus on where prices actually cluster, not where they randomly spiked. The algorithm adapts to market conditions and removes guesswork from level selection.
 Best for:  Traders who want objective, data-driven S/R levels without manual chart analysis.
 Credits:  This script is for educational purposes and is inspired by the work of @ThinkLogicAI and an amazing mentor @DskyzInvestments . It demonstrates how Lorentzian geometrical concepts can be applied not only in ML classification but also quite elegantly in clustering.
Fractal Support and Resistance [BigBeluga]🔵 OVERVIEW 
The  Fractal Support and Resistance   indicator automatically identifies high-probability support and resistance zones based on repeated fractal touches. When a defined number of fractal highs or lows cluster around the same price zone, the indicator plots a clean horizontal level and shaded zone, helping traders visualize structurally important areas where price may react.
 🔵 CONCEPTS 
 
   Fractal Points:  Swing highs and lows based on user-defined left and right range (length). A valid fractal forms only when the center candle is higher or lower than its neighbors.
  
   Zone Validation:  A level is only confirmed when the price has printed the specified number of fractals (e.g., 3) within a narrow ATR-defined range.
  
   Dynamic Zone Calculation:  The plotted level can be based on the  average  of clustered fractals or on the  extreme value  (min or max), depending on the user’s choice.
  
   Support/Resistance Zones:  Once a zone is validated, a horizontal line and shaded box are drawn and automatically extended into the future until new valid clusters form.
   Auto-Clean & Reactivity:  Each zone persists until replaced by a new fractal cluster, ensuring the chart remains uncluttered and adaptive.
  
 
 🔵 FEATURES 
 
  Detects swing fractals using adjustable left/right range.
  Confirms zones when a defined number of fractals occur near the same price.
  Plots horizontal level and shaded box for visual clarity.
  Choice between average or min/max logic for level calculation.
  Distinct color inputs for support (green) and resistance (orange) zones.
  Adaptive auto-extension keeps valid zones projected into the future.
  Displays optional triangle markers above/below bars where fractals form.
  Clean design optimized for structural S/R analysis.
 
 🔵 HOW TO USE 
 
  Use support zones (from low fractals) to look for  potential long entries or bounce points .
  Use resistance zones (from high fractals) to look for  short setups or rejections .
  Adjust the  Fractals Qty  to make zones more or less strict—e.g., 3 for higher reliability, 2 for quicker responsiveness.
  
  Combine with liquidity indicators or break/retest logic to validate zone strength.
  Toggle between  average  and  min/max  mode to fit your style (average for balance, extremes for aggression).
 
 🔵 CONCLUSION 
 Fractal Support and Resistance   offers a robust way to identify hidden levels that the market respects repeatedly. By requiring multiple fractal confirmations within a zone, it filters out noise and highlights clean structural areas of interest. This tool is ideal for traders who want automatic, adaptive, and reliable S/R levels grounded in raw market structure.
Choch Pattern Levels [BigBeluga]🔵 OVERVIEW 
The  Choch Pattern Levels   indicator automatically detects  Change of Character (CHoCH)  shifts in market structure — crucial moments that often signal early trend reversals or major directional transitions. It plots the structural break level, visualizes the pattern zone with triangle overlays, and tracks delta volume to help traders assess the strength behind each move.
 🔵 CONCEPTS 
 
   CHoCH Pattern:  A bullish CHoCH forms when price breaks a previous swing high after a swing low, while a bearish CHoCH appears when price breaks a swing low after a prior swing high.
  
   Break Level Mapping:  The indicator identifies the highest or lowest point between the pivot and the breakout, marking it with a clean horizontal level where price often reacts.
  
   Delta Volume Tracking:  Net bullish or bearish volume is accumulated between the pivot and the breakout, revealing the momentum and conviction behind each CHoCH.
  
   Chart Clean-Up:  If price later closes through the CHoCH level, the zone is automatically removed to maintain clarity and focus on active setups only.
 
 🔵 FEATURES 
 
  Automatic CHoCH pattern detection using pivot-based logic.
  Triangle shapes show structure break: pivot → breakout → internal high/low.
  
  
  Horizontal level marks the structural zone with a ◯ symbol.
  
  Optional delta volume label with directional sign (+/−).
  Green visuals for bullish CHoCHs, red for bearish.
  Fully auto-cleaning invalidated levels to reduce clutter.
  Clean organization of all lines, labels, and overlays.
  User-defined  Length  input to adjust pivot sensitivity.
  
 
 🔵 HOW TO USE 
 
  Use  CHoCH levels  as early trend reversal zones or confirmation signals.
  Treat  bullish CHoCHs  as support zones,  bearish CHoCHs  as resistance.
  Look for high delta volume to validate the strength behind each CHoCH.
  Combine with other BigBeluga tools like supply/demand, FVGs, or liquidity maps for confluence.
  Adjust pivot  Length  based on your strategy — shorter for intraday, longer for swing trading.
 
 🔵 CONCLUSION 
 Choch Pattern Levels   highlights key structural breaks that can mark the start of new trends. By combining precise break detection with volume analytics and automatic cleanup, it provides actionable insights into the true intent behind price moves — giving traders a clean edge in spotting early reversals and key reaction zones.
Smart MTF S/R Levels[BullByte]
 Smart MTF S/R Levels   
 Introduction & Motivation   
Support and Resistance (S/R) levels are the backbone of technical analysis. However, most traders face two major challenges:  
 Manual S/R Marking:  Drawing S/R levels by hand is time-consuming, subjective, and often inconsistent.  
 Multi-Timeframe Blind Spots:  Key S/R levels from higher or lower timeframes are often missed, leading to surprise reversals or missed opportunities.  
 Smart MTF S/R Levels  was created to solve these problems. It is a fully automated, multi-timeframe, multi-method S/R detection and visualization tool, designed to give traders a complete, objective, and actionable view of the market’s most important price zones.  
 What Makes This Indicator Unique?   
 Multi-Timeframe Analysis:  Simultaneously analyzes up to three user-selected timeframes, ensuring you never miss a critical S/R level from any timeframe.  
 Multi-Method Confluence:  Integrates several respected S/R detection methods—Swings, Pivots, Fibonacci, Order Blocks, and Volume Profile—into a single, unified system.  
 Zone Clustering:  Automatically merges nearby levels into “zones” to reduce clutter and highlight areas of true market consensus.  
 Confluence Scoring:  Each zone is scored by the number of methods and timeframes in agreement, helping you instantly spot the most significant S/R areas.  
 Reaction Counting:  Tracks how many times price has recently interacted with each zone, providing a real-world measure of its importance.  
 Customizable Dashboard:  A real-time, on-chart table summarizes all key S/R zones, their origins, confluence, and proximity to price.  
 Smart Alerts:  Get notified when price approaches high-confluence zones, so you never miss a critical trading opportunity.  
 Why Should a Trader Use This?   
 Objectivity:  Removes subjectivity from S/R analysis by using algorithmic detection and clustering.  
 Efficiency:  Saves hours of manual charting and reduces analysis fatigue.  
 Comprehensiveness:  Ensures you are always aware of the most relevant S/R zones, regardless of your trading timeframe.  
 Actionability:  The dashboard and alerts make it easy to act on the most important levels, improving trade timing and risk management.  
 Adaptability:  Works for all asset classes (stocks, forex, crypto, futures) and all trading styles (scalping, swing, position).  
 The Gap This Indicator Fills   
Most S/R indicators focus on a single method or timeframe, leading to incomplete analysis. Manual S/R marking is error-prone and inconsistent. This indicator fills the gap by:  
 Automating S/R detection  across multiple timeframes and methods  
 Objectively scoring and ranking zones  by confluence and reaction  
 Presenting all this information  in a clear, actionable dashboard  
 How Does It Work? (Technical Logic)   
 1. Level Detection   
For each selected timeframe, the script detects S/R levels using:  
 SW (Swing High/Low):  Recent price pivots where reversals occurred.  
 Pivot:  Classic floor trader pivots (P, S1, R1).  
 Fib (Fibonacci):  Key retracement levels (0.236, 0.382, 0.5, 0.618, 0.786) over the last 50 bars.  
 Bull OB / Bear OB:  Institutional price zones based on bullish/bearish engulfing patterns.  
 VWAP / POC:  Volume Weighted Average Price and Point of Control over the last 50 bars.  
 2. Level Clustering   
Levels within a user-defined % distance are merged into a single “zone.”  
Each zone records which methods and timeframes contributed to it.  
 3. Confluence & Reaction Scoring   
 Confluence:  The number of unique methods/timeframes in agreement for a zone.  
 Reactions:  The number of times price has touched or reversed at the zone in the recent past (user-defined lookback).  
 4. Filtering & Sorting   
Only zones within a user-defined % of the current price are shown (to focus on actionable areas).  
Zones can be sorted by confluence, reaction count, or proximity to price.  
 5. Visualization   
 Zones:  Shaded boxes on the chart (green for support, red for resistance, blue for mixed).  
 Lines:  Mark the exact level of each zone.  
 Labels:  Show level, methods by timeframe (e.g., 15m (3 SW), 30m (1 VWAP)), and (if applicable) Fibonacci ratios.  
 Dashboard Table:  Lists all nearby zones with full details.  
 6. Alerts   
Optional alerts trigger when price approaches a zone with confluence above a user-set threshold.  
 Inputs & Customization (Explained for All Users)   
 Show Timeframe 1/2/3:  Enable/disable analysis for each timeframe (e.g., 15m, 30m, 1h).  
 Show Swings/Pivots/Fibonacci/Order Blocks/Volume Profile:  Select which S/R methods to include.  
 Show levels within X% of price:  Only display zones near the current price (default: 3%).  
 How many swing highs/lows to show:  Number of recent swings to include (default: 3).  
 Cluster levels within X%:  Merge levels close together into a single zone (default: 0.25%).  
 Show Top N Zones:  Limit the number of zones displayed (default: 8).  
 Bars to check for reactions:  How far back to count price reactions (default: 100).  
 Sort Zones By:  Choose how to rank zones in the dashboard (Confluence, Reactions, Distance).  
 Alert if Confluence >=:  Set the minimum confluence score for alerts (default: 3).  
 Zone Box Width/Line Length/Label Offset:  Control the appearance of zones and labels.  
 Dashboard Size/Location:  Customize the dashboard table.  
 How to Read the Output   
 Shaded Boxes:  Represent S/R zones. The color indicates type (green = support, red = resistance, blue = mixed).  
 Lines:  Mark the precise level of each zone.  
 Labels:  Show the level, methods by timeframe (e.g., 15m (3 SW), 30m (1 VWAP)), and (if applicable) Fibonacci ratios.  
 Dashboard Table:  Columns include:  
 Level:  Price of the zone  
 Methods (by TF):  Which S/R methods and how many, per timeframe (see abbreviation key below)  
 Type:  Support, Resistance, or Mixed  
 Confl.:  Confluence score (higher = more significant)  
 React.:  Number of recent price reactions  
 Dist %:  Distance from current price (in %)  
 Abbreviations Used   
 SW =  Swing High/Low (recent price pivots where reversals occurred)  
 Fib =  Fibonacci Level (key retracement levels such as 0.236, 0.382, 0.5, 0.618, 0.786)  
 VWAP =  Volume Weighted Average Price (price level weighted by volume)  
 POC =  Point of Control (price level with the highest traded volume)  
 Bull OB =  Bullish Order Block (institutional support zone from bullish price action)  
 Bear OB =  Bearish Order Block (institutional resistance zone from bearish price action)  
 Pivot =  Pivot Point (classic floor trader pivots: P, S1, R1)  
These abbreviations appear in the dashboard and chart labels for clarity.  
 Example: How to Read the Dashboard and Labels (from the chart above)   
Suppose you are trading BTCUSDT on a 15-minute chart. The dashboard at the top right shows several S/R zones, each with a breakdown of which timeframes and methods contributed to their detection:  
  
 Resistance zone at 119257.11:   
The dashboard shows:  
5m (1 SW), 15m (2 SW), 1h (3 SW)  
This means the level 119257.11 was identified as a resistance zone by one swing high (SW) on the 5-minute timeframe, two swing highs on the 15-minute timeframe, and three swing highs on the 1-hour timeframe. The confluence score is 6 (total number of method/timeframe hits), and there has been 1 recent price reaction at this level. This suggests 119257.11 is a strong resistance zone, confirmed by multiple swing highs across all selected timeframes.  
 Mixed zone at 118767.97:   
The dashboard shows:  
5m (2 SW), 15m (2 SW)  
This means the level 118767.97 was identified by two swing points on both the 5-minute and 15-minute timeframes. The confluence score is 4, and there have been 19 recent price reactions at this level, indicating it is a highly reactive zone.  
 Support zone at 117411.35:   
The dashboard shows:  
5m (2 SW), 1h (2 SW)  
This means the level 117411.35 was identified as a support zone by two swing lows on the 5-minute timeframe and two swing lows on the 1-hour timeframe. The confluence score is 4, and there have been 2 recent price reactions at this level.  
 Mixed zone at 118291.45:   
The dashboard shows:  
15m (1 SW, 1 VWAP), 5m (1 VWAP), 1h (1 VWAP)  
This means the level 118291.45 was identified by a swing and VWAP on the 15-minute timeframe, and by VWAP on both the 5-minute and 1-hour timeframes. The confluence score is 4, and there have been 12 recent price reactions at this level.  
 Support zone at 117103.10:   
The dashboard shows:  
15m (1 SW), 1h (1 SW)  
This means the level 117103.10 was identified by a single swing low on both the 15-minute and 1-hour timeframes. The confluence score is 2, and there have been no recent price reactions at this level.  
 Resistance zone at 117899.33:   
The dashboard shows:  
5m (1 SW)  
This means the level 117899.33 was identified by a single swing high on the 5-minute timeframe. The confluence score is 1, and there have been no recent price reactions at this level.  
 How to use this:   
Zones with higher confluence (more methods and timeframes in agreement) and more recent reactions are generally more significant. For example, the resistance at 119257.11 is much stronger than the resistance at 117899.33, and the mixed zone at 118767.97 has shown the most recent price reactions, making it a key area to watch for potential reversals or breakouts.  
 Tip:   
“SW” stands for Swing High/Low, and “VWAP” stands for Volume Weighted Average Price.  
The format 15m (2 SW) means two swing points were detected on the 15-minute timeframe.  
 Best Practices & Recommendations   
 Use with Other Tools:  This indicator is most powerful when combined with your own price action analysis and risk management.  
 Adjust Settings:  Experiment with timeframes, clustering, and methods to suit your trading style and the asset’s volatility.  
 Watch for High Confluence:  Zones with higher confluence and more reactions are generally more significant.  
 Limitations   
 No Future Prediction:  The indicator does not predict future price movement; it highlights areas where price is statistically more likely to react.  
 Not a Standalone System:  Should be used as part of a broader trading plan.  
 Historical Data:  Reaction counts are based on historical price action and may not always repeat.  
 Disclaimer   
This indicator is a technical analysis tool and does not constitute financial advice or a recommendation to buy or sell any asset. Trading involves risk, and past performance is not indicative of future results. Always use proper risk management and consult a financial advisor if needed.  
VWAP Volume Profile [BigBeluga]🔵 OVERVIEW 
 VWAP Volume Profile   is an advanced hybrid of the VWAP and volume profile concepts. It visualizes how volume accumulates relative to VWAP movement—separating rising (+VWAP) and declining (−VWAP) activity into two mirrored horizontal profiles. It highlights the dominant price bins (POCs) where volume peaked during each directional phase, helping traders spot hidden accumulation or distribution zones.
 🔵 CONCEPTS 
 
   VWAP-Driven Profiling:  Unlike standard volume profiles, this tool segments volume based on VWAP movement—accumulating positive or negative volume depending on VWAP slope.
  
   Dual-Sided Profiles:  Profiles expand horizontally to the right of price. Separate bins show rising (+) and falling (−) VWAP volume.
  
   Bin Logic:  Volume is accumulated into defined horizontal bins based on VWAP’s position relative to price ranges.
  
  
   Gradient Coloring:  Volume bars are colored with a dynamic gradient to emphasize intensity and direction.
   POC Highlighting:  The highest-volume bin in each profile type (+/-) is marked with a transparent box and label.
  
   Contextual VWAP Line:  VWAP is plotted and dynamically colored (green = rising, orange = falling) for instant trend context.
   Candle Overlay:  Price candles are recolored to match the VWAP slope for full visual integration.
  
 
 🔵 FEATURES 
 
  Dual-sided horizontal volume profiles based on VWAP slope.
  Supports rising VWAP  , falling VWAP  , or both simultaneously.
  Customizable number of bins and lookback period.
  Dynamically colored VWAP line to show rising/falling bias.
  POC detection and labeling with volume values for +VWAP and −VWAP.
  Candlesticks are recolored to match VWAP bias for intuitive momentum tracking.
  Optional background boxes with customizable styling.
  Adaptive volume scaling to normalize bar length across markets.
 
 🔵 HOW TO USE 
 
  Use POC zones to identify high-volume consolidation areas and potential support/resistance levels.
  
  Watch for shifts in VWAP direction and observe how volume builds differently during uptrends and downtrends.
  Use the gradient profile shape to detect accumulation (widening volume below price) or distribution (above price).
  Use candle coloring for real-time confirmation of VWAP bias.
  Adjust the profile period or bin count to fit your trading style (e.g., intraday scalping or swing trading).
 
 🔵 CONCLUSION 
 VWAP Volume Profile   merges two essential concepts—volume and VWAP—into a single, high-precision tool. By visualizing how volume behaves in relation to VWAP movement, it uncovers hidden dynamics often missed by traditional profiles. Perfect for intraday and swing traders who want a more nuanced read on market structure, trend strength, and volume flow.
Ultimate Market Structure [Alpha Extract]Ultimate Market Structure  
A comprehensive market structure analysis tool that combines advanced swing point detection, imbalance zone identification, and intelligent break analysis to identify high-probability trading opportunities.Utilizing a sophisticated trend scoring system, this indicator classifies market conditions and provides clear signals for structure breaks, directional changes, and fair value gap detection with institutional-grade precision.
🔶  Advanced Swing Point Detection 
 
 Identifies pivot highs and lows using configurable lookback periods with optional close-based analysis for cleaner signals. The system automatically labels swing points as Higher Highs (HH), Lower Highs (LH), Higher Lows (HL), and Lower Lows (LL) while providing advanced classifications including "rising_high", "falling_high", "rising_low", "falling_low", "peak_high", and "valley_low" for nuanced market analysis.
 
 swingHighPrice = useClosesForStructure ? ta.pivothigh(close, swingLength, swingLength) : ta.pivothigh(high, swingLength, swingLength)
swingLowPrice = useClosesForStructure ? ta.pivotlow(close, swingLength, swingLength) : ta.pivotlow(low, swingLength, swingLength)
classification = classifyStructurePoint(structureHighPrice, upperStructure, true)
significance = calculateSignificance(structureHighPrice, upperStructure, true) 
🔶  Significance Scoring System 
 
 Each structure point receives a significance level on a 1-5 scale based on its distance from previous points, helping prioritize the most important levels. This intelligent scoring system ensures traders focus on the most meaningful structure breaks while filtering out minor noise.
 
🔶  Comprehensive Trend Analysis 
 
 Calculates momentum, strength, direction, and confidence levels using volatility-normalized price changes and multi-timeframe correlation. The system provides real-time trend state tracking with bullish (+1), bearish (-1), or neutral (0) direction assessment and 0-100 confidence scoring.
 
 // Calculate trend momentum using rate of change and volatility
calculateTrendMomentum(lookback) =>
    priceChange = (close - close ) / close  * 100
    avgVolatility = ta.atr(lookback) / close * 100
    momentum = priceChange / (avgVolatility + 0.0001)
    momentum
// Calculate trend strength using multiple timeframe correlation
calculateTrendStrength(shortPeriod, longPeriod) =>
    shortMA = ta.sma(close, shortPeriod)
    longMA = ta.sma(close, longPeriod)
    separation = math.abs(shortMA - longMA) / longMA * 100
    strength = separation * slopeAlignment 
 ❓How It Works 
🔶  Imbalance Zone Detection 
 
 Identifies Fair Value Gaps (FVGs) between consecutive candles where price gaps create unfilled areas. These zones are displayed as semi-transparent boxes with optional center line mitigation tracking, highlighting potential support and resistance levels where institutional players often react.
 
 // Detect Fair Value Gaps
detectPriceImbalance() =>
    currentHigh = high
    currentLow = low
    refHigh = high 
    refLow = low 
    
    if currentOpen > currentClose
        if currentHigh - refLow < 0
            upperBound = currentClose - (currentClose - refLow)
            lowerBound = currentClose - (currentClose - currentHigh)
            centerPoint = (upperBound + lowerBound) / 2
            
            newZone = ImbalanceZone.new(
                zoneBox = box.new(bar_index, upperBound, rightEdge, lowerBound, 
                                  bgcolor=bullishImbalanceColor, border_color=hiddenColor)
            ) 
🔶  Structure Break Analysis 
 
 Determines Break of Structure (BOS) for trend continuation and Directional Change (DC) for trend reversals with advanced classification as "continuation", "reversal", or "neutral". The system compares pre-trend and post-trend states for each break, providing comprehensive trend change momentum analysis.
 
  
🔶  Intelligent Zone Management 
 
 Features partial mitigation tracking when price enters but doesn't fully fill zones, with automatic zone boundary adjustment during partial fills. Smart array management keeps only recent structure points for optimal performance while preventing duplicate signals from the same level.
 
🔶 Liquidity Zone Detection 
 
 Automatically identifies potential liquidity zones at key structure points for institutional trading analysis. The system tracks broken structure points and provides adaptive zone extension with configurable time-based limits for imbalance areas.
 
🔶  Visual Structure Mapping 
 
 Provides clear visual indicators including swing labels with color-coded significance levels, dashed lines connecting break points with BOS/DC labels, and break signals for continuation and reversal patterns. The adaptive zones feature smart management with automatic mitigation tracking.
 
🔶  Market Structure Interpretation 
 
 HH/HL patterns indicate bullish market structure with trend continuation likelihood, while LH/LL patterns signal bearish structure with downtrend continuation expected. BOS signals represent structure breaks in trend direction for continuation opportunities, while DC signals warn of potential reversals.
 
  
🔶  Performance Optimization 
 
 Automatic cleanup of old structure points (keeps last 8 points), recent break tracking (keeps last 5 break events), and efficient array management ensure smooth performance across all timeframes and market conditions.
 
 Why Choose Ultimate Market Structure  ? 
This indicator provides traders with institutional-grade market structure analysis, combining multiple analytical approaches into one comprehensive tool. By identifying key structure levels, imbalance zones, and break patterns with advanced significance scoring, it helps traders understand market dynamics and position themselves for high-probability trade setups in alignment with smart money concepts. The sophisticated trend scoring system and intelligent zone management make it an essential tool for any serious trader looking to decode market structure with precision and confidence.
Active PMI Support/Resistance Levels [EdgeTerminal]The PMI Support & Resistance indicator revolutionizes traditional technical analysis by using Pointwise Mutual Information (PMI) - a statistical measure from information theory - to objectively identify support and resistance levels. Unlike conventional methods that rely on visual pattern recognition, this indicator provides mathematically rigorous, quantifiable evidence of price levels where significant market activity occurs.
- The Mathematical Foundation: Pointwise Mutual Information
Pointwise Mutual Information measures how much more likely two events are to occur together compared to if they were statistically independent. In our context:
 
 Event A: Volume spikes occurring (high trading activity)
 Event B: Price being at specific levels
 
The PMI formula calculates: PMI = log(P(A,B) / (P(A) × P(B)))
Where:
 
 P(A,B) = Probability of volume spikes occurring at specific price levels
 P(A) = Probability of volume spikes occurring anywhere
 P(B) = Probability of price being at specific levels
 
High PMI scores indicate that volume spikes and certain price levels co-occur much more frequently than random chance would predict, revealing genuine support and resistance zones.
- Why PMI Outperforms Traditional Methods
Subjective interpretation: What one trader sees as significant, another might ignore
Confirmation bias: Tendency to see patterns that confirm existing beliefs
Inconsistent criteria: No standardized definition of "significant" volume or price action
Static analysis: Doesn't adapt to changing market conditions
No strength measurement: Can't quantify how "strong" a level truly is
PMI Advantages:
✅ Objective & Quantifiable: Mathematical proof of significance, not visual guesswork
✅ Statistical Rigor: Levels backed by information theory and probability
✅ Strength Scoring: PMI scores rank levels by statistical significance
✅ Adaptive: Automatically adjusts to different market volatility regimes
✅ Eliminates Bias: Computer-calculated, removing human interpretation errors
✅ Market Structure Aware: Reveals the underlying order flow concentrations
- How It Works
Data Processing Pipeline:
 
 Volume Analysis: Identifies volume spikes using configurable thresholds
 Price Binning: Divides price range into discrete levels for analysis
 Co-occurrence Calculation: Measures how often volume spikes happen at each price level
 PMI Computation: Calculates statistical significance for each price level
 Level Filtering: Shows only levels exceeding minimum PMI thresholds
 Dynamic Updates: Refreshes levels periodically while maintaining historical traces
 
Visual System:
 
 Current Levels: Bright, thick lines with PMI scores - your actionable levels
 Historical Traces: Faded previous levels showing market structure evolution
 Strength Tiers: Line styles indicate PMI strength (solid/dashed/dotted)
 Color Coding: Green for support, red for resistance
 Info Table: Real-time display of strongest levels with scores
 
- Indicator Settings:
 Core Parameters 
 Lookback Period (Default: 200) 
Lower (50-100): More responsive to recent price action, catches short-term levels
Higher (300-500): Focuses on major historical levels, more stable but less responsive
Best for: Day trading (100-150), Swing trading (200-300), Position trading (400-500)
 Volume Spike Threshold (Default: 1.5) 
Lower (1.2-1.4): More sensitive, catches smaller volume increases, more levels detected
Higher (2.0-3.0): Only major volume surges count, fewer but stronger signals
Market dependent: High-volume stocks may need higher thresholds (2.0+), low-volume stocks lower (1.2-1.3)
 Price Bins (Default: 50) 
Lower (20-30): Broader price zones, less precise but captures wider areas
Higher (70-100): More granular levels, precise but may be overly specific
Volatility dependent: High volatility assets benefit from more bins (70+)
 Minimum PMI Score (Default: 0.5) 
Lower (0.2-0.4): Shows more levels including weaker ones, comprehensive view
Higher (1.0-2.0): Only statistically strong levels, cleaner chart
Progressive filtering: Start with 0.5, increase if too cluttered
 Max Levels to Show (Default: 8) 
Fewer (3-5): Clean chart focusing on strongest levels only
More (10-15): Comprehensive view but may clutter chart
Strategy dependent: Scalpers prefer fewer (3-5), swing traders more (8-12)
 Historical Tracking Settings 
Update Frequency (Default: 20 bars)
Lower (5-10): More frequent updates, captures rapid market changes
Higher (50-100): Less frequent updates, focuses on major structural shifts
Timeframe scaling: 1-minute charts need lower frequency (5-10), daily charts higher (50+)
 Show Historical Levels (Default: True) 
Enables the "breadcrumb trail" effect showing evolution of support/resistance
Disable for cleaner charts focusing only on current levels
 Max Historical Marks (Default: 50) 
Lower (20-30): Less memory usage, shorter history
Higher (100-200): Longer historical context but more resource intensive
 Fade Strength (Default: 0.8) 
Lower (0.5-0.6): Historical levels more visible
Higher (0.9-0.95): Historical levels very subtle
 Visual Settings 
Support/Resistance Colors: Choose colors that contrast well with your chart theme Line Width: Thicker lines (3-4) for better visibility on busy charts Show PMI Scores: Toggle labels showing statistical strength Label Size: Adjust based on screen resolution and chart zoom level
- Most Effective Usage Strategies
For Day Trading:
Setup: Lookback 100-150, Volume Threshold 1.8-2.2, Update Frequency 10-15
Use PMI levels as bounce/rejection points for scalp entries
Higher PMI scores (>1.5) offer better probability setups
Watch for volume spike confirmations at levels
For Swing Trading:
Setup: Lookback 200-300, Volume Threshold 1.5-2.0, Update Frequency 20-30
Enter on pullbacks to high PMI support levels
Target next resistance level with PMI score >1.0
Hold through minor levels, exit at major PMI levels
For Position Trading:
Setup: Lookback 400-500, Volume Threshold 2.0+, Update Frequency 50+
Focus on PMI scores >2.0 for major structural levels
Use for portfolio entry/exit decisions
Combine with fundamental analysis for timing
- Trading Applications:
 Entry Strategies: 
 PMI Bounce Trades 
Price approaches high PMI support level (>1.0)
Wait for volume spike confirmation (orange triangles)
Enter long on bullish price action at the level
Stop loss just below the PMI level
Target: Next PMI resistance level
 PMI Breakout Trades 
Price consolidates near high PMI level
Volume increases (watch for orange triangles)
Enter on decisive break with volume
Previous resistance becomes new support
Target: Next major PMI level
 PMI Rejection Trades 
Price approaches PMI resistance with momentum
Watch for rejection signals and volume spikes
Enter short on failure to break through
Stop above the PMI level
Target: Next PMI support level
 Risk Management: 
 Stop Loss Placement 
Place stops 0.1-0.5% beyond PMI levels (adjust for volatility)
Higher PMI scores warrant tighter stops
Use ATR-based stops for volatile assets
 Position Sizing 
Larger positions at PMI levels >2.0 (highest conviction)
Smaller positions at PMI levels 0.5-1.0 (lower conviction)
Scale out at multiple PMI targets
- Key Warning Signs & What to Watch For
 Red Flags: 
🚨 Very Low PMI Scores (<0.3): Weak statistical significance, avoid trading
 🚨 No Volume Confirmation: PMI level without recent volume spikes may be stale
 🚨 Overcrowded Levels: Too many levels close together suggests poor parameter tuning
 🚨 Outdated Levels: Historical traces are reference only, not tradeable
 Optimization Tips: 
✅ Regular Recalibration: Adjust parameters monthly based on market regime changes
 ✅ Volume Context: Always check for recent volume activity at PMI levels
 ✅ Multiple Timeframes: Confirm PMI levels across different timeframes
 ✅ Market Conditions: Higher thresholds during high volatility periods
Interpreting PMI Scores
PMI Score Ranges:
 
 0.5-1.0: Moderate statistical significance, proceed with caution
 1.0-1.5: Good significance, reliable for most trading strategies
 1.5-2.0: Strong significance, high-confidence trade setups
 2.0+: Very strong significance, institutional-grade levels
 
Historical Context: The historical trace system shows how support and resistance evolve over time. When current levels align with multiple historical traces, it indicates persistent market memory at those prices, significantly increasing the level's reliability.






















