OPEN-SOURCE SCRIPT

MACD Histogram Sifira Yaklasanlar

151
//version=6
indicator("MACD Histogram Sifira Yaklasanlar", overlay=false)

// 1. Standart MACD Parametreleri ve Hesaplamasi
fast_length = input.int(12, title="Hizli Uzunluk")
slow_length = input.int(26, title="Yavas Uzunluk")
signal_length = input.int(9, title="Sinyal Uzunlugu")
[macdLine, signalLine, histLine] = ta.macd(close, fast_length, slow_length, signal_length)

// 2. Kullanici Giris Ayarlari (Tolerans Seviyesi)
tolerans = input.float(0.05, title="Sifira Yaklasma Toleransi (Mesafe)")

// 3. Mantiksal Kosullar (Gorseldeki Senaryo)
// Kosul: Histogram 0'in altinda (Kirmizi) VE Son bar bir onceki bardan buyuk (Satis azaliyor)
// VE Histogram 0'a belirlenen tolerans mesafesinden daha yakin.
satis_azaliyor = histLine < 0 and histLine > histLine[1] and histLine >= -tolerans

// 4. Tarayici (Screener) Sutunu Icin Sayisal Cikti Uretme
plot(satis_azaliyor ? 1 : 0, title="TaramaSinyali", display=display.none)

// 5. Grafik Uzerinde Gorsellestirme
// Sürüm 6 uyumlu renk fonksiyonu dinamikleri
hist_color = histLine >= 0 ? (histLine > histLine[1] ? color.green : color.lime) : (histLine > histLine[1] ? color.maroon : color.red)
plot(histLine, title="Histogram", style=plot.style_columns, color=hist_color)
hline(0, "Sifir Cizgisi", color=color.gray, linestyle=hline.style_dashed)
plotshape(satis_azaliyor, title="Sinyal Noktasi", style=shape.circle, location=location.bottom, color=color.yellow, size=size.small)

Thông báo miễn trừ trách nhiệm

Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.