Key Gate Levels

2 215
Key Gate Levels (KGL)

OVERVIEW
Key Gate Levels finds the price levels where crossing them historically produced outsized directional moves — far beyond what normal volatility (ATR) would suggest. These "gates" are not fixed pivots or manual S/R lines; they are statistically significant levels derived from the chart's own behavior.

The indicator scans recent history, measures the actual move that followed each closing price, compares that move to the ATR-expected range, clusters nearby significant prices into single levels, and ranks them by cumulative force. The strongest and most frequently confirmed levels are drawn as extending zones with directional labels.

HOW IT WORKS

1. Scan every bar in the lookback
For each closing price, the script looks ahead a configurable number of bars and records:
- the highest high reached (bullish potential)
- the lowest low reached (bearish potential)

2. Compare the move to normal volatility
The forward move is divided by the ATR at that bar. If the move exceeds the Acceleration Threshold (default 3 × ATR), the closing price is recorded as a candidate gate level, tagged bullish or bearish.

3. Cluster nearby prices
Candidate prices that lie within Cluster Width × ATR of an existing level are merged. The merged level becomes a running average of its clustered prices, weighted by how many candidates joined it. Each cluster tracks total force, directional bias, and number of hits.

4. Rank and filter
Levels are sorted by cumulative force. Levels with fewer than the minimum required hits are skipped. The hit requirement is auto-adjusted by timeframe:
- Below 3H: more hits required
- 4H to 12H: fewer hits
- Daily and above: fewer hits

5. Draw zones and labels
Each selected level is drawn as an extending horizontal zone whose transparency reflects how often it was confirmed. A label shows:
- direction arrow (bullish, bearish, or neutral)
- average force in ATR multiples
- number of historical hits
- calculation timeframe

6. Proximity highlight
When price approaches any stored gate level within Proximity Distance × ATR, the background is highlighted so you can see which level is currently in play.

INPUTS
Use Custom Timeframe: choose to calculate gates from the chart timeframe or a higher/lower custom timeframe.
Calculation Timeframe: the timeframe used for gate detection when custom mode is on.
Lookback Bars: how many bars to scan (100 to 5000).
Forward Measure Window: how many bars ahead to measure the resulting move (3 to 30).
ATR Period: period for ATR normalization.
Acceleration Threshold (ATR x): a move must exceed this × ATR to count.
Cluster Width (ATR x): merge gate prices within this distance.
Threshold: bias threshold for classifying a level as bullish or bearish vs neutral.
Max Levels: maximum zones to draw.
Zone Height (ATR x): half-height of each drawn zone box.
Min Hits per timeframe group: auto-scaled minimum confirmations.
Highlight Near Level: toggle the proximity background alert.
Proximity Distance (ATR x): how close price must be to trigger the background highlight.

HOW TO USE
- Watch the strongest levels as dynamic support/resistance.
- A bullish gate level below price can act as support.
- A bearish gate level above price can act as resistance.
- Neutral levels still matter but show mixed directional acceleration.
- The proximity highlight tells you when price is testing a key level in real time.
- Combine with your own entry rules; this indicator identifies the levels, not the entry.

ALERTS
"Near Gate Level" fires when price moves within the configured ATR distance of any active gate level.

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.