PHP Code:
//@version=6
indicator("Aİ", overlay=true, max_bars_back=1000)
// ==========================================
// 1. ANALİZ VE RİSK FONKSİYONU
// ==========================================
f_get_mtf_logic(res) =>
s1 = ta.sar(0.02, 0.02, 0.2)
s2 = ta.sar(0.015, 0.015, 0.15)
s3 = ta.sar(0.01, 0.01, 0.1)
avg = (s1 + s2 + s3) / 3
risk_range = math.abs(avg - s3)
is_b = close > avg
sl = is_b ? avg - risk_range : avg + risk_range
tp = is_b ? avg + (risk_range * 1.5) : avg - (risk_range * 1.5)
c_up = ta.crossover(close, s1)
c_dn = ta.crossunder(close, s1)
var int count = 0
if is_b != is_b[1]
count := 1
else
count += 1
[s1, s2, s3, avg, c_up, c_dn, count, sl, tp, is_b]
// Periyot Ayarları
p_l = array.from("1", "3", "5", "10", "15", "30", "45", "60", "120", "180", "240", "D", "W")
p_n = array.from("1DK", "3DK", "5DK", "10DK", "15DK", "30DK", "45DK", "1H", "2H", "3H", "4H", "GÜN", "HAFTA")
// ==========================================
// 2. EKRAN ORTASI SİNYAL UYARISI
// ==========================================
// 15 Dakikalık periyodu ana sinyal kaynağı olarak seçtik
[_, _, _, _, sig_up, sig_dn, _, _, _, _] = request.security(syminfo.tickerid, "5", f_get_mtf_logic("15"))
var table alert_box = table.new(position.middle_right, 1, 1)
if barstate.islast
if sig_up
table.cell(alert_box, 0, 0, "⚠️ 5DK TAZE BOĞA KIRILIMI!", bgcolor=color.new(color.lime, 10), text_color=color.black, text_size=size.huge)
else if sig_dn
table.cell(alert_box, 0, 0, "⚠️ 5DK TAZE AYI KIRILIMI!", bgcolor=color.new(color.orange, 10), text_color=color.black, text_size=size.huge)
// ==========================================
// 3. KÖŞE WIDGET & ANA TABLO
// ==========================================
// (Önceki v88 kodları burada eksiksiz devam eder...)
var table w = table.new(position.top_right, 2, 4, border_width = 1, border_color = color.gray)
if barstate.islast
table.cell(w, 0, 0, "SONUÇ", bgcolor=color.black, text_color=color.white, text_size=size.small)
table.cell(w, 1, 0, "DURUM", bgcolor=color.black, text_color=color.white, text_size=size.small)
[_,_,_,_,_,_,_,_,_,b5] = request.security(syminfo.tickerid, "5", f_get_mtf_logic("5"))
[_,_,_,_,_,_,_,_,_,b60] = request.security(syminfo.tickerid, "60", f_get_mtf_logic("60"))
[_,_,_,_,_,_,_,_,_,bd] = request.security(syminfo.tickerid, "D", f_get_mtf_logic("D"))
table.cell(w, 0, 1, "KISA (5D)", bgcolor=color.gray, text_color=color.white, text_size=size.small)
table.cell(w, 1, 1, b5 ? "BOĞA" : "AYI", bgcolor=b5 ? color.lime : color.red, text_color=color.black, text_size=size.small)
table.cell(w, 0, 2, "ORTA (1H)", bgcolor=color.gray, text_color=color.white, text_size=size.small)
table.cell(w, 1, 2, b60 ? "BOĞA" : "AYI", bgcolor=b60 ? color.lime : color.red, text_color=color.black, text_size=size.small)
table.cell(w, 0, 3, "UZUN (GÜN)", bgcolor=color.gray, text_color=color.white, text_size=size.small)
table.cell(w, 1, 3, bd ? "BOĞA" : "AYI", bgcolor=bd ? color.lime : color.red, text_color=color.black, text_size=size.small)
var table t = table.new(position.middle_center, 11, 16, border_width = 1, border_color = color.new(color.gray, 50))
if barstate.islast
// Başlıklar
headers = array.from("PERİYOT", "KISA", "ORTA", "UZUN", "ORT.", "YÖN", "STOP", "HEDEF", "DURUM", "SAYAÇ", "PUAN")
for i = 0 to 10
table.cell(t, i, 0, array.get(headers, i), bgcolor=color.black, text_color=color.white, text_size=size.large)
int tot_p = 0
for i = 0 to array.size(p_l) - 1
res = array.get(p_l, i)
[s1, s2, s3, avg, cup, cdn, cnt, sl, tp, is_b] = request.security(syminfo.tickerid, res, f_get_mtf_logic(res))
row = i + 1
color r_bg = is_b ? color.new(color.green, 40) : color.new(color.red, 40)
tot_p += (is_b ? (i < 3 ? 1 : i < 7 ? 2 : i < 11 ? 3 : 5) : 0)
bool fiyat_burada = (close >= math.min(s1, s3) and close <= math.max(s1, s3))
color aktif_c = fiyat_burada ? color.new(color.yellow, 20) : color.new(color.black, 40)
color txt_c = fiyat_burada ? color.black : color.white
table.cell(t, 0, row, array.get(p_n, i), bgcolor=fiyat_burada ? color.yellow : color.gray, text_color=txt_c, text_size=size.large)
table.cell(t, 1, row, str.tostring(s1, "#.#"), bgcolor=r_bg, text_color=color.white, text_size=size.large)
table.cell(t, 2, row, str.tostring(s2, "#.#"), bgcolor=r_bg, text_color=color.white, text_size=size.large)
table.cell(t, 3, row, str.tostring(s3, "#.#"), bgcolor=r_bg, text_color=color.white, text_size=size.large)
table.cell(t, 4, row, str.tostring(avg, "#.#"), bgcolor=r_bg, text_color=color.yellow, text_size=size.large)
table.cell(t, 5, row, is_b ? "BOĞA" : "AYI", bgcolor=is_b ? color.green : color.red, text_color=color.white, text_size=size.large)
table.cell(t, 6, row, str.tostring(sl, "#.#"), bgcolor=fiyat_burada ? color.red : aktif_c, text_color=txt_c, text_size=size.large)
table.cell(t, 7, row, str.tostring(tp, "#.#"), bgcolor=fiyat_burada ? color.green : aktif_c, text_color=txt_c, text_size=size.large)
string s_txt = cup ? "AL KIRILIM" : cdn ? "SAT KIRILIM" : "Stabil"
table.cell(t, 8, row, s_txt, bgcolor=cup ? color.lime : cdn ? color.orange : aktif_c, text_color=txt_c, text_size=size.large)
table.cell(t, 9, row, str.tostring(cnt) + " B", bgcolor=aktif_c, text_color=txt_c, text_size=size.large)
table.cell(t, 10, row, "+" + str.tostring(is_b ? (i < 3 ? 1 : i < 7 ? 2 : i < 11 ? 3 : 5) : 0), bgcolor=color.black, text_color=is_b ? color.lime : color.red, text_size=size.large)
table.merge_cells(t, 0, 14, 10, 14)
table.cell(t, 0, 14, "YATIRIM TAVSİYESİ DEĞİLDİR. @yörük@ 2026 SKOR: " + str.tostring(tot_p), bgcolor=color.orange, text_color=color.black, text_size=size.large)
Yer İmleri