PHP Code:
// © Kinetik Komuta Merkezi [Masterpiece V2 - Kinetik Vur-Kaη Edition]
//@version=6
indicator("KKM Masterpiece V2", shorttitle="KKM Vur-Kaη", overlay=true, max_labels_count=100)
// ─────────────────────────────────────────────────────────────────
// 1. GέRDέLER
// ─────────────────────────────────────────────────────────────────
group_l1 = "1. L1 Kinetik Filtre (@yφrόk@)"
int atrLen = input.int(20, "L1 Hafύza (ATR)", group=group_l1)
float atrMult = input.float(3.5, "L1 Gόrόltό Duvarύ", step=0.1, group=group_l1)
float mu = input.float(0.6, "L1 Yakύnsaklύk (μ)", step=0.1, group=group_l1)
group_core = "2. Sύfύr Gecikmeli Ηekirdek (ZLEMA)"
int i_coreLen = input.int(55, "Ηekirdek Uzunluπu", group=group_core)
group_trade = "3. Vur-Kaη Hedefi"
float i_tpPct = input.float(1.0, "Kiώisel Hedef (%)", step=0.1, group=group_trade)
// ─────────────────────────────────────────────────────────────────
// 2. MATEMATέKSEL MOTOR (MTF Uyumlu, HL2 Kόtle Merkezi)
// ─────────────────────────────────────────────────────────────────
f_calc() =>
// A. ZLEMA (Kinetik TP / Momentum Ηekirdeπi)
float ema1 = ta.ema(hl2, i_coreLen)
float ema2 = ta.ema(ema1, i_coreLen)
float val_core = ema1 + (ema1 - ema2)
// B. L1 @yφrόk@ (Kinetik Stop / Dinamik Zύrh)
float threshold = ta.atr(atrLen) * atrMult
var float z = na
var float v = 0.0
if bar_index == 0
z := hl2
else
float zPrev = z[1], float vPrev = v[1]
float zPred = zPrev + vPrev
float zTemp = zPred + mu * (hl2 - zPred)
float diff = zTemp - zPrev
if math.abs(diff) > threshold
v := math.sign(diff) * (math.abs(diff) - threshold)
else
v := 0.0
z := zPrev + v
// C. Saatlik Saf TWAP
bool isNewHour = ta.change(time("60")) != 0
var float sumPrice = 0.0
var float barCount = 0.0
if isNewHour or bar_index == 0
sumPrice := hl2
barCount := 1.0
else
sumPrice += hl2
barCount += 1.0
float val_twap = sumPrice / barCount
[val_core, z, val_twap, hl2]
// ─────────────────────────────────────────────────────────────────
// 3. MEVCUT GRAFέK έΗέN HESAPLAMA VE ΗέZέM
// ─────────────────────────────────────────────────────────────────
[curCore, curYoruk, curTwap, curPrice] = f_calc()
plot(curTwap, "Saatlik TWAP", color=color.rgb(255, 204, 0), linewidth=2, style=plot.style_linebr)
plot(curYoruk, "@yφrόk@", color=color.fuchsia, linewidth=2, style=plot.style_stepline)
plot(curCore, "Ηekirdek", color=color.aqua, linewidth=2)
// ─────────────────────────────────────────────────────────────────
// 4. KέNETέK έήLEM MOTORU (VUR-KAΗ)
// ─────────────────────────────────────────────────────────────────
bool trendBull = curPrice > curCore and curPrice > curYoruk and curPrice > curTwap
bool trendBear = curPrice < curCore and curPrice < curYoruk and curPrice < curTwap
// Bar Renklendirme
color bCol = trendBull ? #00e676 : trendBear ? #ff1744 : #787b86
barcolor(bCol)
var int state = 0
var float entryP = na
var float statTp = na // Sabit %1 Hedef
if trendBull and state != 1
state := 1
entryP := close
statTp := entryP * (1 + (i_tpPct / 100))
else if trendBear and state != -1
state := -1
entryP := close
statTp := entryP * (1 - (i_tpPct / 100))
// Kinetik Ηύkύώ ήartlarύ (Gφrsel temizlik iηin iώlemi nφtrler)
bool stopOut = (state == 1 and curPrice < curYoruk) or (state == -1 and curPrice > curYoruk)
bool tpOut = (state == 1 and high >= statTp) or (state == -1 and low <= statTp)
if stopOut or tpOut
state := 0
// ─────────────────────────────────────────────────────────────────
// 5. MTF VERέ ΗEKέMέ
// ─────────────────────────────────────────────────────────────────
[f1, y1, t1, c1] = request.security(syminfo.tickerid, "1", f_calc())
[f3, y3, t3, c3] = request.security(syminfo.tickerid, "3", f_calc())
[f5, y5, t5, c5] = request.security(syminfo.tickerid, "5", f_calc())
[f15, y15, t15, c15] = request.security(syminfo.tickerid, "15", f_calc())
[f30, y30, t30, c30] = request.security(syminfo.tickerid, "30", f_calc())
[f60, y60, t60, c60] = request.security(syminfo.tickerid, "60", f_calc())
// ─────────────────────────────────────────────────────────────────
// 6. KέNETέK MTF & VUR-KAΗ PANOSU
// ─────────────────────────────────────────────────────────────────
var table mtfDash = table.new(position.top_right, 4, 12, bgcolor=color.new(color.black, 15), border_color=color.new(color.gray, 80), border_width=1)
f_draw_row(table t, int row, string tf, float core, float yoruk, float twap, float ref_c) =>
color rowBg = row % 2 == 0 ? color.new(color.black, 40) : color.new(color.gray, 90)
color c_c = ref_c >= core ? #00e676 : #ff1744
color c_y = ref_c >= yoruk ? #00e676 : #ff1744
color c_t = ref_c >= twap ? #00e676 : #ff1744
table.cell(t, 0, row, tf, text_color=color.white, text_size=size.small, bgcolor=rowBg)
table.cell(t, 1, row, str.tostring(math.round(core, 2)), text_color=c_c, text_size=size.small, bgcolor=rowBg)
table.cell(t, 2, row, str.tostring(math.round(yoruk, 2)), text_color=c_y, text_size=size.small, bgcolor=rowBg)
table.cell(t, 3, row, str.tostring(math.round(twap, 2)), text_color=c_t, text_size=size.small, bgcolor=rowBg)
if barstate.islast
// άst Baώlύklar
table.cell(mtfDash, 0, 0, "MTF", text_color=color.white, text_size=size.small, bgcolor=color.new(color.gray, 80))
table.cell(mtfDash, 1, 0, "ΗEKέRDEK", text_color=color.white, text_size=size.small, bgcolor=color.new(color.gray, 80))
table.cell(mtfDash, 2, 0, "YΦRάK", text_color=color.white, text_size=size.small, bgcolor=color.new(color.gray, 80))
table.cell(mtfDash, 3, 0, "TWAP", text_color=color.white, text_size=size.small, bgcolor=color.new(color.gray, 80))
// Matris Verileri
f_draw_row(mtfDash, 1, "1m", f1, y1, t1, c1)
f_draw_row(mtfDash, 2, "3m", f3, y3, t3, c3)
f_draw_row(mtfDash, 3, "5m", f5, y5, t5, c5)
f_draw_row(mtfDash, 4, "15m", f15, y15, t15, c15)
f_draw_row(mtfDash, 5, "30m", f30, y30, t30, c30)
f_draw_row(mtfDash, 6, "1S", f60, y60, t60, c60)
// ── VUR-KAΗ RADARI ──
table.cell(mtfDash, 0, 7, "── VUR-KAΗ RADARI ──", text_color=color.gray, text_size=size.small, bgcolor=color.new(color.black, 40))
table.merge_cells(mtfDash, 0, 7, 3, 7)
// Sinyal
string sigText = state == 1 ? "ALIM AKTέF" : state == -1 ? "SATIή AKTέF" : "BEKLENέYOR"
color sigCol = state == 1 ? #00e676 : state == -1 ? #ff1744 : #787b86
table.cell(mtfDash, 0, 8, "SέNYAL", text_color=color.white, text_size=size.small, bgcolor=color.new(color.black, 40))
table.cell(mtfDash, 1, 8, sigText, text_color=sigCol, text_size=size.small, bgcolor=color.new(color.black, 40))
table.merge_cells(mtfDash, 1, 8, 3, 8)
// Kinetik Stop (Yφrόk Kύrύlύmύ)
table.cell(mtfDash, 0, 9, "KέN. STOP", text_color=color.white, text_size=size.small, bgcolor=color.new(color.gray, 90))
table.cell(mtfDash, 1, 9, state != 0 ? str.tostring(math.round(curYoruk, 2)) : "-", text_color=#ff1744, text_size=size.small, bgcolor=color.new(color.gray, 90))
table.merge_cells(mtfDash, 1, 9, 3, 9)
// Kinetik TP (έvme Kaybύ / Ηekirdek)
table.cell(mtfDash, 0, 10, "KέN. TP", text_color=color.white, text_size=size.small, bgcolor=color.new(color.black, 40))
table.cell(mtfDash, 1, 10, state != 0 ? str.tostring(math.round(curCore, 2)) : "-", text_color=color.aqua, text_size=size.small, bgcolor=color.new(color.black, 40))
table.merge_cells(mtfDash, 1, 10, 3, 10)
// Sabit %1 Hedef
table.cell(mtfDash, 0, 11, "%" + str.tostring(i_tpPct) + " HEDEF", text_color=color.white, text_size=size.small, bgcolor=color.new(color.gray, 90))
table.cell(mtfDash, 1, 11, state != 0 ? str.tostring(math.round(statTp, 2)) : "-", text_color=#00e676, text_size=size.small, bgcolor=color.new(color.gray, 90))
table.merge_cells(mtfDash, 1, 11, 3, 11)
Yer έmleri