PHP Code:
//@version=6
indicator(":]", overlay=true, max_lines_count=50, max_labels_count=500)
// ==========================================
// 1. 5 KADEMELέ EXTENDED SAR MOTORU
// ==========================================
sarext(simple float start_value=0.0, simple float offset_on_reverse=0.0,
simple float af_init_long=0., simple float af_long=0.02, simple float af_max_long=0.20,
simple float af_init_short=0., simple float af_short=0.02, simple float af_max_short=0.20) =>
if af_init_long < 0
runtime.error("AF init long must be >= 0")
if af_long < 0
runtime.error("AF long must be >= 0")
if af_max_long < af_init_long
runtime.error("AF max long must be >= AF init long")
if af_init_short < 0
runtime.error("AF init short must be >= 0")
if af_short < 0
runtime.error("AF short must be >= 0")
if af_max_short < af_init_short
runtime.error("AF max short must be >= AF init short")
var bool is_long = true
var float sar = na
var float ep = na
var float af = af_init_long
var float result = na
if bar_index == 0
result := na
else if bar_index == 1
if start_value > 0
is_long := true
sar := math.abs(start_value)
else if start_value < 0
is_long := false
sar := math.abs(start_value)
else
float plus_dm = high - high[1]
float minus_dm = low[1] - low
if plus_dm < 0
plus_dm := 0
if minus_dm < 0
minus_dm := 0
is_long := plus_dm > minus_dm
sar := is_long ? low[1] : high[1]
ep := is_long ? high : low
af := is_long ? af_init_long : af_init_short
if is_long
if sar > low[1]
sar := low[1]
if sar > low
sar := low
else
if sar < high[1]
sar := high[1]
if sar < high
sar := high
result := is_long ? sar : -sar
else
float new_sar = sar + af * (ep - sar)
if is_long
new_sar := math.min(new_sar, low[1])
new_sar := math.min(new_sar, low[2])
if low < new_sar
is_long := false
new_sar := ep
if offset_on_reverse != 0
new_sar := new_sar + offset_on_reverse
ep := low
af := af_init_short
else
if high > ep
ep := high
af := math.min(af + af_long, af_max_long)
else
new_sar := math.max(new_sar, high[1])
new_sar := math.max(new_sar, high[2])
if high > new_sar
is_long := true
new_sar := ep
if offset_on_reverse != 0
new_sar := new_sar - offset_on_reverse
ep := high
af := af_init_long
else
if low < ep
ep := low
af := math.min(af + af_short, af_max_short)
sar := new_sar
result := is_long ? new_sar : -new_sar
result
// έvme (AF) Deπerleri
i_af_h1 = 0.20 // Hύzlύ 1
i_af_h2 = 0.05 // Hύzlύ 2
i_af_de = 0.02 // Denge
i_af_y1 = 0.005 // Yavaώ 1
i_af_y2 = 0.001 // Yavaώ 2
i_af_mx = 0.2
// Motorlarύ Ηalύώtύr
s_h1 = sarext(0.0, 0.0, i_af_h1, i_af_h1, math.max(i_af_h1, i_af_mx), i_af_h1, i_af_h1, math.max(i_af_h1, i_af_mx))
s_h2 = sarext(0.0, 0.0, i_af_h2, i_af_h2, math.max(i_af_h2, i_af_mx), i_af_h2, i_af_h2, math.max(i_af_h2, i_af_mx))
s_de = sarext(0.0, 0.0, i_af_de, i_af_de, math.max(i_af_de, i_af_mx), i_af_de, i_af_de, math.max(i_af_de, i_af_mx))
s_y1 = sarext(0.0, 0.0, i_af_y1, i_af_y1, math.max(i_af_y1, i_af_mx), i_af_y1, i_af_y1, math.max(i_af_y1, i_af_mx))
s_y2 = sarext(0.0, 0.0, i_af_y2, i_af_y2, math.max(i_af_y2, i_af_mx), i_af_y2, i_af_y2, math.max(i_af_y2, i_af_mx))
// ==========================================
// 2. HAKέKέ AYNA (SέMETRέK HEDEF HESAPLAMASI)
// ==========================================
// Denge (0.02) motorunun mesafesini alύp fiyatύn karώύ tarafύna yansύtan Ayna Formόlό
float s_de_abs = math.abs(s_de)
bool is_de_up = s_de > 0
float delta_de = math.abs(close - s_de_abs)
float raw_mirror = is_de_up ? close + delta_de : close - delta_de
float ayna_hma = ta.hma(raw_mirror, 55) // Pόrόzsόzleώtirilmiώ Yansύma Hedefi
// ==========================================
// 3. HAFIZA VE KIRILIM MANTIΠI
// ==========================================
var float p_h1 = na, var float n_h1 = na
var float p_h2 = na, var float n_h2 = na
var float p_de = na, var float n_de = na
var float p_y1 = na, var float n_y1 = na
var float p_y2 = na, var float n_y2 = na
bool is_p_h1 = s_h1 > 0
bool is_p_h2 = s_h2 > 0
bool is_p_de = s_de > 0
bool is_p_y1 = s_y1 > 0
bool is_p_y2 = s_y2 > 0
if is_p_h1
p_h1 := math.abs(s_h1)
else
n_h1 := math.abs(s_h1)
if is_p_h2
p_h2 := math.abs(s_h2)
else
n_h2 := math.abs(s_h2)
if is_p_de
p_de := math.abs(s_de)
else
n_de := math.abs(s_de)
if is_p_y1
p_y1 := math.abs(s_y1)
else
n_y1 := math.abs(s_y1)
if is_p_y2
p_y2 := math.abs(s_y2)
else
n_y2 := math.abs(s_y2)
bool prev_h1 = bar_index > 0 ? is_p_h1[1] : is_p_h1
bool prev_h2 = bar_index > 0 ? is_p_h2[1] : is_p_h2
bool prev_de = bar_index > 0 ? is_p_de[1] : is_p_de
bool prev_y1 = bar_index > 0 ? is_p_y1[1] : is_p_y1
bool prev_y2 = bar_index > 0 ? is_p_y2[1] : is_p_y2
bool brk_h1_neg = prev_h1 and not is_p_h1
bool brk_h1_pos = not prev_h1 and is_p_h1
bool brk_h2_neg = prev_h2 and not is_p_h2
bool brk_h2_pos = not prev_h2 and is_p_h2
bool brk_de_neg = prev_de and not is_p_de
bool brk_de_pos = not prev_de and is_p_de
bool brk_y1_neg = prev_y1 and not is_p_y1
bool brk_y1_pos = not prev_y1 and is_p_y1
bool brk_y2_neg = prev_y2 and not is_p_y2
bool brk_y2_pos = not prev_y2 and is_p_y2
// ==========================================
// 4. AΠI EKRANA ΗέZME VE HESAPLAMALAR
// ==========================================
//plot(is_p_h1 ? math.abs(s_h1) : na, "H1 (+)", color=color.new(color.yellow, 0), style=plot.style_cross, linewidth=2)
//plot(not is_p_h1 ? math.abs(s_h1) : na, "H1 (-)", color=color.new(color.yellow, 0), style=plot.style_cross, linewidth=2)
//plot(is_p_h2 ? math.abs(s_h2) : na, "H2 (+)", color=color.new(color.yellow, 0), style=plot.style_cross, linewidth=2)
//plot(not is_p_h2 ? math.abs(s_h2) : na, "H2 (-)", color=color.new(color.yellow, 0), style=plot.style_cross, linewidth=2)
//plot(is_p_de ? math.abs(s_de) : na, "D(+)", color=color.new(color.lime, 0), style=plot.style_line, linewidth=2)
//plot(not is_p_de ? math.abs(s_de) : na, "D(-)", color=color.new(color.red, 0), style=plot.style_line, linewidth=2)
// ALTIN AYNAYI ΗέZME (Gelecek Hedefi)
//plot(ayna_hma, "SarAyna", color=color.new(#f700ff, 0), linewidth=2, style=plot.style_line)
//plot(is_p_y1 ? math.abs(s_y1) : na, "Y1 (+)", color=color.new(color.blue, 0), style=plot.style_cross, linewidth=2)
//plot(not is_p_y1 ? math.abs(s_y1) : na, "Y1 (-)", color=color.new(color.blue, 0), style=plot.style_cross, linewidth=2)
//plot(is_p_y2 ? math.abs(s_y2) : na, "Y2 (+)", color=color.new(color.blue, 0), style=plot.style_cross, linewidth=2)
//plot(not is_p_y2 ? math.abs(s_y2) : na, "Y2 (-)", color=color.new(color.blue, 0), style=plot.style_cross, linewidth=2)
float avg_sar_val = (math.abs(s_h1) + math.abs(s_h2) + math.abs(s_de) + math.abs(s_y1) + math.abs(s_y2)) / 5.0
// TEMέZ HAVA SAHASI: DURUM HESAPLAMASI
bool durum_al = (close > n_de) and (close > p_h1) and (close > n_h1) and (close > p_h2) and (close > n_h2)
bool durum_sat = (close < p_de) and (close < p_h1) and (close < n_h1) and (close < p_h2) and (close < n_h2)
string durum_metni = durum_al ? "AL" : durum_sat ? "SAT" : "BEKLE"
color durum_rengi = durum_al ? color.lime : durum_sat ? color.red : color.gray
color durum_yazi_rengi = durum_al ? color.black : durum_sat ? color.white : color.black
// ==========================================
// 5. MOMENTUM RADARLI KOMUTA MERKEZέ
// ==========================================
var table dash = table.new(position.top_right, 3, 16, border_width = 1, border_color = color.new(color.gray, 80))
if barstate.islast
table.cell(dash, 0, 0, "@yφrόk@ Yatύrύm Tavsiyesi DEΠέLDέR.", text_color=color.white, bgcolor=color.new(color.black, 0), text_size=size.normal, text_halign=text.align_center)
table.merge_cells(dash, 0, 0, 2, 0)
table.cell(dash, 0, 1, "Anlύk Fiyat:", text_color=color.white, bgcolor=color.new(color.black, 40), text_halign=text.align_left)
table.cell(dash, 1, 1, str.tostring(close, format.mintick), text_color=color.white, bgcolor=color.new(color.black, 40), text_halign=text.align_right)
table.merge_cells(dash, 1, 1, 2, 1)
table.cell(dash, 0, 2, "Ortak Merkez (Ort):", text_color=color.yellow, bgcolor=color.new(color.black, 40), text_halign=text.align_left)
table.cell(dash, 1, 2, str.tostring(avg_sar_val, format.mintick), text_color=color.yellow, bgcolor=color.new(color.black, 40), text_halign=text.align_right)
table.merge_cells(dash, 1, 2, 2, 2)
table.cell(dash, 0, 3, "Genel Durum:", text_color=color.white, bgcolor=color.new(color.black, 40), text_halign=text.align_left)
table.cell(dash, 1, 3, durum_metni, text_color=durum_yazi_rengi, bgcolor=durum_rengi, text_halign=text.align_right)
table.merge_cells(dash, 1, 3, 2, 3)
// ALTIN AYNA HEDEF SATIRI EKLENDέ
table.cell(dash, 0, 4, "Hedef (TP/SL):", text_color=#FFD700, bgcolor=color.new(color.black, 40), text_halign=text.align_left)
table.cell(dash, 1, 4, str.tostring(ayna_hma, format.mintick), text_color=#FFD700, bgcolor=color.new(color.black, 40), text_halign=text.align_right)
table.cell(dash, 2, 4, is_de_up ? "DέRENΗ" : "DESTEK", text_color=color.black, bgcolor=#FFD700, text_halign=text.align_center)
// --- HIZLI 1 (0.20) ---
c_bg_p1 = brk_h1_neg ? color.yellow : color.new(color.black, 40)
c_tx_p1 = brk_h1_neg ? color.black : (is_p_h1 ? color.lime : color.gray)
t_st_p1 = brk_h1_neg ? "KIRILDI!" : (is_p_h1 ? "AKTέF (+)" : "Pasif")
table.cell(dash, 0, 5, "Hύzlύ 1 (+):", text_color=color.gray, bgcolor=color.new(color.black, 40), text_halign=text.align_left)
table.cell(dash, 1, 5, str.tostring(p_h1, format.mintick), text_color=c_tx_p1, bgcolor=c_bg_p1, text_halign=text.align_right)
table.cell(dash, 2, 5, t_st_p1, text_color=c_tx_p1, bgcolor=c_bg_p1, text_halign=text.align_center)
c_bg_n1 = brk_h1_pos ? color.yellow : color.new(color.black, 40)
c_tx_n1 = brk_h1_pos ? color.black : (not is_p_h1 ? color.red : color.gray)
t_st_n1 = brk_h1_pos ? "KIRILDI!" : (not is_p_h1 ? "AKTέF (-)" : "Pasif")
table.cell(dash, 0, 6, "Hύzlύ 1 (-):", text_color=color.gray, bgcolor=color.new(color.black, 40), text_halign=text.align_left)
table.cell(dash, 1, 6, str.tostring(n_h1, format.mintick), text_color=c_tx_n1, bgcolor=c_bg_n1, text_halign=text.align_right)
table.cell(dash, 2, 6, t_st_n1, text_color=c_tx_n1, bgcolor=c_bg_n1, text_halign=text.align_center)
// --- HIZLI 2 (0.05) ---
c_bg_p2 = brk_h2_neg ? color.yellow : color.new(color.black, 40)
c_tx_p2 = brk_h2_neg ? color.black : (is_p_h2 ? color.lime : color.gray)
t_st_p2 = brk_h2_neg ? "KIRILDI!" : (is_p_h2 ? "AKTέF (+)" : "Pasif")
table.cell(dash, 0, 7, "Hύzlύ 2 (+):", text_color=color.gray, bgcolor=color.new(color.black, 40), text_halign=text.align_left)
table.cell(dash, 1, 7, str.tostring(p_h2, format.mintick), text_color=c_tx_p2, bgcolor=c_bg_p2, text_halign=text.align_right)
table.cell(dash, 2, 7, t_st_p2, text_color=c_tx_p2, bgcolor=c_bg_p2, text_halign=text.align_center)
c_bg_n2 = brk_h2_pos ? color.yellow : color.new(color.black, 40)
c_tx_n2 = brk_h2_pos ? color.black : (not is_p_h2 ? color.red : color.gray)
t_st_n2 = brk_h2_pos ? "KIRILDI!" : (not is_p_h2 ? "AKTέF (-)" : "Pasif")
table.cell(dash, 0, 8, "Hύzlύ 2 (-):", text_color=color.gray, bgcolor=color.new(color.black, 40), text_halign=text.align_left)
table.cell(dash, 1, 8, str.tostring(n_h2, format.mintick), text_color=c_tx_n2, bgcolor=c_bg_n2, text_halign=text.align_right)
table.cell(dash, 2, 8, t_st_n2, text_color=c_tx_n2, bgcolor=c_bg_n2, text_halign=text.align_center)
// --- DENGE (0.02) ---
c_bg_pd = brk_de_neg ? color.yellow : color.new(color.black, 40)
c_tx_pd = brk_de_neg ? color.black : (is_p_de ? color.lime : color.gray)
t_st_pd = brk_de_neg ? "KIRILDI!" : (is_p_de ? "AKTέF (+)" : "Pasif")
table.cell(dash, 0, 9, "Denge (+):", text_color=color.gray, bgcolor=color.new(color.black, 40), text_halign=text.align_left)
table.cell(dash, 1, 9, str.tostring(p_de, format.mintick), text_color=c_tx_pd, bgcolor=c_bg_pd, text_halign=text.align_right)
table.cell(dash, 2, 9, t_st_pd, text_color=c_tx_pd, bgcolor=c_bg_pd, text_halign=text.align_center)
c_bg_nd = brk_de_pos ? color.yellow : color.new(color.black, 40)
c_tx_nd = brk_de_pos ? color.black : (not is_p_de ? color.red : color.gray)
t_st_nd = brk_de_pos ? "KIRILDI!" : (not is_p_de ? "AKTέF (-)" : "Pasif")
table.cell(dash, 0, 10, "Denge (-):", text_color=color.gray, bgcolor=color.new(color.black, 40), text_halign=text.align_left)
table.cell(dash, 1, 10, str.tostring(n_de, format.mintick), text_color=c_tx_nd, bgcolor=c_bg_nd, text_halign=text.align_right)
table.cell(dash, 2, 10, t_st_nd, text_color=c_tx_nd, bgcolor=c_bg_nd, text_halign=text.align_center)
// --- YAVAή 1 (0.005) ---
c_bg_py1 = brk_y1_neg ? color.yellow : color.new(color.black, 40)
c_tx_py1 = brk_y1_neg ? color.black : (is_p_y1 ? color.lime : color.gray)
t_st_py1 = brk_y1_neg ? "KIRILDI!" : (is_p_y1 ? "AKTέF (+)" : "Pasif")
table.cell(dash, 0, 11, "Yavaώ 1 (+):", text_color=color.gray, bgcolor=color.new(color.black, 40), text_halign=text.align_left)
table.cell(dash, 1, 11, str.tostring(p_y1, format.mintick), text_color=c_tx_py1, bgcolor=c_bg_py1, text_halign=text.align_right)
table.cell(dash, 2, 11, t_st_py1, text_color=c_tx_py1, bgcolor=c_bg_py1, text_halign=text.align_center)
c_bg_ny1 = brk_y1_pos ? color.yellow : color.new(color.black, 40)
c_tx_ny1 = brk_y1_pos ? color.black : (not is_p_y1 ? color.red : color.gray)
t_st_ny1 = brk_y1_pos ? "KIRILDI!" : (not is_p_y1 ? "AKTέF (-)" : "Pasif")
table.cell(dash, 0, 12, "Yavaώ 1 (-):", text_color=color.gray, bgcolor=color.new(color.black, 40), text_halign=text.align_left)
table.cell(dash, 1, 12, str.tostring(n_y1, format.mintick), text_color=c_tx_ny1, bgcolor=c_bg_ny1, text_halign=text.align_right)
table.cell(dash, 2, 12, t_st_ny1, text_color=c_tx_ny1, bgcolor=c_bg_ny1, text_halign=text.align_center)
// --- YAVAή 2 (0.001) ---
c_bg_py2 = brk_y2_neg ? color.yellow : color.new(color.black, 40)
c_tx_py2 = brk_y2_neg ? color.black : (is_p_y2 ? color.lime : color.gray)
t_st_py2 = brk_y2_neg ? "KIRILDI!" : (is_p_y2 ? "AKTέF (+)" : "Pasif")
table.cell(dash, 0, 13, "Yavaώ 2 (+):", text_color=color.gray, bgcolor=color.new(color.black, 40), text_halign=text.align_left)
table.cell(dash, 1, 13, str.tostring(p_y2, format.mintick), text_color=c_tx_py2, bgcolor=c_bg_py2, text_halign=text.align_right)
table.cell(dash, 2, 13, t_st_py2, text_color=c_tx_py2, bgcolor=c_bg_py2, text_halign=text.align_center)
c_bg_ny2 = brk_y2_pos ? color.yellow : color.new(color.black, 40)
c_tx_ny2 = brk_y2_pos ? color.black : (not is_p_y2 ? color.red : color.gray)
t_st_ny2 = brk_y2_pos ? "KIRILDI!" : (not is_p_y2 ? "AKTέF (-)" : "Pasif")
table.cell(dash, 0, 14, "Yavaώ 2 (-):", text_color=color.gray, bgcolor=color.new(color.black, 40), text_halign=text.align_left)
table.cell(dash, 1, 14, str.tostring(n_y2, format.mintick), text_color=c_tx_ny2, bgcolor=c_bg_ny2, text_halign=text.align_right)
table.cell(dash, 2, 14, t_st_ny2, text_color=c_tx_ny2, bgcolor=c_bg_ny2, text_halign=text.align_center)
// ==========================================
// 6. SAVAή BORUSU (ALARM ENTEGRASYONU)
// ==========================================
alertcondition(durum_al and barstate.isconfirmed, title="🟢 HάCUM: Temiz Hava Sahasύ!", message="Bόtόn direnηler kύrύldύ! Yφn: YUKARI (AL)")
alertcondition(durum_sat and barstate.isconfirmed, title="🔴 Dάήάή: Aπύr Baskύ!", message="Bόtόn destekler kύrύldύ! Yφn: AήAΠI (SAT)")
//////////////
// ==========================================
// ┌──────────────────────────────────────────────────────────────────────────────┐
// │ 1. SAR MOTORLARI (HIZLI VE YAVAή) │
// └──────────────────────────────────────────────────────────────────────────────┘
float yemre = ta.sar(0., 0.01, 0.2)
float yusuf = ta.sar(0., 0.05, 0.2)
float fato = ta.sar(0., 0.09, 0.2)
float mf = (yemre + yusuf + fato) / 3
// ==========================================
// 5. KALKAN GάCά (MUM BOYAMA)
// ==========================================
int kalkan = 0
if close > yemre
kalkan += 1
if close > yusuf
kalkan += 1
if close > fato
kalkan += 1
if close < yemre and close < mf
kalkan += 1
if close < yusuf and close < mf
kalkan += 1
if close < fato and close < mf
kalkan += 1
color bar_col = na
if kalkan >= 3
bar_col := close > mf ? color.rgb(0, 255, 132, 50) : color.rgb(250, 4, 4, 50)
else if kalkan == 2
bar_col := color.rgb(21, 5, 249)
else
bar_col := color.rgb(212, 3, 249)
barcolor(bar_col)
// ==========================================
//////////////////
// έMZA
var table ytd_table = table.new(position.bottom_center, 1, 1)
if barstate.islast
table.cell(ytd_table, 0, 0, "(Aέ) Eπitim ηalύώmasύdύr. Yatύrύm tavsiyesi KULLANILAMAZ.", text_color=color.new(color.white, 00), text_size=size.normal)
/////////////////
Yer έmleri