OPEN-SOURCE SCRIPT

Pivot S/R with Volatility Filter

574
## *๐Ÿ“Œ 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

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.