PHP Code:
// © Kinetik Komuta Merkezi - OMEGA-HUB / TRINITY SENTEZİ (REPAINT SIFIR)
//@version=6
indicator("OMEGA-HUB - Trinity Sentezi v8", overlay=true)
// ════════════════════════════════════════════════════════════════════
// HAZIRLIK: SIFIR-GECİKMELİ HA-KALKANI (Optimizasyon 3)
// ════════════════════════════════════════════════════════════════════
// İşlemciyi yormamak için HA mumlarını ekrana çizmiyoruz.
// Sadece matematiksel bir "Kalkan" olarak arka planda hesaplıyoruz.
float ha_c = (open + high + low + close) / 4
float ha_o = na(open[1]) ? (open + close) / 2 : (nz(open[1]) + nz(close[1])) / 2
float ha_h = math.max(high, math.max(ha_o, ha_c))
float ha_l = math.min(low, math.min(ha_o, ha_c))
float vol_atr = ta.atr(14)
// ════════════════════════════════════════════════════════════════════
// TRINITY AYNA MOTORU
// ════════════════════════════════════════════════════════════════════
var float ep = na
var float sar_val = na
var float af = 0.02
var int trend = 1
if na(sar_val) and not na(high[1])
trend := 1
sar_val := low[1]
ep := high
af := 0.02
// Kinetik Hız Limitleyici: Fiyat Ayna'ya uzaksa işlemciyi dinlendir
float mesafe = math.abs(close - nz(sar_val, close))
bool kritik_bolge = mesafe < (vol_atr * 1.5) // Fiyat Ayna'ya yaklaştıysa motoru tam güç ateşle
// ════════════════════════════════════════════════════════════════════
// MİLİSANİYE & KİNETİK İVME RADARI (Optimizasyon 1 & 2)
// ════════════════════════════════════════════════════════════════════
float dynamic_step = 0.02
// Sadece kritik bölgedeyken Hacim/Tick yoğunluğunu hesapla (İşlemci Dostu)
if kritik_bolge
float tick_proxy = volume
float avg_ticks = ta.sma(tick_proxy, 20)
float tick_ratio = tick_proxy / math.max(avg_ticks, 1)
// Hacim/Tick patlaması varsa Ayna'nın adımını daralt veya genişlet
dynamic_step := math.max(0.005, math.min(0.1, 0.02 * tick_ratio))
float next_sar = sar_val
if not na(sar_val)
if trend == 1
next_sar := sar_val + af * (ep - sar_val)
next_sar := math.min(math.min(low[1], nz(low[2], low[1])), next_sar)
if high > ep
ep := high
af := math.min(0.2, af + dynamic_step)
// Kalkan Devrede: Normal low yerine, gürültüsüz Heikin-Ashi low'u kullanıyoruz
if ha_l < next_sar
trend := -1
next_sar := ep
ep := ha_l
af := dynamic_step
else
next_sar := sar_val + af * (ep - sar_val)
next_sar := math.max(math.max(high[1], nz(high[2], high[1])), next_sar)
if low < ep
ep := low
af := math.min(0.2, af + dynamic_step)
// Kalkan Devrede: Normal high yerine, gürültüsüz Heikin-Ashi high'ı kullanıyoruz
if ha_h > next_sar
trend := 1
next_sar := ep
ep := ha_h
af := dynamic_step
sar_val := next_sar
// ════════════════════════════════════════════════════════════════════
// GÖRSELLEŞTİRME VE MÜHÜRLÜ SİNYALLER
// ════════════════════════════════════════════════════════════════════
// Fiyat Ayna'ya yaklaşıp motor tam güç çalışmaya başladığında renk Sarıya döner
color ayna_renk = kritik_bolge ? color.yellow : color.white
plot(sar_val, "Trinity Ayna", color=ayna_renk, linewidth=3, style=plot.style_stepline)
bgcolor(trend == 1 ? color.new(color.green, 90) : color.new(color.red, 90))
// Repaint %0 - Sinyaller sadece bar kapanışında mühürlenir
bool is_confirmed = barstate.isconfirmed
bool buy = trend == 1 and nz(trend[1], 1) == -1 and is_confirmed
bool sell = trend == -1 and nz(trend[1], -1) == 1 and is_confirmed
plotshape(buy, "AL", style=shape.labelup, location=location.belowbar, color=color.green, text="AL", textcolor=color.white, size=size.small)
plotshape(sell, "SAT", style=shape.labeldown, location=location.abovebar, color=color.red, text="SAT", textcolor=color.white, size=size.small)
Yer İmleri