HaP AVWAP / Anchored VWAP

10 825
HaP AVWAP / Anchored VWAP

OVERVIEW
This indicator draws Anchored VWAP (AVWAP) lines from the most significant swing high and swing low on the chart. Instead of placing the anchor manually, the script evaluates confirmed pivots and selects the most important high and low with a scoring model. The Top AVWAP shows the volume-weighted average price of participants who entered from the selected high. The Bottom AVWAP shows the same for participants who entered from the selected low. These levels are commonly watched as dynamic resistance and support.

The anchored VWAP concept itself is well known and was popularized by Brian Shannon. What this script adds is the automatic, rule-based selection of the anchor points, plus bands, a value cloud, second anchors, S/R marks, an info panel and alerts in one tool.

HOW IT WORKS
1. Pivot detection
Swing highs and lows are found with Pivot Left / Right settings. A pivot is confirmed only after "Right" bars have closed. The anchor is then placed on the pivot bar itself, not on the confirmation bar.

2. Importance score (default mode)
Each confirmed pivot is scored using:
- Reversal size: how far price moved away from the pivot, measured in ATR
- Prior move: the size of the move that led into the pivot, measured in ATR
- Relative volume: volume around the pivot bar compared with the 50-bar average before the pivot
- Wick rejection: the share of the pivot candle taken up by its rejection wick
- Structural position: how close the pivot is to the highest high or lowest low of the lookback window
- Break status: pivots already crossed by price receive a penalty (Close or Wick can be selected as the break criterion)
- Recency: older pivots gradually lose weight
Pivots below the Min. Prominence threshold (in ATR) are ignored. The highest-scoring high and low become the anchors.

3. Other selection modes
- Unbroken pivot: the most extreme pivot that price has not crossed yet
- Period high-low: the absolute highest and lowest bar in the lookback window
- Last pivot: the most recent pivot that passes the prominence threshold
If no pivot qualifies, the script falls back to the period high/low and labels the anchor as a fallback.

4. AVWAP and bands
The VWAP is calculated from cumulative price × volume sums. By default the Top AVWAP uses the High and the Bottom AVWAP uses the Low. A common source (for example hlc3) can be selected instead. Up to three bands per anchor can be shown, either as standard deviation multiples or as percentage offsets.

FEATURES
- Automatic Top and Bottom AVWAP with up to 3 bands each, plus an optional band 1 fill
- Second anchors: the AVWAP of the second highest-scored high and low, drawn dashed
- Value cloud: the area between the Top and Bottom AVWAP
- Candidate marks: other qualifying pivots shown as small diamonds, with score details in the tooltip
- S / R marks:
S (Support): price dips to the Bottom AVWAP and closes above it with a bullish candle
R (Rejection): price reaches the Top AVWAP and closes below it with a bearish candle
- Info panel: AVWAP values, percentage distance, z-score (σ), prominence, relative volume, anchor age and a short market state summary (above both, below both, between, or crossed, plus a squeeze note when the two AVWAPs are close)
- Turkish / English interface option
- Works on symbols without volume data by switching to time weighting (TWAP)

HOW TO USE
- Price holding above the Bottom AVWAP suggests buyers from that low are, on average, in profit. Price staying below the Top AVWAP suggests sellers from that high are, on average, in profit.
- A close above the Top AVWAP or below the Bottom AVWAP can be read as a shift in control. Price between the two lines indicates a balance zone.
- The ±2 bands can help spot stretched moves relative to the anchored average.
- For a more stable anchor, increase Pivot Left/Right and Min. Prominence. For more responsive anchors, lower them or increase the Recency weight.
- The indicator is meant to be used together with your own analysis and risk management, not as a standalone buy/sell system.

ALERTS
Alerts are available for crosses of the Top and Bottom AVWAP, S and R events, returns from the ±2 bands, and anchor changes. All alert conditions are evaluated on closed bars.

IMPORTANT NOTES AND LIMITATIONS
- Anchors can move. When a new pivot is confirmed or scores change, the anchor may move to a different high or low, and the lines are redrawn from the new anchor. This is the intended behaviour of an automatic anchor, but it means past lines are not fixed.
- Pivots are confirmed with a delay equal to the "Right" setting.
- S / R marks are shown only on closed bars after the current anchor and are measured against the line currently drawn on the chart. No marks are produced on the live bar.
- Calculations use an internal buffer of 4000 bars. Anchors older than this are not drawn.
- On symbols without volume (some indices or forex feeds), the lines become time-weighted averages when TWAP mode is enabled.

DISCLAIMER
This script is provided for educational and informational purposes only. It does not constitute financial advice or a recommendation to buy or sell any security. Past behaviour of price around these levels does not guarantee future results. Always do your own research and use proper risk management.


HaP AVWAP / Anchored VWAP

GENEL BAKIŞ
Bu gösterge, grafikteki en önemli tepe ve dip noktalarından Çapalı VWAP (AVWAP) çizgileri çizer. Çapa elle yerleştirilmez. Betik onaylı pivotları değerlendirir ve bir puanlama modeliyle en önemli tepeyi ve dibi seçer. Tepe AVWAP, seçilen tepeden itibaren işlem yapanların hacim ağırlıklı ortalama maliyetini gösterir. Dip AVWAP aynı hesabı seçilen dipten itibaren yapar. Bu seviyeler genellikle dinamik direnç ve destek olarak izlenir.

Çapalı VWAP kavramı yaygın olarak bilinir ve Brian Shannon tarafından popüler hale getirilmiştir. Bu betiğin katkısı, çapa noktalarının kurallara dayalı olarak otomatik seçilmesidir. Bantlar, denge bulutu, ikinci çapalar, S/R işaretleri, bilgi paneli ve alarmlar da tek bir araçta sunulur.

NASIL ÇALIŞIR
1. Pivot tespiti
Tepe ve dipler Pivot Sol / Sağ ayarlarıyla bulunur. Bir pivot ancak "Sağ" değeri kadar bar kapandıktan sonra onaylanır. Çapa, onay barına değil pivotun kendi barına yerleştirilir.

2. Önem skoru (varsayılan mod)
Her onaylı pivot şu ölçütlerle puanlanır:
- Dönüş büyüklüğü: Fiyatın pivottan ne kadar uzaklaştığı (ATR cinsinden)
- Önceki hareket: Pivota gelen hareketin büyüklüğü (ATR cinsinden)
- Göreli hacim: Pivot barı çevresindeki hacmin, pivottan önceki 50 barlık ortalamaya oranı
- Fitil reddi: Pivot mumunda reddedilme fitilinin mum boyuna oranı
- Yapısal konum: Pivotun arama penceresindeki en yüksek veya en düşük seviyeye yakınlığı
- Kırılma durumu: Fiyatın geçtiği pivotlara ceza uygulanır (kırılma ölçütü Kapanış veya Fitil seçilebilir)
- Yenilik: Eski pivotların ağırlığı zamanla azalır
Min. Önem eşiğinin (ATR) altında kalan pivotlar dikkate alınmaz. En yüksek puanlı tepe ve dip çapa olarak seçilir.

3. Diğer seçim yöntemleri
- Kırılmamış pivot: Fiyatın henüz geçmediği en uç pivot
- Dönem zirve-dip: Arama penceresindeki en yüksek ve en düşük bar
- Son pivot: Önem eşiğini geçen en son pivot
Uygun pivot bulunamazsa dönem zirvesi/dibi kullanılır ve etiket "yedek" olarak işaretlenir.

4. AVWAP ve bantlar
VWAP, kümülatif fiyat × hacim toplamlarından hesaplanır. Varsayılan olarak Tepe AVWAP High, Dip AVWAP Low fiyatını kullanır. İsterseniz ikisi için ortak bir kaynak (örneğin hlc3) seçilebilir. Her çapa için en fazla üç bant gösterilebilir. Bantlar standart sapma katı ya da yüzde olarak ayarlanabilir.

ÖZELLİKLER
- Otomatik Tepe ve Dip AVWAP, her biri için 3 bant ve isteğe bağlı 1. bant dolgusu
- İkinci çapalar: İkinci en yüksek puanlı tepe ve dibin AVWAP'ı, kesikli çizgiyle
- Denge bulutu: Tepe ve Dip AVWAP arasındaki alan
- Aday işaretleri: Eşiği geçen diğer pivotlar küçük elmas şekliyle, ipucunda skor detaylarıyla
- S / R işaretleri:
S (Savunma): Fiyat Dip AVWAP'a iner, üstünde ve yükselişle kapanır
R (Red): Fiyat Tepe AVWAP'a çıkar, altında ve düşüşle kapanır
- Bilgi paneli: AVWAP değerleri, yüzde fark, z-skoru (σ), önem, göreli hacim, çapa yaşı ve kısa piyasa durumu özeti (iki çizginin üstünde, altında, arasında veya kesişmiş; iki AVWAP birbirine yakınsa sıkışma notu)
- Türkçe / İngilizce arayüz seçeneği
- Hacim verisi olmayan sembollerde zaman ağırlıklı ortalamaya (TWAP) geçebilme

NASIL KULLANILIR
- Fiyatın Dip AVWAP üzerinde kalması, o dipten alanların ortalamada kârda olduğunu gösterir. Fiyatın Tepe AVWAP altında kalması, o tepeden satanların ortalamada kârda olduğunu gösterir.
- Tepe AVWAP üzerinde ya da Dip AVWAP altında kapanış, kontrolün el değiştirdiği şeklinde yorumlanabilir. İki çizgi arasındaki bölge denge bölgesidir.
- ±2 bantlar, fiyatın çapalı ortalamadan aşırı uzaklaştığı durumları görmeye yardımcı olabilir.
- Daha kararlı çapa için Pivot Sol/Sağ ve Min. Önem değerlerini artırın. Daha hızlı tepki için bu değerleri düşürün veya Yenilik ağırlığını artırın.
- Gösterge tek başına bir al/sat sistemi değildir. Kendi analiziniz ve risk yönetiminizle birlikte kullanılmalıdır.

ALARMLAR
Tepe ve Dip AVWAP kesişimleri, S ve R olayları, ±2 banttan dönüşler ve çapa değişimleri için alarmlar vardır. Tüm alarm koşulları kapanmış barda değerlendirilir.

ÖNEMLİ NOTLAR VE SINIRLAMALAR
- Çapalar değişebilir. Yeni bir pivot onaylandığında veya skorlar değiştiğinde çapa başka bir tepe/dibe taşınabilir ve çizgiler yeni çapadan yeniden çizilir. Bu, otomatik çapanın doğal davranışıdır, ancak geçmişteki çizgilerin sabit olmadığı anlamına gelir.
- Pivotlar "Sağ" ayarı kadar gecikmeyle onaylanır.
- S / R işaretleri yalnızca güncel çapadan sonraki kapanmış barlarda ve grafikte çizili olan çizgiye göre gösterilir. Canlı barda işaret oluşmaz.
- Hesaplamalar 4000 barlık bir iç tampon kullanır. Daha eski çapalar çizilmez.
- Hacim verisi olmayan sembollerde (bazı endeks veya forex verileri) TWAP seçeneği açıksa çizgiler zaman ağırlıklı ortalama olur.

YASAL UYARI
Bu betik yalnızca eğitim ve bilgilendirme amaçlıdır. Yatırım tavsiyesi ya da herhangi bir menkul kıymeti alma veya satma önerisi değildir. Fiyatın bu seviyeler çevresindeki geçmiş davranışı gelecekteki sonuçları garanti etmez. Kararlarınızı kendi araştırmanıza dayandırın ve uygun risk yönetimi kullanın.

Wyłączenie odpowiedzialności

Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.