OPEN-SOURCE SCRIPT
Pivot S/R with Volatility Filter

## *๐ Indicator Purpose*
This indicator identifies *key support/resistance levels* using pivot points while also:
โ Detecting *high-volume liquidity traps* (stop hunts)
โ Filtering insignificant pivots via *ATR (Average True Range) volatility*
โ Tracking *test counts and breakouts* to measure level strength
---
## *โ SETTINGS โ Detailed Breakdown*
### *1๏ธโฃ โ General Settings*
#### *๐น Pivot Length*
- *Purpose:* Determines how many bars to analyze when identifying pivots.
- *Usage:*
- *Low values (5-20):* More pivots, better for scalping.
- *High values (50-200):* Fewer but stronger levels for swing trading.
- *Example:*
- Pivot Length = 50 โ Only the most significant highs/lows over 50 bars are marked.
#### *๐น Test Threshold (Max Test Count)*
- *Purpose:* Sets how many times a level can be tested before being invalidated.
- *Example:*
- Test Threshold = 3 โ After 3 tests, the level is ignored (likely to break).
#### *๐น Zone Range*
- *Purpose:* Creates a price buffer around pivots (ยฑ0.001 by default).
- *Why?* Markets often respect "zones" rather than exact prices.
---
### *2๏ธโฃ โ Volatility Filter (ATR)*
#### *๐น ATR Period*
- *Purpose:* Smoothing period for Average True Range calculation.
- *Default:* 14 (standard for volatility measurement).
#### *๐น ATR Multiplier (Min Move)*
- *Purpose:* Requires pivots to show *meaningful price movement*.
- *Formula:* Min Move = ATR ร Multiplier
- *Example:*
- ATR = 10 pips, Multiplier = 1.5 โ Only pivots with *15+ pip swings* are valid.
#### *๐น Show ATR Filter Info*
- Displays current ATR and minimum move requirements on the chart.
---
### *3๏ธโฃ โ Volume Analysis*
#### *๐น Volume Change Threshold (%)*
- *Purpose:* Filters for *unusual volume spikes* (institutional activity).
- *Example:*
- Threshold = 1.2 โ Requires *120% of average volume* to confirm signals.
#### *๐น Volume MA Period*
- *Purpose:* Lookback period for "normal" volume calculation.
---
### *4๏ธโฃ โ Wick Analysis*
#### *๐น Wick Length Threshold (Ratio)*
- *Purpose:* Ensures rejection candles have *long wicks* (strong reversals).
- *Formula:* Wick Ratio = (Upper Wick + Lower Wick) / Candle Range
- *Example:*
- Threshold = 0.6 โ 60% of the candle must be wicks.
#### *๐น Min Wick Size (ATR %)*
- *Purpose:* Filters out small wicks in volatile markets.
- *Example:*
- ATR = 20 pips, MinWickSize = 1% โ Wicks under *0.2 pips* are ignored.
---
### *5๏ธโฃ โ Display Settings*
- *Show Zones:* Toggles support/resistance shaded areas.
- *Show Traps:* Highlights liquidity traps (โฒ/โผ symbols).
- *Show Tests:* Displays how many times levels were tested.
- *Zone Transparency:* Adjusts opacity of zones.
---
## *๐ฏ Practical Use Cases*
### *1๏ธโฃ Liquidity Trap Detection*
- *Scenario:* Price spikes *above resistance* then reverses sharply.
- *Requirements:*
- Long wick (Wick Ratio > 0.6)
- High volume (Volume > Threshold)
- *Outcome:* *Short Trap* signal (โผ) appears.
### *2๏ธโฃ Strong Support Level*
- *Scenario:* Price bounces *3 times* from the same level.
- *Indicator Action:*
- Labels the level with test count (3/5 = 3 tests out of max 5).
- Turns *red* if broken (Break Count > 0).
Deep Dive: How This Indicator Works*
This indicator combines *four professional trading concepts* into one powerful tool:
1. *Classic Pivot Point Theory*
- Identifies swing highs/lows where price previously reversed
- Unlike basic pivot indicators, ours uses *confirmed pivots only* (filtered by ATR)
2. *Volume-Weighted Validation*
- Requires unusual trading volume to confirm levels
- Filters out "phantom" levels with low participation
3. *ATR Volatility Filtering*
- Eliminates insignificant price swings in choppy markets
- Ensures only meaningful levels are plotted
4. *Liquidity Trap Detection*
- Spots institutional stop hunts where markets fake out traders
- Uses wick analysis + volume spikes for high-probability signals
---
Deep Dive: How This Indicator Works*
This indicator combines *four professional trading concepts* into one powerful tool:
1. *Classic Pivot Point Theory*
- Identifies swing highs/lows where price previously reversed
- Unlike basic pivot indicators, ours uses *confirmed pivots only* (filtered by ATR)
2. *Volume-Weighted Validation*
- Requires unusual trading volume to confirm levels
- Filters out "phantom" levels with low participation
3. *ATR Volatility Filtering*
- Eliminates insignificant price swings in choppy markets
- Ensures only meaningful levels are plotted
4. *Liquidity Trap Detection*
- Spots institutional stop hunts where markets fake out traders
- Uses wick analysis + volume spikes for high-probability signals
---
## *๐ Parameter Encyclopedia (Expanded)*
### *1๏ธโฃ Pivot Engine Settings*
#### *Pivot Length (50)*
- *What It Does:*
Determines how many bars to analyze when searching for swing highs/lows.
- *Professional Adjustment Guide:*
| Trading Style | Recommended Value | Why? |
|--------------|------------------|------|
| Scalping | 10-20 | Captures short-term levels |
| Day Trading | 30-50 | Balanced approach |
| Swing Trading| 50-200 | Focuses on major levels |
- *Real Market Example:*
On NASDAQ 5-minute chart:
- Length=20: Identifies levels holding for ~2 hours
- Length=50: Finds levels respected for entire trading day
#### *Test Threshold (5)*
- *Advanced Insight:*
Institutions often test levels 3-5 times before breaking them. This setting mimics the "probe and push" strategy used by smart money.
- *Psychology Behind It:*
Retail traders typically give up after 2-3 tests, while institutions keep testing until stops are run.
---
### *2๏ธโฃ Volatility Filter System*
#### *ATR Multiplier (1.0)*
- *Professional Formula:*
Minimum Valid Swing = ATR(14) ร Multiplier
- *Market-Specific Recommendations:*
| Market Type | Optimal Multiplier |
|------------------|--------------------|
| Forex Majors | 0.8-1.2 |
| Crypto (BTC/ETH) | 1.5-2.5 |
| SP500 Stocks | 1.0-1.5 |
- *Why It Matters:*
In EUR/USD (ATR=10 pips):
- Multiplier=1.0 โ Requires 10 pip swings
- Multiplier=1.5 โ Requires 15 pip swings (fewer but higher quality levels)
---
### *3๏ธโฃ Volume Confirmation System*
#### *Volume Threshold (1.2)*
- *Institutional Benchmark:*
- 1.2x = Moderate institutional interest
- 1.5x+ = Strong smart money activity
- *Volume Spike Case Study:*
*Before Apple Earnings:*
- Normal volume: 2M shares
- Spike threshold (1.2): 2.4M shares
- Actual volume: 3.1M shares โ STRONG confirmation
---
### *4๏ธโฃ Liquidity Trap Detection*
#### *Wick Analysis System*
- *Two-Filter Verification:*
1. *Wick Ratio (0.6):*
- Ensures majority of candle shows rejection
- Formula: (UpperWick + LowerWick) / Total Range > 0.6
2. *Min Wick Size (1% ATR):*
- Prevents false signals in flat markets
- Example: ATR=20 pips โ Min wick=0.2 pips
- *Trap Identification Flowchart:*
Price Enters Zone โ
Spikes Beyond Level โ
Shows Long Wick โ
Volume > Threshold โ
TRAP CONFIRMED
---
## *๐ก Master-Level Usage Techniques*
### *Institutional Order Flow Analysis*
1. *Step 1:* Identify pivot levels with โฅ3 tests
2. *Step 2:* Watch for volume contraction near levels
3. *Step 3:* Enter when trap signal appears with:
- Wick > 2รATR
- Volume > 1.5ร average
### *Multi-Timeframe Confirmation*
1. *Higher TF:* Find weekly/monthly pivots
2. *Lower TF:* Use this indicator for precise entries
3. *Example:*
- Weekly pivot at $180
- 4H shows liquidity trap โ High-probability reversal
---
## *โ Critical Mistakes to Avoid*
1. *Using Default Settings Everywhere*
- Crude oil needs higher ATR multiplier than bonds
2. *Ignoring Trap Context*
- Traps work best at:
- All-time highs/lows
- Major psychological numbers (00/50 levels)
3. *Overlooking Cumulative Volume*
- Check if volume is building over multiple tests
This indicator identifies *key support/resistance levels* using pivot points while also:
โ Detecting *high-volume liquidity traps* (stop hunts)
โ Filtering insignificant pivots via *ATR (Average True Range) volatility*
โ Tracking *test counts and breakouts* to measure level strength
---
## *โ SETTINGS โ Detailed Breakdown*
### *1๏ธโฃ โ General Settings*
#### *๐น Pivot Length*
- *Purpose:* Determines how many bars to analyze when identifying pivots.
- *Usage:*
- *Low values (5-20):* More pivots, better for scalping.
- *High values (50-200):* Fewer but stronger levels for swing trading.
- *Example:*
- Pivot Length = 50 โ Only the most significant highs/lows over 50 bars are marked.
#### *๐น Test Threshold (Max Test Count)*
- *Purpose:* Sets how many times a level can be tested before being invalidated.
- *Example:*
- Test Threshold = 3 โ After 3 tests, the level is ignored (likely to break).
#### *๐น Zone Range*
- *Purpose:* Creates a price buffer around pivots (ยฑ0.001 by default).
- *Why?* Markets often respect "zones" rather than exact prices.
---
### *2๏ธโฃ โ Volatility Filter (ATR)*
#### *๐น ATR Period*
- *Purpose:* Smoothing period for Average True Range calculation.
- *Default:* 14 (standard for volatility measurement).
#### *๐น ATR Multiplier (Min Move)*
- *Purpose:* Requires pivots to show *meaningful price movement*.
- *Formula:* Min Move = ATR ร Multiplier
- *Example:*
- ATR = 10 pips, Multiplier = 1.5 โ Only pivots with *15+ pip swings* are valid.
#### *๐น Show ATR Filter Info*
- Displays current ATR and minimum move requirements on the chart.
---
### *3๏ธโฃ โ Volume Analysis*
#### *๐น Volume Change Threshold (%)*
- *Purpose:* Filters for *unusual volume spikes* (institutional activity).
- *Example:*
- Threshold = 1.2 โ Requires *120% of average volume* to confirm signals.
#### *๐น Volume MA Period*
- *Purpose:* Lookback period for "normal" volume calculation.
---
### *4๏ธโฃ โ Wick Analysis*
#### *๐น Wick Length Threshold (Ratio)*
- *Purpose:* Ensures rejection candles have *long wicks* (strong reversals).
- *Formula:* Wick Ratio = (Upper Wick + Lower Wick) / Candle Range
- *Example:*
- Threshold = 0.6 โ 60% of the candle must be wicks.
#### *๐น Min Wick Size (ATR %)*
- *Purpose:* Filters out small wicks in volatile markets.
- *Example:*
- ATR = 20 pips, MinWickSize = 1% โ Wicks under *0.2 pips* are ignored.
---
### *5๏ธโฃ โ Display Settings*
- *Show Zones:* Toggles support/resistance shaded areas.
- *Show Traps:* Highlights liquidity traps (โฒ/โผ symbols).
- *Show Tests:* Displays how many times levels were tested.
- *Zone Transparency:* Adjusts opacity of zones.
---
## *๐ฏ Practical Use Cases*
### *1๏ธโฃ Liquidity Trap Detection*
- *Scenario:* Price spikes *above resistance* then reverses sharply.
- *Requirements:*
- Long wick (Wick Ratio > 0.6)
- High volume (Volume > Threshold)
- *Outcome:* *Short Trap* signal (โผ) appears.
### *2๏ธโฃ Strong Support Level*
- *Scenario:* Price bounces *3 times* from the same level.
- *Indicator Action:*
- Labels the level with test count (3/5 = 3 tests out of max 5).
- Turns *red* if broken (Break Count > 0).
Deep Dive: How This Indicator Works*
This indicator combines *four professional trading concepts* into one powerful tool:
1. *Classic Pivot Point Theory*
- Identifies swing highs/lows where price previously reversed
- Unlike basic pivot indicators, ours uses *confirmed pivots only* (filtered by ATR)
2. *Volume-Weighted Validation*
- Requires unusual trading volume to confirm levels
- Filters out "phantom" levels with low participation
3. *ATR Volatility Filtering*
- Eliminates insignificant price swings in choppy markets
- Ensures only meaningful levels are plotted
4. *Liquidity Trap Detection*
- Spots institutional stop hunts where markets fake out traders
- Uses wick analysis + volume spikes for high-probability signals
---
Deep Dive: How This Indicator Works*
This indicator combines *four professional trading concepts* into one powerful tool:
1. *Classic Pivot Point Theory*
- Identifies swing highs/lows where price previously reversed
- Unlike basic pivot indicators, ours uses *confirmed pivots only* (filtered by ATR)
2. *Volume-Weighted Validation*
- Requires unusual trading volume to confirm levels
- Filters out "phantom" levels with low participation
3. *ATR Volatility Filtering*
- Eliminates insignificant price swings in choppy markets
- Ensures only meaningful levels are plotted
4. *Liquidity Trap Detection*
- Spots institutional stop hunts where markets fake out traders
- Uses wick analysis + volume spikes for high-probability signals
---
## *๐ Parameter Encyclopedia (Expanded)*
### *1๏ธโฃ Pivot Engine Settings*
#### *Pivot Length (50)*
- *What It Does:*
Determines how many bars to analyze when searching for swing highs/lows.
- *Professional Adjustment Guide:*
| Trading Style | Recommended Value | Why? |
|--------------|------------------|------|
| Scalping | 10-20 | Captures short-term levels |
| Day Trading | 30-50 | Balanced approach |
| Swing Trading| 50-200 | Focuses on major levels |
- *Real Market Example:*
On NASDAQ 5-minute chart:
- Length=20: Identifies levels holding for ~2 hours
- Length=50: Finds levels respected for entire trading day
#### *Test Threshold (5)*
- *Advanced Insight:*
Institutions often test levels 3-5 times before breaking them. This setting mimics the "probe and push" strategy used by smart money.
- *Psychology Behind It:*
Retail traders typically give up after 2-3 tests, while institutions keep testing until stops are run.
---
### *2๏ธโฃ Volatility Filter System*
#### *ATR Multiplier (1.0)*
- *Professional Formula:*
Minimum Valid Swing = ATR(14) ร Multiplier
- *Market-Specific Recommendations:*
| Market Type | Optimal Multiplier |
|------------------|--------------------|
| Forex Majors | 0.8-1.2 |
| Crypto (BTC/ETH) | 1.5-2.5 |
| SP500 Stocks | 1.0-1.5 |
- *Why It Matters:*
In EUR/USD (ATR=10 pips):
- Multiplier=1.0 โ Requires 10 pip swings
- Multiplier=1.5 โ Requires 15 pip swings (fewer but higher quality levels)
---
### *3๏ธโฃ Volume Confirmation System*
#### *Volume Threshold (1.2)*
- *Institutional Benchmark:*
- 1.2x = Moderate institutional interest
- 1.5x+ = Strong smart money activity
- *Volume Spike Case Study:*
*Before Apple Earnings:*
- Normal volume: 2M shares
- Spike threshold (1.2): 2.4M shares
- Actual volume: 3.1M shares โ STRONG confirmation
---
### *4๏ธโฃ Liquidity Trap Detection*
#### *Wick Analysis System*
- *Two-Filter Verification:*
1. *Wick Ratio (0.6):*
- Ensures majority of candle shows rejection
- Formula: (UpperWick + LowerWick) / Total Range > 0.6
2. *Min Wick Size (1% ATR):*
- Prevents false signals in flat markets
- Example: ATR=20 pips โ Min wick=0.2 pips
- *Trap Identification Flowchart:*
Price Enters Zone โ
Spikes Beyond Level โ
Shows Long Wick โ
Volume > Threshold โ
TRAP CONFIRMED
---
## *๐ก Master-Level Usage Techniques*
### *Institutional Order Flow Analysis*
1. *Step 1:* Identify pivot levels with โฅ3 tests
2. *Step 2:* Watch for volume contraction near levels
3. *Step 3:* Enter when trap signal appears with:
- Wick > 2รATR
- Volume > 1.5ร average
### *Multi-Timeframe Confirmation*
1. *Higher TF:* Find weekly/monthly pivots
2. *Lower TF:* Use this indicator for precise entries
3. *Example:*
- Weekly pivot at $180
- 4H shows liquidity trap โ High-probability reversal
---
## *โ Critical Mistakes to Avoid*
1. *Using Default Settings Everywhere*
- Crude oil needs higher ATR multiplier than bonds
2. *Ignoring Trap Context*
- Traps work best at:
- All-time highs/lows
- Major psychological numbers (00/50 levels)
3. *Overlooking Cumulative Volume*
- Check if volume is building over multiple tests
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
For quick access on a chart, add this script to your favorites โ learn more here.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
For quick access on a chart, add this script to your favorites โ learn more here.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.