//@version=5
indicator("Fair Value Gap (FVG) + Pivot Noktaları", overlay=true, max_bars_back=500)
// --- Kullanıcı Girişleri ---
showBullish = input.bool(true, "Yükseliş FVG'lerini Göster")
showBearish = input.bool(true, "Düşüş FVG'lerini Göster")
// FVG Ayarları
fvgPercentage = input.float(1.0, "Minimum FVG Yüzdesi", minval=0, step=0.1, tooltip="Fiyat farkının yüzde olarak minimum eşiği")
boxWidth = input.int(30, "Box Genişliği (mum sayısı)", minval=1, tooltip="FVG bölgesinin sağa doğru kaç mum genişliğinde çizileceği")
// Pivot Ayarları
showPivots = input.bool(true, "Pivot Noktalarını Göster")
pivotLeft = input.int(5, "Pivot Sol Kenar", minval=1, tooltip="Pivot noktası için sol taraftaki mum sayısı")
pivotRight = input.int(5, "Pivot Sağ Kenar", minval=1, tooltip="Pivot noktası için sağ taraftaki mum sayısı")
showPivotLabels = input.bool(true, "Pivot Etiketlerini Göster")
pivotHighColor = input.color(color.red, "Pivot Tepe Rengi")
pivotLowColor = input.color(color.green, "Pivot Dip Rengi")
// Tablo Göster
showSummaryTable = input.bool(true, "Özet Tablosunu Göster")
// --- FVG Hesaplamaları ---
bullishFvgRaw = low > high[2]
bearishFvgRaw = high < low[2]
bullishFvgSize = bullishFvgRaw ? (low - high[2]) / high[3] * 100 : na
bearishFvgSize = bearishFvgRaw ? (low[2] - high) / high * 100 : na
bullishFvg = bullishFvgRaw and bullishFvgSize >= fvgPercentage
bearishFvg = bearishFvgRaw and bearishFvgSize >= fvgPercentage
// --- Pivot Hesaplamaları ---
pivotHigh = ta.pivothigh(pivotLeft, pivotRight)
pivotLow = ta.pivotlow(pivotLeft, pivotRight)
// --- Pivot Noktalarını Çiz (sadece pivot oluştuğunda) ---
if showPivots
// Pivot Tepeler (Kırmızı)
if not na(pivotHigh)
// Yatay çizgi
// Etiket (isteğe bağlı)
if showPivotLabels
label.new(
bar_index[pivotRight], pivotHigh,
text = "Pivot T " + str.tostring(pivotHigh, "#.##"),
color = pivotHighColor,
textcolor = color.white,
style = label.style_label_down,
yloc = yloc.price,
size = size.small
)
// Pivot Dipleri (Yeşil)
if not na(pivotLow)
// Yatay çizgi
// Etiket (isteğe bağlı)
if showPivotLabels
label.new(
bar_index[pivotRight], pivotLow,
text = "Pivot D " + str.tostring(pivotLow, "#.##"),
color = pivotLowColor,
textcolor = color.white,
style = label.style_label_up,
yloc = yloc.price,
size = size.small
)
// --- FVG Box'larını Çiz ---
if bar_index > 2
// Yükseliş FVG
if showBullish and bullishFvg
leftIndex = bar_index[2]
rightIndex = bar_index + boxWidth
// FVG Kutusu
box.new(
left = leftIndex,
right = rightIndex,
top = high[2],
bottom = low,
bgcolor = color.new(color.green, 70),
border_color = color.green,
border_width = 1,
text = "FVG ↑ " + str.tostring(bullishFvgSize, "#.##") + "%",
text_color = color.blue,
text_size = size.small,
extend = extend.none
)
// FVG ile pivot etkileşimi (sadece pivot varsa)
if not na(pivotHigh) or not na(pivotLow)
fvgTop = high[2]
fvgBottom = low
// Pivot tepe FVG içinde mi?
if not na(pivotHigh) and pivotHigh <= fvgTop and pivotHigh >= fvgBottom
label.new(
bar_index, (fvgTop + fvgBottom) / 2,
text = "⚠️ TEPE",
color = color.yellow,
textcolor = color.black,
style = label.style_label_center,
size = size.tiny
)
// Pivot dip FVG içinde mi?
if not na(pivotLow) and pivotLow <= fvgTop and pivotLow >= fvgBottom
label.new(
bar_index, (fvgTop + fvgBottom) / 2,
text = "⚠️ DİP",
color = color.yellow,
textcolor = color.black,
style = label.style_label_center,
size = size.tiny
)
// Düşüş FVG
if showBearish and bearishFvg
leftIndex = bar_index[2]
rightIndex = bar_index + boxWidth
// FVG Kutusu
box.new(
left = leftIndex,
right = rightIndex,
top = low[2],
bottom = high,
bgcolor = color.new(color.red, 70),
border_color = color.red,
border_width = 1,
text = "FVG ↓ " + str.tostring(bearishFvgSize, "#.##") + "%",
text_color = color.blue,
text_size = size.small,
extend = extend.none
)
// FVG ile pivot etkileşimi (sadece pivot varsa)
if not na(pivotHigh) or not na(pivotLow)
fvgTop = low[2]
fvgBottom = high
// Pivot tepe FVG içinde mi?
if not na(pivotHigh) and pivotHigh <= fvgTop and pivotHigh >= fvgBottom
label.new(
bar_index, (fvgTop + fvgBottom) / 2,
text = "⚠️ TEPE",
color = color.yellow,
textcolor = color.black,
style = label.style_label_center,
size = size.tiny
)
// Pivot dip FVG içinde mi?
if not na(pivotLow) and pivotLow <= fvgTop and pivotLow >= fvgBottom
label.new(
bar_index, (fvgTop + fvgBottom) / 2,
text = "⚠️ DİP",
color = color.yellow,
textcolor = color.black,
style = label.style_label_center,
size = size.tiny
)
// --- Özet Tablosu (optimize edilmiş) ---
if showSummaryTable and barstate.islast
// Sayaçları güncel tut (sadece son 200 mum)
var int bullishCount = 0
var int bearishCount = 0
var int pivotHighCount = 0
var int pivotLowCount = 0
// Son 200 mumu tara (buffer limitini aşmamak için)
for i = 0 to 200
if bullishFvg[i]
bullishCount := bullishCount + 1
if bearishFvg[i]
bearishCount := bearishCount + 1
if not na(pivotHigh[i])
pivotHighCount := pivotHighCount + 1
if not na(pivotLow[i])
pivotLowCount := pivotLowCount + 1
// Tablo oluştur
var table infoTable = table.new(position.top_right, 2, 6, bgcolor=color.new(color.black, 90), border_width=1, border_color=color.gray)
// Tabloyu güncelle
if barstate.islast
table.cell(infoTable, 0, 0, "📊 FVG & PİVOT\n (200 Mum)", text_color=color.white, bgcolor=color.new(color.blue, 70), text_size=size.normal)
table.cell(infoTable, 0, 1, "Yükseliş FVG:", text_color=color.white, text_size=size.small)
table.cell(infoTable, 1, 1, str.tostring(bullishCount), text_color=color.green, text_size=size.small)
table.cell(infoTable, 0, 2, "Düşüş FVG:", text_color=color.white, text_size=size.small)
table.cell(infoTable, 1, 2, str.tostring(bearishCount), text_color=color.red, text_size=size.small)
table.cell(infoTable, 0, 3, "Pivot Tepeler:", text_color=color.white, text_size=size.small)
table.cell(infoTable, 1, 3, str.tostring(pivotHighCount), text_color=color.red, text_size=size.small)
table.cell(infoTable, 0, 4, "Pivot Dipleri:", text_color=color.white, text_size=size.small)
table.cell(infoTable, 1, 4, str.tostring(pivotLowCount), text_color=color.green, text_size=size.small)
table.cell(infoTable, 0, 5, "Toplam Sinyal:", text_color=color.white, text_size=size.small)
table.cell(infoTable, 1, 5, str.tostring(bullishCount + bearishCount), text_color=color.yellow, text_size=size.small)
Bu gösterge, piyasalardaki fiyat boşluklarını (Fair Value Gaps) tespit eden ve görselleştiren bir TradingView indikatörüdür.
Her mumda otomatik olarak FVG olup olmadığını kontrol eder:
✅ Yeşil Kutular: Yükseliş FVG'leri (fiyatın yukarı sıçrama potansiyeli)
✅ Kırmızı Kutular: Düşüş FVG'leri (fiyatın aşağı sıçrama potansiyeli)
Sadece belirli büyüklükteki FVG'leri gösterir:
Kullanıcı minimum yüzde belirleyebilir
Örn: Sadece %0.5'ten büyük boşlukları göster
Her FVG bölgesini dikdörtgenle işaretler:
Genişlik ayarlanabilir: Kaç mum ileriyi kapsayacağı
Yüzde bilgisi: FVG'nin büyüklüğü kutu üzerinde yazar
Nerede fiyat boşluğu olduğunu
Bu boşlukların ne kadar büyük olduğunu
Fiyatın hangi bölgelere dönebileceğini gösterir.
Özellikle fiyatın boşlukları doldurma eğiliminden faydalanarak alım-satım stratejileri geliştirmenize yardımcı olur.