PHP Code:
//@version=6
indicator("Devasa Hýzlý SAR Tarayýcý [Grup Seçmeli]", overlay=true)
// ─────────────────────────────────────────────────────────────────
// 1. GRUP SEÇÝMÝ VE VÝRGÜLLÜ LÝSTELER
// ─────────────────────────────────────────────────────────────────
grp_ayar = "Tarama Gruplarý (Virgülle Ayýrýn)"
secilen_grup = input.string("Grup 1", "Taranacak Grubu Seçin", options=["Grup 1", "Grup 2", "Grup 3", "Grup 4", "Grup 5", "Grup 6", "Grup 7", "Grup 8", "Grup 9", "Grup 10"], group=grp_ayar)
// Kullanýcý bu listeleri ayarlardan istediði gibi deðiþtirebilir. (Aralarýna virgül koymak þartýyla)
g1 = input.string("BIST:THYAO, BIST:TUPRS, BIST:ASELS, BIST:KCHOL, BIST:EREGL, BIST:AKBNK, BIST:YKBNK, BIST:ISCTR, BIST:GARAN, BIST:SAHOL, BIST:SISE, BIST:PETKM, BIST:BIMAS, BIST:PGSUS, BIST:FROTO, BIST:TOASO, BIST:TCELL, BIST:TTKOM, BIST:ENKAI, BIST:KOZAL", "Grup 1 Listesi", group=grp_ayar)
g2 = input.string("BIST:HEKTS, BIST:SASA, BIST:ASTOR, BIST:ALARK, BIST:TAVHL, BIST:DOAS, BIST:MGROS, BIST:OTKAR, BIST:VESBE, BIST:ARCLK, BIST:KRDMD, BIST:ENJSA, BIST:ODAS, BIST:GWIND, BIST:SMRTG, BIST:EUPWR, BIST:GESAN, BIST:KONTR, BIST:YEOTK, BIST:MIATK", "Grup 2 Listesi", group=grp_ayar)
g3 = input.string("", "Grup 3 Listesi", group=grp_ayar)
g4 = input.string("", "Grup 4 Listesi", group=grp_ayar)
g5 = input.string("", "Grup 5 Listesi", group=grp_ayar)
g6 = input.string("", "Grup 6 Listesi", group=grp_ayar)
g7 = input.string("", "Grup 7 Listesi", group=grp_ayar)
g8 = input.string("", "Grup 8 Listesi", group=grp_ayar)
g9 = input.string("", "Grup 9 Listesi", group=grp_ayar)
g10 = input.string("", "Grup 10 Listesi", group=grp_ayar)
// Seçilen kaseti (grubu) makineye yüklüyoruz
aktif_liste = secilen_grup == "Grup 1" ? g1 : secilen_grup == "Grup 2" ? g2 : secilen_grup == "Grup 3" ? g3 : secilen_grup == "Grup 4" ? g4 : secilen_grup == "Grup 5" ? g5 : secilen_grup == "Grup 6" ? g6 : secilen_grup == "Grup 7" ? g7 : secilen_grup == "Grup 8" ? g8 : secilen_grup == "Grup 9" ? g9 : g10
var string[] semboller = str.split(aktif_liste, ",")
// Eðer kutu boþsa veya 20'den az hisse yazýldýysa motorun çökmemesi için güvenlik filtresi
f_sym(idx) =>
array.size(semboller) > idx and str.length(str.trim(array.get(semboller, idx))) > 0 ? str.trim(array.get(semboller, idx)) : syminfo.tickerid
s01 = f_sym(0), s02 = f_sym(1), s03 = f_sym(2), s04 = f_sym(3), s05 = f_sym(4)
s06 = f_sym(5), s07 = f_sym(6), s08 = f_sym(7), s09 = f_sym(8), s10 = f_sym(9)
s11 = f_sym(10), s12 = f_sym(11), s13 = f_sym(12), s14 = f_sym(13), s15 = f_sym(14)
s16 = f_sym(15), s17 = f_sym(16), s18 = f_sym(17), s19 = f_sym(18), s20 = f_sym(19)
// ─────────────────────────────────────────────────────────────────
// 2. SADECE "HIZLI SAR" MOTORU (MTK-1-2-3 Daire Formu)
// ─────────────────────────────────────────────────────────────────
f_ozel_sar(src_h, src_l, _start, _inc, _max, _reset_hiz) =>
var int trend = 0
var float sar_val = 0.0
var float ep = 0.0
var float af = 0.0
if trend == 0 and not na(src_h[1])
trend := src_h >= src_h[1] or src_l >= src_l[1] ? 1 : -1
sar_val := trend > 0 ? src_l[1] : src_h[1]
ep := trend > 0 ? src_h[1] : src_l[1]
af := _start
else
if _reset_hiz
af := _start
float nextsar = sar_val
if trend > 0
if src_h[1] > ep
ep := src_h[1]
af := math.min(_max, af + _inc)
nextsar := sar_val + af * (ep - sar_val)
nextsar := math.min(math.min(src_l[1], src_l[2]), nextsar)
if nextsar > src_l
trend := -1
nextsar := ep
ep := src_l
af := _start
else
if src_l[1] < ep
ep := src_l[1]
af := math.min(_max, af + _inc)
nextsar := sar_val + af * (ep - sar_val)
nextsar := math.max(math.max(src_h[1], src_h[2]), nextsar)
if nextsar < src_h
trend := 1
nextsar := ep
ep := src_h
af := _start
sar_val := nextsar
[sar_val, trend]
f_veri_paketi() =>
yeni_gun = ta.change(time("D")) != 0
[sar_hizli, _] = f_ozel_sar(high, low, 0.06, 0.06, 0.30, yeni_gun)
is_up = close > sar_hizli
[close, sar_hizli, is_up]
// ─────────────────────────────────────────────────────────────────
// 3. SEÇÝLEN 20 VARLIKTAN VERÝ ÇEKÝMÝ
// ─────────────────────────────────────────────────────────────────
[c01, sr01, up01] = request.security(s01, timeframe.period, f_veri_paketi(), lookahead=barmerge.lookahead_off)
[c02, sr02, up02] = request.security(s02, timeframe.period, f_veri_paketi(), lookahead=barmerge.lookahead_off)
[c03, sr03, up03] = request.security(s03, timeframe.period, f_veri_paketi(), lookahead=barmerge.lookahead_off)
[c04, sr04, up04] = request.security(s04, timeframe.period, f_veri_paketi(), lookahead=barmerge.lookahead_off)
[c05, sr05, up05] = request.security(s05, timeframe.period, f_veri_paketi(), lookahead=barmerge.lookahead_off)
[c06, sr06, up06] = request.security(s06, timeframe.period, f_veri_paketi(), lookahead=barmerge.lookahead_off)
[c07, sr07, up07] = request.security(s07, timeframe.period, f_veri_paketi(), lookahead=barmerge.lookahead_off)
[c08, sr08, up08] = request.security(s08, timeframe.period, f_veri_paketi(), lookahead=barmerge.lookahead_off)
[c09, sr09, up09] = request.security(s09, timeframe.period, f_veri_paketi(), lookahead=barmerge.lookahead_off)
[c10, sr10, up10] = request.security(s10, timeframe.period, f_veri_paketi(), lookahead=barmerge.lookahead_off)
[c11, sr11, up11] = request.security(s11, timeframe.period, f_veri_paketi(), lookahead=barmerge.lookahead_off)
[c12, sr12, up12] = request.security(s12, timeframe.period, f_veri_paketi(), lookahead=barmerge.lookahead_off)
[c13, sr13, up13] = request.security(s13, timeframe.period, f_veri_paketi(), lookahead=barmerge.lookahead_off)
[c14, sr14, up14] = request.security(s14, timeframe.period, f_veri_paketi(), lookahead=barmerge.lookahead_off)
[c15, sr15, up15] = request.security(s15, timeframe.period, f_veri_paketi(), lookahead=barmerge.lookahead_off)
[c16, sr16, up16] = request.security(s16, timeframe.period, f_veri_paketi(), lookahead=barmerge.lookahead_off)
[c17, sr17, up17] = request.security(s17, timeframe.period, f_veri_paketi(), lookahead=barmerge.lookahead_off)
[c18, sr18, up18] = request.security(s18, timeframe.period, f_veri_paketi(), lookahead=barmerge.lookahead_off)
[c19, sr19, up19] = request.security(s19, timeframe.period, f_veri_paketi(), lookahead=barmerge.lookahead_off)
[c20, sr20, up20] = request.security(s20, timeframe.period, f_veri_paketi(), lookahead=barmerge.lookahead_off)
// ─────────────────────────────────────────────────────────────────
// 4. YENÝ ÝNCE TABLO MOTORU (SADECE HIZLI SAR)
// ─────────────────────────────────────────────────────────────────
var table radar = table.new(position.bottom_right, 4, 21, border_width=1, border_color=color.gray)
f_satir_ekle(r_idx, sym, c_val, sr_val, is_up) =>
// Sadece listede gerçekten yazýlý olan hisseleri tabloya çizer
if array.size(semboller) > r_idx - 1 and str.length(str.trim(array.get(semboller, r_idx - 1))) > 0
sym_isim = str.split(sym, ":").last()
col_bg = is_up ? color.new(color.lime, 30) : color.new(color.red, 30)
durum_txt = is_up ? "AL ▲" : "SAT ▼"
table.cell(radar, 0, r_idx, sym_isim, text_color=color.white, bgcolor=color.black, text_size=size.small)
table.cell(radar, 1, r_idx, str.tostring(c_val, format.mintick), text_color=color.white, bgcolor=color.new(color.black, 40), text_size=size.small)
table.cell(radar, 2, r_idx, str.tostring(sr_val, format.mintick), text_color=color.white, bgcolor=col_bg, text_size=size.small)
table.cell(radar, 3, r_idx, durum_txt, text_color=color.white, bgcolor=col_bg, text_size=size.small)
if barstate.islast
table.cell(radar, 0, 0, "VARLIK (" + secilen_grup + ")", text_color=color.white, bgcolor=color.black, text_size=size.small)
table.cell(radar, 1, 0, "FÝYAT", text_color=color.white, bgcolor=color.black, text_size=size.small)
table.cell(radar, 2, 0, "HIZLI SAR", text_color=color.white, bgcolor=color.black, text_size=size.small)
table.cell(radar, 3, 0, "DURUM", text_color=color.white, bgcolor=color.black, text_size=size.small)
f_satir_ekle(1, s01, c01, sr01, up01)
f_satir_ekle(2, s02, c02, sr02, up02)
f_satir_ekle(3, s03, c03, sr03, up03)
f_satir_ekle(4, s04, c04, sr04, up04)
f_satir_ekle(5, s05, c05, sr05, up05)
f_satir_ekle(6, s06, c06, sr06, up06)
f_satir_ekle(7, s07, c07, sr07, up07)
f_satir_ekle(8, s08, c08, sr08, up08)
f_satir_ekle(9, s09, c09, sr09, up09)
f_satir_ekle(10, s10, c10, sr10, up10)
f_satir_ekle(11, s11, c11, sr11, up11)
f_satir_ekle(12, s12, c12, sr12, up12)
f_satir_ekle(13, s13, c13, sr13, up13)
f_satir_ekle(14, s14, c14, sr14, up14)
f_satir_ekle(15, s15, c15, sr15, up15)
f_satir_ekle(16, s16, c16, sr16, up16)
f_satir_ekle(17, s17, c17, sr17, up17)
f_satir_ekle(18, s18, c18, sr18, up18)
f_satir_ekle(19, s19, c19, sr19, up19)
f_satir_ekle(20, s20, c20, sr20, up20)
Yer Ýmleri