OPEN-SOURCE SCRIPT
Atualizado

Top & Bottom Finder XL

707
# Top & Bottom Finder XL

## User's Guide

---

# Overview

**Top & Bottom Finder XL** is a market exhaustion indicator.

Its purpose is **not** to predict every swing high and swing low.

Instead, it attempts to identify **high-probability exhaustion points** where price has become statistically extended and has a greater chance of reversing.

Unlike traditional pivot indicators, this indicator combines several independent filters:

* Structural pivots
* Momentum (RSI)
* Trend extension
* Volume
* Range expansion

Only when the selected filters agree does the indicator produce a **Confirmed Top** or **Confirmed Bottom**.

---

# How the Indicator Works

Every signal goes through the following process:

### Step 1 — Find a Pivot

The indicator first looks for a legitimate swing high or swing low using TradingView's pivot algorithm.

A pivot is not confirmed until the required number of right bars has completed.

Example:

Left = 100

Right = 5

means:

* current high must be higher than the previous 100 bars
* and remain the highest point for the next 5 bars

Only then is it officially a pivot.

---

### Step 2 — Apply RSI Filter (Optional)

Purpose:

Avoid taking pivots that occur without momentum extremes.

A top requires

RSI ≥ Top Threshold

A bottom requires

RSI ≤ Bottom Threshold

Default:

Top = 65

Bottom = 35

Disabling this filter means RSI is ignored completely.

---

### Step 3 — Apply Trend Extension Filter (Optional)

Purpose:

Avoid taking pivots that are too close to the trend.

The indicator measures:

Distance from EMA

using ATR.

Formula:

Distance =

Price − EMA

divided by ATR

Example

EMA = 100

ATR = 2

Price = 110

Distance =

10 ÷ 2

= 5 ATR

If Minimum ATR Extension = 5

the signal passes.

Otherwise it is rejected.

This filter is extremely effective at removing mediocre signals.

---

### Step 4 — Confirmation Filter

This determines whether the pivot occurred with unusually strong participation.

There are four modes.

## Off

No confirmation required.

Every pivot that passes the other filters becomes confirmed.

Produces the most signals.

---

## Volume Only

The pivot bar must have

Volume >

Average Volume × Multiplier

Default

50-bar average

Multiplier = 2

---

## Range Only

The pivot candle must have

Range >

Average Range × Multiplier

This looks for unusually large candles.

---

## Volume + Range

The strictest mode.

Requires BOTH:

* high volume
* large candle

Produces the fewest signals.

Usually the highest quality.

---

# Timeframe Settings

## Calculation Timeframe

Allows calculations on another timeframe.

Example

Chart = 15 minute

Calculation = 1 hour

Signals are calculated from hourly data but displayed on the 15-minute chart.

Leave blank to use the current chart timeframe.

---

# Pivot Settings

## Pivot Bars Left

Controls how significant the pivot must be.

Small values

More signals

Less significant

Large values

Fewer signals

More important turning points

Default

100

---

## Pivot Bars Right

Controls confirmation delay.

Larger values

Later signals

Higher confidence

Smaller values

Earlier signals

More false signals

Default

5

---

# Signal Filters

## Use RSI Filter

Enable or disable RSI completely.

---

## RSI Length

Default

14

Controls how RSI is calculated.

---

## Top RSI Threshold

Minimum RSI required for tops.

Default

65

Higher values

Fewer signals

---

## Bottom RSI Threshold

Maximum RSI allowed for bottoms.

Default

35

Lower values

Fewer signals

---

## Use Trend EMA Filter

Turns EMA distance filtering on or off.

---

## Trend EMA Length

Default

200

Long-term trend reference.

---

## ATR Length

Default

14

Used to normalize volatility.

---

## Minimum ATR Extension

Default

5 ATR

Controls how far price must stretch away from the EMA.

Higher values

Only extreme exhaustion

Lower values

More frequent signals

---

## Confirmation Mode

Options:

* Off
* Volume Only
* Range Only
* Volume + Range

Determines final confirmation.

---

## Volume / Range Average Length

Default

50

Average period used for volume and range comparisons.

---

## Volume Multiplier

Default

2

Required increase above average volume.

Example

Average volume = 100,000

Multiplier = 2

Required volume

200,000

---

## Range Expansion Multiplier

Default

0.5

Required increase above average candle range.

Higher values

Require larger candles.

---

# Display Settings

## Show Trend EMA

Displays the EMA used for trend extension.

Useful for visualizing how stretched price became.

---

## Show Watch Signals

Displays every confirmed pivot before filtering.

Watch signals represent:

"Potential reversal areas."

Confirmed signals represent:

"Filtered, higher-probability reversal areas."

---

## Color Settings

Customize:

* Watch Tops
* Watch Bottoms
* Confirmed Tops
* Confirmed Bottoms
* EMA

---

# Label Controls

These options determine what information appears inside Confirmed labels.

---

## Show Price

Displays pivot price.

Example

Price

145.32

---

## Show Pivot Settings

Displays

Left / Right

Example

100 / 5

Useful when comparing settings.

---

## Show RSI

Displays RSI at the pivot.

Example

RSI

72.5

---

## Show Volume

Displays pivot volume.

Useful when Volume confirmation is enabled.

---

## Show ATR

Displays ATR at the pivot.

Important:

This is **not** the distance from the EMA.

It simply displays the market's volatility (ATR) at the time the pivot formed.

Higher ATR means a more volatile market.

Lower ATR means a quieter market.

---

## Show EMA Distance

Displays

Distance from EMA

measured in ATRs.

Example

EMA Dist

5.82 ATR

This is arguably the most useful statistic on the label because it quantifies how extended price was when the reversal occurred.

---

## Show Confirmation Type

Displays how the confirmation filter was satisfied.

Possible values:

* Volume
* Range
* Volume + Range
* None

---

# Alerts

The indicator includes four alerts:

### Confirmed Top Found

Generated when a filtered top is confirmed.

---

### Confirmed Bottom Found

Generated when a filtered bottom is confirmed.

---

### Top Watch

Generated for every structural pivot high before filtering.

---

### Bottom Watch

Generated for every structural pivot low before filtering.

---

# Understanding Signal Timing

This is important.

The indicator **does not repaint**, but it is intentionally delayed by the **Pivot Bars Right** setting.

Example:

Right Bars = 5

A top occurring today will only be confirmed after five additional bars have closed without a higher high.

This is necessary because the indicator waits for confirmation that the pivot is truly established.

---

# Suggested Starting Settings

## Swing Trading (Daily)

* Left Bars: 100
* Right Bars: 5
* RSI: On
* EMA Filter: On
* Minimum ATR Extension: 5
* Confirmation: Volume Only

---

## Position Trading (Weekly)

* Left Bars: 150–250
* Right Bars: 5–10
* ATR Extension: 6–8
* Confirmation: Volume + Range

---

## Short-Term Trading (15–60 Minute)

* Left Bars: 30–60
* Right Bars: 3–5
* ATR Extension: 3–4
* Confirmation: Volume Only

---

# Strengths

* Adapts to market volatility using ATR.
* Filters out many insignificant pivots.
* Uses multiple independent confirmation methods.
* Supports higher-timeframe calculations on lower-timeframe charts.
* Does not repaint after pivot confirmation.
* Highly configurable for different trading styles.

---

# Current Limitations

* Signals are intentionally delayed by the selected Right Bars value.
* The indicator identifies **exhaustion points**, not trend direction.
* Strong trends can continue after a confirmed top or bottom, especially during momentum-driven markets.
* Volume confirmation may be less reliable for markets where reported volume is limited or synthetic (such as many forex CFDs).

---

# Best Use Practices

The indicator performs best when used to identify **areas of elevated reversal probability**, not as a standalone buy or sell trigger. Higher-quality setups occur when a confirmed signal aligns with higher-timeframe support or resistance, trendline breaks, divergence, or other independent forms of technical confirmation. Treat confirmed tops and bottoms as locations to focus attention rather than automatic entry points.
Notas de Lançamento
Added Timeframe to Top & Bottom Labels.
This way the user can instantly see what setting is generating the Top & Bottom labels.
Notas de Lançamento
**Summary of the Update**

Signals are no longer a single "Confirmed Top" or "Confirmed Bottom." Every top and bottom is now graded **Weak, Strong, or Extreme** based on how overbought or oversold RSI was at the pivot. All other filters (Trend EMA extension and Confirmation Mode) still work as hard gates — a pivot must pass them or no signal prints at all. Only the grade itself comes from RSI.

**How Grading Works**

- **Tops:** RSI at the pivot high must reach at least 60 for a Weak Top, 70 for a Strong Top, and 80 for an Extreme Top. Below 60, no top signal is generated.
- **Bottoms:** RSI at the pivot low must be at or below 40 for a Weak Bottom, 30 for a Strong Bottom, and 20 for an Extreme Bottom. Above 40, no bottom signal is generated.
- **Confirmation Mode is a hard gate:** if the pivot bar fails the volume/range check, nothing prints regardless of RSI. Setting it to "Off" disables the gate entirely.
- All six RSI thresholds are fully adjustable, so the tiers can be tightened or loosened independently for tops and bottoms.

**New User Inputs (vs. the Original)**

- **Signal Grading group (new):** RSI Length moved here, plus six new threshold inputs — Weak Top RSI (60), Strong Top RSI (70), Extreme Top RSI (80), Weak Bottom RSI (40), Strong Bottom RSI (30), Extreme Bottom RSI (20).
- **Six new color inputs:** Weak Top (orange), Strong Top (red), Extreme Top (maroon), Weak Bottom (aqua), Strong Bottom (lime), Extreme Bottom (teal). Each grade gets its own label color.

**Removed Inputs (vs. the Original)**

- **"Use RSI Filter" toggle** — removed because RSI is now the core of the grading system and always required. To effectively loosen it, set the Weak thresholds toward 50.
- **Single "Top RSI Threshold" (65) and "Bottom RSI Threshold" (35)** — replaced by the six tiered thresholds above.
- **"Confirmed Top Color" and "Confirmed Bottom Color"** — replaced by the six per-grade colors.

**Changed Behavior & Labels**

- Labels now read **"Weak Top," "Strong Top," "Extreme Top"** (and the Bottom equivalents) instead of "Confirmed Top/Bottom," colored by grade.
- The **Confirm line** in labels now shows what the pivot bar passed by — e.g., "Pass (Volume + Range)" — or "Off" when Confirmation Mode is disabled. The "Show Confirmation Detail" label toggle is now **on by default** (it was off in the original).
- Label control names were shortened ("Show Price" instead of "Show Price In Label," etc.) — cosmetic only.

**New Alerts**

The two original signal alerts are replaced by eight: **"Any Top Found"** and **"Any Bottom Found"** catch-alls, plus dedicated **Weak / Strong / Extreme** alerts for each side. Top Watch and Bottom Watch alerts are unchanged.

**Important for Existing Users**

Any alerts created on the old version will not carry over — TradingView binds alerts to the script version at creation, and the alert list has changed. Delete old alerts and recreate them after updating.

---

One blunt note: the default Weak thresholds (60/40) are loose — RSI 60 is normal in any uptrend, so with Confirmation Mode "Off" you'll get frequent Weak labels. The defaults lean on the ATR extension and volume gates to keep signal count sane, which is worth stating in your notes if other people will use this.

Aviso legal

As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.