Kod:
//@version=5
indicator("MTFIM", overlay=true, max_labels_count = 500)
// ==========================================
// --- BÖLÜM 1: KONTROL PANELİ ---
// ==========================================
priceFilterPercent = input.float(0.0, title="â–º Fiyat Uzaklık Filtresi (%)", minval=0.0, maxval=100.0, step=1.0, group="Genel Ayarlar")
f_isClose(level) =>
priceFilterPercent == 0 ? true : math.abs(level - close) / close * 100 <= priceFilterPercent
Hcol_1 = color.new(#97ffff, 0) //Yıllık Değerler
Hcol_2 = color.new(#ffffff, 0) //6 Aylık Değerler
Hcol_3 = color.new(#ee1289, 0) //3 Aylık Değerler
Hcol_4 = color.new(#1b8bb4, 0) //Aylık Değerler
Hcol_5 = color.new(#ffb90f, 0) //Haftalık Değerler
Hcol_6 = color.new(#0fff1b, 0) //Günlük Değerler
Hcol_7 = color.new(#8c00ff, 0) //240 DK Değerler
// --- ÖZEL PİVOT AYARLARI ---
//grp_piv = "Özel Pivot Ayarları"
grp_vis = "Pivot Seviye Görünümü"
piv_active = input.bool(false, "Pivot Sistemi Genel Aktif", group=grp_vis)
res = input.timeframe(title='Pivot Dirençleri Periyodu', defval='M', group=grp_vis)
piv_index = input.int(title = 'Pivot Bar İndeksi (0/1)', defval = 1, group=grp_vis)
show_HLC = input.bool(false, "Periyod HLC)", group=grp_vis)
show_PPH = input.bool(true, "PPD (Periyod Yüksek)", group=grp_vis)
show_PPL = input.bool(false, "PPD (Periyod Düşük)", group=grp_vis)
show_PPC = input.bool(false, "PPD (Periyod Kapanış)", group=grp_vis)
show_PPd = input.bool(true, "PPD (Pivot Noktası)", group=grp_vis)
show_PPw = input.bool(true, "PPW (Pivot Noktası)", group=grp_vis)
show_PPm = input.bool(true, "PPM (Pivot Noktası)", group=grp_vis)
show_PP3m = input.bool(true, "PP3M (Pivot Noktası)", group=grp_vis)
show_PP6m = input.bool(true, "PP6M (Pivot Noktası)", group=grp_vis)
show_PP12m = input.bool(true, "PP12M (Pivot Noktası)", group=grp_vis)
show_R1 = input.bool(true, "R1", group=grp_vis)
show_R2 = input.bool(false, "R2", group=grp_vis)
show_R3 = input.bool(false, "R3", group=grp_vis)
show_R4 = input.bool(false, "R4", group=grp_vis)
show_R5 = input.bool(false, "R5", group=grp_vis)
show_S1 = input.bool(true, "S1", group=grp_vis)
show_S2 = input.bool(false, "S2", group=grp_vis)
show_S3 = input.bool(false, "S3", group=grp_vis)
show_S4 = input.bool(false, "S4", group=grp_vis)
show_S5 = input.bool(false, "S5", group=grp_vis)
// --- Donchian ---
grp_donch = "Donchian-Orta Hat Kontrolü"
show_donch = input.bool(false, " HL Görünsün mu?", group=grp_donch)
show_donch_0 = input.bool(false, " Hhl", group=grp_donch)
show_donch_1 = input.bool(false, " Ahl", group=grp_donch)
show_donch_2 = input.bool(false, " 2Ahl", group=grp_donch)
show_donch_3 = input.bool(false, " 3Ahl", group=grp_donch)
show_donch_4 = input.bool(false, " 6Ahl", group=grp_donch)
show_donch_5 = input.bool(false, " Yhl", group=grp_donch)
// --- Ortalamalar ---
grp_sma = "Ortalama Ayarları"
sma_pr = input.string("5", "Zaman Dilimi", options=["5", "60", "120", "240", "D"], group=grp_sma)
show_sma = input.bool(false, " Ortalamalar?", group=grp_sma)
show_sma_20 = input.bool(false, " 20 Ort.", group=grp_sma)
show_sma_50 = input.bool(false, " 50 Ort.", group=grp_sma)
show_sma_100 = input.bool(false, " 100 Ort.", group=grp_sma)
show_sma_200 = input.bool(false, " 200 Ort.", group=grp_sma)
show_sma_500 = input.bool(false, " 500 Ort.", group=grp_sma)
// --- Ichimoku ---
grp_ichi = "Ichimoku Kanal Ayarları"
show_imd = input.bool(true, "IM Değerleri?", group=grp_ichi)
show_ichi_u = input.bool(true, " IM Üst Bant?", group=grp_ichi)
show_ichi_d = input.bool(true, " IM Alt Bant?", group=grp_ichi)
show_ichi_240 = input.bool(false, "240D Koridor", group=grp_ichi)
show_ichi_D = input.bool(false, "Günlük Koridor", group=grp_ichi)
show_ichi_W = input.bool(true, "Haftalık Koridor", group=grp_ichi)
show_ichi_M = input.bool(false, "Aylık Koridor", group=grp_ichi)
// --- Bollinger ---
grp_bb = "Bollinger Bant Kontrolü"
bb_active = input.bool(true, "Bollinger Aktif", group=grp_bb)
bb_tf = input.string("D", "Zaman Dilimi", options=["240", "D", "W", "M", "3M", "12M"], group=grp_bb)
show_basis = input.bool(false, "Orta Bant (Basis)", group=grp_bb)
show_devu = input.bool(false, "Bol Dirençler?", group=grp_bb)
show_devd = input.bool(false, "Bol Destekler?", group=grp_bb)
show_devu_1 = input.bool(false, "Dirençler 1?", group=grp_bb)
show_devu_2 = input.bool(false, "Dirençler 2?", group=grp_bb)
show_devu_3 = input.bool(false, "Dirençler 3?", group=grp_bb)
show_devu_4 = input.bool(false, "Dirençler 4?", group=grp_bb)
show_devu_5 = input.bool(false, "Dirençler 5?", group=grp_bb)
show_devd_1 = input.bool(false, "Destekler 1?", group=grp_bb)
show_devd_2 = input.bool(false, "Destekler 2?", group=grp_bb)
show_devd_3 = input.bool(false, "Destekler 3?", group=grp_bb)
show_devd_4 = input.bool(false, "Destekler 4?", group=grp_bb)
show_devd_5 = input.bool(false, "Destekler 5?", group=grp_bb)
// ==========================================
// --- BÖLÜM 2: HESAPLAMALAR ---
// ==========================================
// Alan-Satan Hesapları
tw = high - math.max(open, close)
bw = math.min(open, close) - low
body = math.abs(close - open)
_rate(cond) =>
0.5 * (tw + bw + (cond ? 2 * body : 0)) / (tw + bw + body)
volup = volume * _rate(open <= close)
voldown = volume * _rate(open >= close)
rate = ta.linreg(volup - voldown, 34, 0)
falling_1 = ta.falling(rate, 5)
rising_1 = ta.rising(rate, 5)
coly = rate > 0 ? color.green : rate < 0 ? color.red : na
plotcandle(open, high, low, close, 'fiyat', color = close < open ? color.red : color.green, bordercolor = close < open ? color.red : color.green, wickcolor=coly)
// HL Hesapları
f_donch_mid(len) => (ta.highest(high, len) + ta.lowest(low, len)) / 2
midx0 = request.security(syminfo.tickerid, "D", f_donch_mid(7)), midx1 = request.security(syminfo.tickerid, "D", f_donch_mid(26))
midx2 = request.security(syminfo.tickerid, "D", f_donch_mid(52)), midx3 = request.security(syminfo.tickerid, "D", f_donch_mid(78))
midx4 = request.security(syminfo.tickerid, "D", f_donch_mid(156)), midx5 = request.security(syminfo.tickerid, "D", f_donch_mid(312))
f_bb_data() =>
[m, u, l] = ta.bb(close, 20, 1) // Standart sapma 1 için hesapla
stdev_val = u - m // Standart sapma değerini bul
[m, stdev_val]
f_ichi() =>
h9 = ta.highest(9), l9 = ta.lowest(9), h26 = ta.highest(26), l26 = ta.lowest(26), h52 = ta.highest(52), l52 = ta.lowest(52)
tk = (h9 + l9) / 2, kj = (h26 + l26) / 2
sa = (tk[25] + kj[25]) / 2
sb = (h52[25] + l52[25]) / 2
[math.max(tk, kj, sa, sb), math.min(tk, kj, sa, sb)]
f_ichi_a() =>
h9 = ta.highest(9), l9 = ta.lowest(9), h26 = ta.highest(26), l26 = ta.lowest(26), h52 = ta.highest(52), l52 = ta.lowest(52)
tk = (h9 + l9) / 2, kj = (h26 + l26) / 2
sa = (tk[25] + kj[25]) / 2
sb = (h52[25] + l52[25]) / 2
[math.max(kj, sa, sb), math.min(kj, sa, sb)]
[it240, ib240] = request.security(syminfo.tickerid, "240", f_ichi_a(), lookahead = barmerge.lookahead_on)
[itD, ibD] = request.security(syminfo.tickerid, "D", f_ichi_a(), lookahead = barmerge.lookahead_on)
[itW, ibW] = request.security(syminfo.tickerid, "W", f_ichi(), lookahead = barmerge.lookahead_on)
[itM, ibM] = request.security(syminfo.tickerid, "M", f_ichi(), lookahead = barmerge.lookahead_on)
ma20 = request.security(syminfo.tickerid, sma_pr, ta.sma(close, 20)[piv_index], lookahead=barmerge.lookahead_on)
ma50 = request.security(syminfo.tickerid, sma_pr, ta.sma(close, 50)[piv_index], lookahead=barmerge.lookahead_on)
ma100 = request.security(syminfo.tickerid, sma_pr, ta.sma(close, 100)[piv_index], lookahead=barmerge.lookahead_on)
ma200 = request.security(syminfo.tickerid, sma_pr, ta.sma(close, 200)[piv_index], lookahead=barmerge.lookahead_on)
ma500 = request.security(syminfo.tickerid, sma_pr, ta.sma(close, 500)[piv_index], lookahead=barmerge.lookahead_on)
[bBas, bDev] = request.security(syminfo.tickerid, bb_tf, f_bb_data(), lookahead = barmerge.lookahead_on)
bb_color = bb_tf == "240" ? color.white : bb_tf == "D" ? Hcol_6 : bb_tf == "W" ? Hcol_5 : bb_tf == "M" ? Hcol_4 : Hcol_3
// --- ÖZEL PİVOT HESAPLAMA ---
PP = request.security(syminfo.tickerid, res, hlc3[piv_index], lookahead=barmerge.lookahead_on)
PPd = request.security(syminfo.tickerid, "D", hlc3[piv_index], lookahead=barmerge.lookahead_on)
PPw = request.security(syminfo.tickerid, "W", hlc3[piv_index], lookahead=barmerge.lookahead_on)
PPm = request.security(syminfo.tickerid, "M", hlc3[piv_index], lookahead=barmerge.lookahead_on)
PP3m = request.security(syminfo.tickerid, "3M", hlc3[piv_index], lookahead=barmerge.lookahead_on)
PP6m = request.security(syminfo.tickerid, "6M", hlc3[piv_index], lookahead=barmerge.lookahead_on)
PP12m = request.security(syminfo.tickerid, "12M", hlc3[piv_index], lookahead=barmerge.lookahead_on)
PP1 = request.security(syminfo.tickerid, res, hlc3, lookahead=barmerge.lookahead_on)
phigh = request.security(syminfo.tickerid, res, high[piv_index], lookahead=barmerge.lookahead_on)
plow = request.security(syminfo.tickerid, res, low[piv_index], lookahead=barmerge.lookahead_on)
pclose = request.security(syminfo.tickerid, res, close[piv_index], lookahead=barmerge.lookahead_on)
popen = request.security(syminfo.tickerid, res, open[piv_index], lookahead=barmerge.lookahead_on)
tr1 = PP * 2 - plow, ts1 = PP * 2 - phigh
tr2 = PP + phigh - plow, ts2 = PP - (phigh - plow)
tr3 = PP * 2 + phigh - 2 * plow, ts3 = PP * 2 - (2 * phigh - plow)
tr4 = PP * 3 + phigh - 3 * plow, ts4 = PP * 3 - (3 * phigh - plow)
tr5 = PP * 4 + phigh - 4 * plow, ts5 = PP * 4 - (3 * phigh - plow)
// ==========================================
// --- BÖLÜM 4: ÇİZİMLER ---
// ==========================================
// IchiMoku Çizimleri
IMU240 = plot(show_imd and show_ichi_u and show_ichi_240 and f_isClose(it240) ? it240: na, "240-IM Üst", color.new(Hcol_7, 50))
IMA240 = plot(show_imd and show_ichi_d and show_ichi_240 and f_isClose(ib240) ? ib240: na, "240-IM Alt", color.new(Hcol_7, 50))
fill(IMU240, IMA240, color.new(Hcol_7, 85))
IMUD = plot(show_imd and show_ichi_u and show_ichi_D and f_isClose(itD) ? itD: na, "D-IM Üst", color.new(Hcol_6, 50))
IMAD = plot(show_imd and show_ichi_d and show_ichi_D and f_isClose(ibD) ? ibD: na, "D-IM Alt", color.new(Hcol_6, 50))
fill(IMUD, IMAD, color.new(Hcol_6, 85))
IMUW = plot(show_imd and show_ichi_u and show_ichi_W and f_isClose(itW) ? itW: na, "W-IM Üst", color.new(Hcol_5, 50))
IMAW = plot(show_imd and show_ichi_d and show_ichi_W and f_isClose(ibW) ? ibW: na, "W-IM Alt", color.new(Hcol_5, 50))
fill(IMUW, IMAW, color.new(Hcol_5, 85))
IMUM = plot(show_imd and show_ichi_u and show_ichi_M and f_isClose(itM) ? itM: na, "M-IM Üst", color.new(Hcol_4, 50))
IMAM = plot(show_imd and show_ichi_d and show_ichi_M and f_isClose(ibM) ? ibM: na, "M-IM Alt", color.new(Hcol_4, 50))
fill(IMUM, IMAM, color.new(Hcol_4, 85))
// HL Çizimleri
plot(show_donch and show_donch_0 and f_isClose(midx0) ? midx0 : na, "7", color=color.new(color.red , 10), linewidth=1)
plot(show_donch and show_donch_1 and f_isClose(midx1) ? midx1 : na, "26", color=color.new(Hcol_4, 50), linewidth=1, style = plot.style_cross)
plot(show_donch and show_donch_2 and f_isClose(midx2) ? midx2 : na, "52", color=color.new(#002fff, 50), linewidth=1, style = plot.style_cross)
plot(show_donch and show_donch_3 and f_isClose(midx3) ? midx3 : na, "78", color=color.new(Hcol_3, 50), linewidth=1, style = plot.style_cross)
plot(show_donch and show_donch_4 and f_isClose(midx4) ? midx4 : na, "180", color=color.new(Hcol_2, 50), linewidth=1, style = plot.style_cross)
plot(show_donch and show_donch_5 and f_isClose(midx5) ? midx5 : na, "360", color=color.new(Hcol_1, 5), linewidth=1, style = plot.style_cross)
// Ortalama Çizimleri
plot(show_sma and show_sma_20 and f_isClose(ma20) ? ma20 : na, "MA20", color=color.new(#ff0037, 0), style = plot.style_cross)
plot(show_sma and show_sma_50 and f_isClose(ma50) ? ma50 : na, "MA50", color=color.new(#0099ff, 50), style = plot.style_cross)
plot(show_sma and show_sma_100 and f_isClose(ma100) ? ma100 : na, "MA100", color=color.new(#f6fcfb, 50), style = plot.style_cross)
plot(show_sma and show_sma_200 and f_isClose(ma200) ? ma200 : na, "MA200", color=color.new(#002fff, 50), style = plot.style_cross)
plot(show_sma and show_sma_500 and f_isClose(ma500) ? ma500 : na, "MA500", color=color.new(#eb14c7, 50), style = plot.style_cross)
// Bollinger Çizimleri
plot(bb_active and show_basis and f_isClose(bBas) ? bBas : na, "Basis", color=bb_color)
plot(bb_active and show_devu and show_devu_1 and f_isClose(bBas + bDev*1) ? bBas + bDev*1 : na, "U1", color=color.new(bb_color, 60))
plot(bb_active and show_devu and show_devu_2 and f_isClose(bBas + bDev*2) ? bBas + bDev*2 : na, "U2", color=color.new(bb_color, 60))
plot(bb_active and show_devu and show_devu_3 and f_isClose(bBas + bDev*3) ? bBas + bDev*3 : na, "U3", color=color.new(bb_color, 60))
plot(bb_active and show_devu and show_devu_4 and f_isClose(bBas + bDev*4) ? bBas + bDev*4 : na, "U4", color=color.new(bb_color, 60))
plot(bb_active and show_devu and show_devu_5 and f_isClose(bBas + bDev*5) ? bBas + bDev*5 : na, "U5", color=color.new(bb_color, 60))
plot(bb_active and show_devd and show_devd_1 and f_isClose(bBas - bDev*1) ? bBas - bDev*1 : na, "D1", color=color.new(bb_color, 60))
plot(bb_active and show_devd and show_devd_2 and f_isClose(bBas - bDev*2) ? bBas - bDev*2 : na, "D2", color=color.new(bb_color, 60))
plot(bb_active and show_devd and show_devd_3 and f_isClose(bBas - bDev*3) ? bBas - bDev*3 : na, "D3", color=color.new(bb_color, 60))
plot(bb_active and show_devd and show_devd_4 and f_isClose(bBas - bDev*4) ? bBas - bDev*4 : na, "D4", color=color.new(bb_color, 60))
plot(bb_active and show_devd and show_devd_5 and f_isClose(bBas - bDev*5) ? bBas - bDev*5 : na, "D5", color=color.new(bb_color, 60))
// Pivot Çizimleri
plot(piv_active and show_PPd and f_isClose(PPd) ? PPd : na, color=Hcol_6, title='dP', style=plot.style_stepline)
plot(piv_active and show_PPw and f_isClose(PPw) ? PPw : na, color=Hcol_5, title='wP', style=plot.style_stepline)
plot(piv_active and show_PPm and f_isClose(PPm) ? PPm : na, color=Hcol_4, title='mP', style=plot.style_stepline)
plot(piv_active and show_PP3m and f_isClose(PP3m) ? PP3m : na, color=Hcol_3, title='3mP', style=plot.style_stepline)
plot(piv_active and show_PP6m and f_isClose(PP6m) ? PP6m : na, color=Hcol_2, title='6mP', style=plot.style_stepline)
plot(piv_active and show_PP12m and f_isClose(PP12m) ? PP12m : na, color=Hcol_1, title='12mP', style=plot.style_stepline)
plot(piv_active and show_R5 and f_isClose(tr5) ? tr5 : na, color=color.new(#7fff00, 0), title='R5', style=plot.style_stepline)
plot(piv_active and show_R4 and f_isClose(tr4) ? tr4 : na, color=color.new(#458b00, 0), title='R4', style=plot.style_stepline)
plot(piv_active and show_R3 and f_isClose(tr3) ? tr3 : na, color=color.new(#caff70, 0), title='R3', style=plot.style_stepline)
plot(piv_active and show_R2 and f_isClose(tr2) ? tr2 : na, color=color.new(#8b8b00, 0), title='R2', style=plot.style_stepline)
plot(piv_active and show_R1 and f_isClose(tr1) ? tr1 : na, color=color.new(#e900e9, 0), title='R1', style=plot.style_stepline)
//plot(piv_active and show_PP and f_isClose(PP) ? PP : na, color=#ffeb3b, title='PP', linewidth=2, style=plot.style_stepline)
//plot(piv_active and show_PP1 and f_isClose(PP1) ? PP1 : na, color=#ffeb3b, title='PP1', linewidth=1, style=plot.style_stepline_diamond)
plot(piv_active and show_S1 and f_isClose(ts1) ? ts1 : na, color=color.new(#e900e9, 0), title='S1', style=plot.style_stepline)
plot(piv_active and show_S2 and f_isClose(ts2) ? ts2 : na, color=color.new(#ff6a6a, 0), title='S2', style=plot.style_stepline)
//plot(piv_active and show_S3 and f_isClose(ts3) ? ts3 : na, color=color.new(#ff3030, 0), title='S3', style=plot.style_stepline)
//plot(piv_active and show_S4 and f_isClose(ts4) ? ts4 : na, color=color.new(#c71585, 0), title='S4', style=plot.style_stepline)
//plot(piv_active and show_S4 and f_isClose(ts4) ? ts4 : na, color=color.new(#c71585, 0), title='S4', style=plot.style_stepline)
plot(show_HLC and show_PPH and f_isClose(phigh) ? phigh : na, color=color.new(#00ff0d, 0), title='H', style=plot.style_stepline)
plot(show_HLC and show_PPC and f_isClose(pclose) ? pclose : na, color=color.new(#f7fc00, 0), title='C', style=plot.style_stepline)
plot(show_HLC and show_PPL and f_isClose(plow) ? plow : na, color=color.new(#fc0000, 0), title='L', style=plot.style_stepline)
//Formasyon alanı.
// === INPUTLAR ===
zigZagLen = input.int(10, title="ZigZag Derinlik")
dtbTol = input.float(0.03, title="Klasik Tolerans")
h_tol = input.float(0.05, title="Harmonik Tolerans")
minDist = input.float(5.0, title="Min. Mesafe Filtresi (%)")
boxTransP = input.int(85, title="Kutu Şeffaflığı (0-100)")
showVisuals = input.bool(false, title="Grafik Üzerinde Kutuları Göster", tooltip="Kapatılırsa sadece Dashboard görünür.")
// === DASHBOARD YARDIMCI FONKSİYONU (GLOBAL KAPSAMDA) ===
f_fillRow(_table, _r, _tf, _txt, _bg, _t, _d, _wr, _id, _h, _s) =>
_active = (_id != 0 and not _h and not _s)
table.cell(_table, 0, _r, _tf, text_color=color.white)
table.cell(_table, 1, _r, _active ? _txt : (_s ? "Stop-Loss" : "Yok"), bgcolor=_active ? _bg : (_s ? color.maroon : na), text_color=color.white)
table.cell(_table, 2, _r, _active ? str.tostring(_t, "#.##") : "-", text_color=color.white)
table.cell(_table, 3, _r, _active ? str.tostring(_d, "#.##") + "%" : "-", text_color=color.white)
table.cell(_table, 4, _r, str.tostring(_wr, "#.#") + "%", bgcolor=_bg, text_color=color.white)
// === FORMASYON TARAMA FONKSİYONU ===
f_scan() =>
_ph = ta.pivothigh(high, zigZagLen, zigZagLen)
_pl = ta.pivotlow(low, zigZagLen, zigZagLen)
_h1 = ta.valuewhen(not na(_ph), high[zigZagLen], 0), _h2 = ta.valuewhen(not na(_ph), high[zigZagLen], 1), _h3 = ta.valuewhen(not na(_ph), high[zigZagLen], 2)
_l1 = ta.valuewhen(not na(_pl), low[zigZagLen], 0), _l2 = ta.valuewhen(not na(_pl), low[zigZagLen], 1), _l3 = ta.valuewhen(not na(_pl), low[zigZagLen], 2)
_XA = math.abs(_h2 - _l3), _AB = math.abs(_h2 - _l2), _BC = math.abs(_h1 - _l2)
_ret_B = _AB / _XA, _ret_C = _BC / _AB
_isTT = math.abs(_h1 - _h2) / _h1 < dtbTol and math.abs(_h2 - _h3) / _h2 < dtbTol and ta.crossunder(close, _l1)
_isTB = math.abs(_l1 - _l2) / _l1 < dtbTol and math.abs(_l2 - _l3) / _l2 < dtbTol and ta.crossover(close, _h1)
_isDT = not _isTT and math.abs(_h1 - _h2) / _h1 < dtbTol and ta.crossunder(close, _l1)
_isDB = not _isTB and math.abs(_l1 - _l2) / _l1 < dtbTol and ta.crossover(close, _h1)
_isOBO = _h2 > _h3 and _h2 > _h1 and ta.crossunder(close, math.min(_l1, _l2))
_isTOBO = _l2 < _l3 and _l2 < _l1 and ta.crossover(close, math.max(_h1, _h2))
_isFlag = math.abs(_h2 - _l2) > (3 * math.abs(_h1 - _l1)) and ta.crossover(close, _h1)
_isCup = math.abs(_h3 - _h1) / _h3 < dtbTol and _l2 < _l1 and _l2 < _l3 and ta.crossover(close, _h1)
_isHarmonic = (_ret_B >= 0.382 and _ret_B <= 0.886) and (_ret_C >= 0.382 and _ret_C <= 1.618)
string _n = "Yok", float _t = 0.0, float _sl = 0.0, color _c = color.new(color.gray, 80), int _id = 0
if _isTT or _isDT or _isOBO
_n := _isTT ? "ÜÇLÜ TEPE" : _isOBO ? "OBO" : "İKİLİ TEPE", _t := _l1 - (_h1 - _l1), _sl := _h1, _c := color.red, _id := 1
else if _isTB or _isDB or _isTOBO or _isCup or _isFlag
_n := _isTB ? "ÜÇLÜ DİP" : _isTOBO ? "TOBO" : _isFlag ? "BAYRAK" : _isCup ? "ÇANAK-K" : "İKİLİ DİP"
_t := _h1 + (_h1 - _l1), _sl := _l1, _c := color.green, _id := 2
else if _isHarmonic
_n := "HARMONİK", _t := _l3 + (_XA * 0.786), _sl := _l2, _c := color.blue, _id := 3
_dist = _t > 0 ? (math.abs(_t - close) / close) * 100 : 0.0
if _dist < minDist
_n := "Yok", _t := 0.0, _sl := 0.0, _id := 0
var int _total = 0, var int _wins = 0, var float _actT = na, var float _actSL = na, var bool _long = false
_entry = false, _hit = false, _stopped = false
_changed = not na(ta.change(_id)) and ta.change(_id) != 0
if _id != 0 and _changed
_total += 1, _actT := _t, _actSL := _sl, _long := (_c != color.red), _entry := true
if not na(_actT)
_hit := _long ? high >= _actT : low <= _actT
_stopped := _long ? low <= _actSL : high >= _actSL
if _hit
_wins += 1, _actT := na, _actSL := na
else if _stopped
_actT := na, _actSL := na
_wr = _total > 0 ? (_wins / float(_total)) * 100 : 0.0
[_n, _c, _t, _dist, _wr, _id, _hit, _entry, _stopped]
// === VERİ ÇEKİMİ ===
[txt5, bg5, t5, d5, wr5, id5, h5, e5, s5] = request.security(syminfo.tickerid, "5", f_scan())
[txt60, bg60, t60, d60, wr60, id60, h60, e60, s60] = request.security(syminfo.tickerid, "60", f_scan())
[txt240, bg240, t240, d240, wr240, id240, h240, e240, s240] = request.security(syminfo.tickerid, "240", f_scan())
[txtD, bgD, tD, dD, wrD, idD, hD, eD, sD] = request.security(syminfo.tickerid, "D", f_scan())
// === GÖRSELLEŞTİRME ===
[cN, cC, cT, cD, cWR, cID, cHit, cEntry, cStopped] = f_scan()
var box activeBox = na
var label activeLabel = na
// Görselleştirme Kontrolü
if showVisuals
if cEntry
box.delete(activeBox), label.delete(activeLabel)
activeBox := box.new(bar_index, close, bar_index + 25, cT, border_color=cC, bgcolor=color.new(cC, boxTransP), text=cN, text_color=color.white, text_size=size.tiny)
activeLabel := label.new(bar_index, close, "GİRİŞ: " + cN, color=cC, textcolor=color.white, style=label.style_label_down, size=size.tiny)
if cHit or cStopped
box.delete(activeBox), label.delete(activeLabel)
else
// Eğer kullanıcı görselleştirmeyi kapattıysa mevcut çizimleri temizle
box.delete(activeBox), label.delete(activeLabel)
// === DASHBOARD TABLOSU ===
var table dash1 = table.new(position.bottom_right, 5, 5, border_width=1, border_color=color.gray, bgcolor=color.new(color.black, 20))
if barstate.islast
table.cell(dash1, 0, 0, "PERİYOT", bgcolor=color.gray, text_color=color.white)
table.cell(dash1, 1, 0, "FORMASYON", bgcolor=color.gray, text_color=color.white)
table.cell(dash1, 2, 0, "HEDEF", bgcolor=color.gray, text_color=color.white)
table.cell(dash1, 3, 0, "MESAFE %", bgcolor=color.gray, text_color=color.white)
table.cell(dash1, 4, 0, "BAŞARI %", bgcolor=color.gray, text_color=color.white)
f_fillRow(dash1, 1, "5 DK", txt5, bg5, t5, d5, wr5, id5, h5, s5)
f_fillRow(dash1, 2, "60 DK", txt60, bg60, t60, d60, wr60, id60, h60, s60)
f_fillRow(dash1, 3, "240 DK", txt240, bg240, t240, d240, wr240, id240, h240, s240)
f_fillRow(dash1, 4, "GÜNLÜK", txtD, bgD, tD, dD, wrD, idD, hD, sD)
Yer İmleri