PHP Code:
// © Kinetik Komuta Merkezi - Master Hub (v5 - FINAL + S1 TP/SL Kalkaný)
//@version=6
indicator("KKM Master Hub", overlay=true, max_labels_count=50, max_lines_count=50, max_boxes_count=50)
// ─────────────────────────────────────────────────────────────────
// A. MASTER ÞALTER (SÝSTEM SEÇÝCÝ)
// ─────────────────────────────────────────────────────────────────
var string SYS1 = "1. Scalping Trade (1m)"
var string SYS2 = "2. Swing Trade (Üçlü Kral)"
var string SYS3 = "3. Scalping + Swing Trade"
var string SYS4 = "4. Day Trade"
var string SYS5 = "5. Otonom Trade"
aktif_sistem = input.string(SYS1, "Aktif Sistemi Seç", options=[SYS1, SYS2, SYS3, SYS4, SYS5])
// Þalter Kontrolleri
bool is_sys1 = aktif_sistem == SYS1
bool is_sys2 = aktif_sistem == SYS2
bool is_sys3 = aktif_sistem == SYS3
bool is_sys4 = aktif_sistem == SYS4
bool is_sys5 = aktif_sistem == SYS5
// Ortak Renk Paleti
color col_up = color.new(#00e676, 0)
color col_dn = color.new(#ff1744, 0)
color col_gri = color.new(color.white, 0)
// ─────────────────────────────────────────────────────────────────
// 0. GLOBAL KÝNETÝK MOTOR VE FONKSÝYONLAR (Ortak)
// ─────────────────────────────────────────────────────────────────
f_kutu_kutle(series float src, int _atrLen, float _atrMult, float _mu) =>
float threshold = ta.atr(_atrLen) * _atrMult
var float z = na
var float v = 0.0
if bar_index == 0
z := src
else
float zPrev = z[1]
float vPrev = v[1]
float zPred = zPrev + vPrev
float zTemp = zPred + _mu * (src - 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
[z, v]
f_kutu_kutle_z(series float src, int _atrLen, float _atrMult, float _mu) =>
[z_val, _] = f_kutu_kutle(src, _atrLen, _atrMult, _mu)
z_val
f_ozel_sar(src_h, src_l, _start, _inc, _max) =>
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
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_zlema(series float src, simple int len) =>
float ema1 = ta.ema(src, len)
float ema2 = ta.ema(ema1, len)
ema1 + (ema1 - ema2)
type SARState
float sar_value
float extreme_point
float accel_factor
bool isLong
int trend_age
int bounce_count
bool was_touching
method f_updateState(SARState state, float src_val, float accel_start, float accel_inc, float accel_max, float decay_limit, float atr_val) =>
bool isInitialTrend = false
bool trend_changed = false
if na(state.sar_value)
state.isLong := src_val > src_val[1] ? true : false
state.extreme_point := src_val
state.sar_value := state.isLong ? src_val[1] - atr_val : src_val[1] + atr_val
isInitialTrend := true
state.accel_factor := accel_start
state.trend_age := 0
else
state.trend_age += 1
state.sar_value += state.accel_factor * (state.extreme_point - state.sar_value)
if state.isLong
if state.sar_value > src_val
trend_changed := true
state.isLong := false
state.sar_value := math.max(src_val, state.extreme_point)
state.extreme_point := src_val
state.accel_factor := accel_start
state.trend_age := 0
else
if state.sar_value < src_val
trend_changed := true
state.isLong := true
state.sar_value := math.min(src_val, state.extreme_point)
state.extreme_point := src_val
state.accel_factor := accel_start
state.trend_age := 0
if trend_changed
state.bounce_count := 0
state.was_touching := false
else
float tol = atr_val * 0.1
bool is_touch = state.isLong ? (src_val <= state.sar_value + tol) : (src_val >= state.sar_value - tol)
if is_touch and not state.was_touching
state.bounce_count += 1
state.was_touching := is_touch
float decay_factor = math.max(0.01, 1.0 - (state.trend_age / decay_limit))
float yasli_inc = accel_inc * decay_factor
if not isInitialTrend
if state.isLong
if src_val > state.extreme_point
state.extreme_point := src_val
state.accel_factor := math.min(state.accel_factor + yasli_inc, accel_max)
else
if src_val < state.extreme_point
state.extreme_point := src_val
state.accel_factor := math.min(state.accel_factor + yasli_inc, accel_max)
if bar_index > 1
state.sar_value := state.isLong ? math.min(state.sar_value, src_val[1]) : math.max(state.sar_value, src_val[1])
state
// =================================================================
// SÝSTEM 1: SCALPING TRADE (Kinetik Kütle + Kinetik SAR + TP/SL KUTU)
// =================================================================
string GRP1 = "1. SCALPING TRADE AYARLARI"
float s1_start = input.float(0.02, "SAR Baþlangýç", step=0.01, group=GRP1)
float s1_inc = input.float(0.02, "SAR Artýþ", step=0.01, group=GRP1)
float s1_max = input.float(0.2, "SAR Maksimum", step=0.01, group=GRP1)
// Otonom TP/SL Girdileri
float s1_sl_atr = input.float(1.5, "Otonom SL (ATR Çarpaný)", step=0.1, group=GRP1)
float s1_rr = input.float(2.0, "Otonom TP (Risk/Ödül Oraný)", step=0.1, group=GRP1)
float s1_kin_z = f_kutu_kutle_z(hl2, 50, 1.5, 0.9)
var float s1_k_sar = na
var int s1_trend = 0
var float s1_ep = 0.0
var float s1_af = s1_start
if bar_index > 1
if s1_trend == 0
s1_trend := s1_kin_z > s1_kin_z[1] ? 1 : -1
s1_k_sar := s1_trend == 1 ? low[1] : high[1]
s1_ep := s1_trend == 1 ? high[1] : low[1]
s1_af := s1_start
else
s1_k_sar := s1_k_sar + s1_af * (s1_ep - s1_k_sar)
if s1_trend == 1
if s1_kin_z < s1_k_sar
s1_trend := -1
s1_k_sar := s1_ep
s1_ep := s1_kin_z
s1_af := s1_start
else
if s1_kin_z > s1_ep
s1_ep := s1_kin_z
s1_af := math.min(s1_max, s1_af + s1_inc)
else
if s1_kin_z > s1_k_sar
s1_trend := 1
s1_k_sar := s1_ep
s1_ep := s1_kin_z
s1_af := s1_start
else
if s1_kin_z < s1_ep
s1_ep := s1_kin_z
s1_af := math.min(s1_max, s1_af + s1_inc)
bool s1_earlyWarn = math.abs(s1_kin_z - s1_k_sar) < (ta.stdev(s1_kin_z, 20) * 0.5)
plot(s1_earlyWarn ? na : s1_k_sar, "S1: Kinetik SAR", style=plot.style_line, linewidth=1, color=color.new(s1_trend == 1 ? col_up : col_dn, 0), display=is_sys1 ? display.all : display.none)
plot(s1_kin_z, "S1: Kinetik Kütle", color=color.new(color.fuchsia, 0), linewidth=1, style=plot.style_stepline, display=is_sys1 ? display.all : display.none)
// --- SÝSTEM 1: OTONOM KÂR AL / ZARAR KES KUTULARI ---
bool s1_buy_sig = s1_trend == 1 and s1_trend[1] == -1
bool s1_sell_sig = s1_trend == -1 and s1_trend[1] == 1
var int s1_trade_dir = 0
var float s1_entry_p = na
var float s1_sl_p = na
var float s1_tp_p = na
var box s1_sl_box = na
var box s1_tp_box = na
// Sistem deðiþtirilirse kutularý gizle
var bool was_sys1 = is_sys1
if is_sys1 != was_sys1
if not is_sys1
box.delete(s1_sl_box)
box.delete(s1_tp_box)
was_sys1 := is_sys1
if s1_buy_sig or s1_sell_sig
s1_trade_dir := s1_buy_sig ? 1 : -1
s1_entry_p := close
float atr_val = ta.atr(14)
s1_sl_p := s1_buy_sig ? s1_entry_p - (atr_val * s1_sl_atr) : s1_entry_p + (atr_val * s1_sl_atr)
float risk = math.abs(s1_entry_p - s1_sl_p)
s1_tp_p := s1_buy_sig ? s1_entry_p + (risk * s1_rr) : s1_entry_p - (risk * s1_rr)
if is_sys1
if not na(s1_sl_box)
box.delete(s1_sl_box)
if not na(s1_tp_box)
box.delete(s1_tp_box)
s1_sl_box := box.new(bar_index, s1_entry_p, bar_index + 2, s1_sl_p, bgcolor=color.new(col_dn, 85), border_color=color.new(col_dn, 30), text="SL", text_halign=text.align_right, text_valign=s1_buy_sig ? text.align_bottom : text.align_top, text_color=color.new(col_dn, 30), text_size=size.small)
s1_tp_box := box.new(bar_index, s1_tp_p, bar_index + 2, s1_entry_p, bgcolor=color.new(col_up, 85), border_color=color.new(col_up, 30), text="TP", text_halign=text.align_right, text_valign=s1_buy_sig ? text.align_top : text.align_bottom, text_color=color.new(col_up, 30), text_size=size.small)
// Aktif iþlemi takip et ve kutularý uzat
if s1_trade_dir != 0
if is_sys1
box.set_right(s1_sl_box, bar_index + 1)
box.set_right(s1_tp_box, bar_index + 1)
// Hedeflere çarpma kontrolü
bool hit_sl = (s1_trade_dir == 1 and low <= s1_sl_p) or (s1_trade_dir == -1 and high >= s1_sl_p)
bool hit_tp = (s1_trade_dir == 1 and high >= s1_tp_p) or (s1_trade_dir == -1 and low <= s1_tp_p)
if hit_sl or hit_tp
s1_trade_dir := 0 // Ýþlemi bitir
if is_sys1
// Ýþlem bitince kutularý soluklaþtýrýp ekranda geçmiþ olarak býrak
box.set_bgcolor(s1_tp_box, color.new(col_gri, 95))
box.set_border_color(s1_tp_box, color.new(col_gri, 90))
box.set_bgcolor(s1_sl_box, color.new(col_gri, 95))
box.set_border_color(s1_sl_box, color.new(col_gri, 90))
// =================================================================
// SÝSTEM 2: SWING TRADE (Üçlü KSAR Senfonisi)
// =================================================================
string GRP2 = "2. SWING TRADE AYARLARI"
float s2_atrMult = input.float(3.5, "Kinetik Gürültü Duvarý", group=GRP2)
float s2_mu = input.float(0.6, "Yakýnsaklýk (μ)", group=GRP2)
f_get_king_s2(int _len) =>
var float[] fibs = array.from(1.0, 2.0, 3.0, 5.0, 8.0, 13.0, 21.0, 34.0, 55.0)
var states = array.new<SARState>()
if barstate.isfirst
for i = 0 to 8
states.push(SARState.new(na, na, 0.01, false, 0, 0, false))
float kin_z = f_kutu_kutle_z(hl2, _len, s2_atrMult, s2_mu)
float atr_v = ta.atr(14)
for i = 0 to 8
SARState s = states.get(i)
s.f_updateState(kin_z, 0.01, 0.02, 0.20, fibs.get(i), atr_v)
var int king_idx = 8
int new_king = -1
for i = 0 to 8
if states.get(i).bounce_count >= 2
new_king := i
break
if new_king != -1
king_idx := new_king
[states.get(king_idx).sar_value, states.get(king_idx).isLong]
[s2_k50_val, s2_k50_long] = f_get_king_s2(50)
[s2_k100_val, s2_k100_long] = f_get_king_s2(100)
[s2_k200_val, s2_k200_long] = f_get_king_s2(200)
plot(s2_k50_val, "S2: Hýzlý Kral (50)", color=color.new(s2_k50_long ? col_up : col_dn, 0), linewidth=1, display=is_sys2 ? display.all : display.none)
plot(s2_k100_val, "S2: Orta Kral (100)", color=color.new(s2_k100_long ? col_up : col_dn, 0), linewidth=1, display=is_sys2 ? display.all : display.none)
plot(s2_k200_val, "S2: Makro Kral (200)", color=color.new(s2_k200_long ? col_up : col_dn, 0), linewidth=1, display=is_sys2 ? display.all : display.none)
// =================================================================
// SÝSTEM 3: SCALPING + SWING TRADE
// =================================================================
string GRP3 = "3. SCALPING + SWING TRADE AYARLARI"
string s3_symB = input.symbol("BIST:XU100", "Kýyaslanacak Endeks / Hisse", group=GRP3)
float s3_celik_zemin = f_kutu_kutle_z(hl2, 200, 3.5, 0.6)
float s3_tetikci_z = f_kutu_kutle_z(hl2, 50, 1.5, 0.9)
bool s3_kutle_al = ta.crossover(s3_tetikci_z, s3_celik_zemin)
bool s3_kutle_sat = ta.crossunder(s3_tetikci_z, s3_celik_zemin)
plotshape(is_sys3 and s3_kutle_al, "S3 AL", shape.triangleup, location.belowbar, color=color.new(col_up, 50), size=size.large)
plotshape(is_sys3 and s3_kutle_sat, "S3 SAT", shape.triangledown, location.abovebar, color=color.new(col_dn, 50), size=size.large)
float s3_kin_z_y = f_kutu_kutle_z(hl2, 5, 2.5, 0.9)
[s3_s_mavi1, _] = f_ozel_sar(s3_kin_z_y, s3_kin_z_y, 0.003, 0.003, 0.02)
[s3_s_mavi2, _] = f_ozel_sar(s3_kin_z_y, s3_kin_z_y, 0.001, 0.001, 0.02)
[s3_s_mavi3, _] = f_ozel_sar(s3_kin_z_y, s3_kin_z_y, 0.0005, 0.0005, 0.02)
float s3_mavi_kalkan = (s3_s_mavi1 + s3_s_mavi2 + s3_s_mavi3) / 3
[s3_s_sari1, _] = f_ozel_sar(s3_kin_z_y, s3_kin_z_y, 0.01, 0.01, 0.2)
[s3_s_sari2, _] = f_ozel_sar(s3_kin_z_y, s3_kin_z_y, 0.01, 0.02, 0.2)
[s3_s_sari3, _] = f_ozel_sar(s3_kin_z_y, s3_kin_z_y, 0.01, 0.03, 0.2)
float s3_sari_kalkan = (s3_s_sari1 + s3_s_sari2 + s3_s_sari3) / 3
plot(s3_mavi_kalkan, "S3 Mavi", color=hl2 > s3_mavi_kalkan ? col_up : col_dn, linewidth=1, display=is_sys3 ? display.all : display.none)
plot(s3_sari_kalkan, "S3 Sarý", color=hl2 > s3_sari_kalkan ? col_up : col_dn, linewidth=1, display=is_sys3 ? display.all : display.none)
plot(ta.sar(0.001, 0.0005, 0.02), "S3 Y", color.new(#040cfb, 0), 1, plot.style_cross, display=is_sys3 ? display.all : display.none)
plot(ta.sar(0.01, 0.03, 0.2), "S3 X", style=plot.style_cross, color=color.new(color.yellow, 0), linewidth=1, display=is_sys3 ? display.all : display.none)
[s3_sar_hizli, s3_trend_hizli] = f_ozel_sar(high, low, 0.06, 0.06, 0.30)
float s3_ayna_hizli = s3_trend_hizli > 0 ? hl2 + math.abs(hl2 - s3_sar_hizli) : hl2 - math.abs(hl2 - s3_sar_hizli)
plot(s3_ayna_hizli, "S3 Aynasý", color=s3_ayna_hizli > hl2 ? col_up : col_dn, style=plot.style_line, linewidth=1, display=is_sys3 ? display.all : display.none)
// =================================================================
// SÝSTEM 4: DAY TRADE
// =================================================================
string GRP4 = "4. DAY TRADE AYARLARI"
int s4_atrLen = input.int(5, "Kinetik Hafýza", group=GRP4)
float s4_atrMult = input.float(2.5, "Gürültü Duvarý", step=0.1, group=GRP4)
float s4_mu = input.float(0.9, "Yakýnsaklýk", step=0.1, group=GRP4)
string s4_symB = input.symbol("BIST:XU100", "Kýyas Endeksi", group=GRP4)
int s4_zLenFast = input.int(55, "ZLEMA Hýzlý", group=GRP4)
int s4_zLenSlow = input.int(233, "ZLEMA Yavaþ", group=GRP4)
float s4_kin_z = f_kutu_kutle_z(hl2, s4_atrLen, s4_atrMult, s4_mu)
plot(s4_kin_z, "S4 Kütle", color=color.new(color.fuchsia, 0), style=plot.style_stepline, linewidth=1, display=is_sys4 ? display.all : display.none)
plot(ta.sar(0.01, 0.03, 0.2), "S4 X", style=plot.style_cross, color=color.new(color.yellow, 0), linewidth=1, display=is_sys4 ? display.all : display.none)
[s4_c2, s4_hl2_2] = request.security(s4_symB, timeframe.period, [close, hl2], lookahead=barmerge.lookahead_off)
float s4_rs_c = close / s4_c2
bool s4_isBullFast = s4_rs_c > f_zlema(hl2 / s4_hl2_2, s4_zLenFast)
bool s4_isBullSlow = s4_rs_c > f_zlema(hl2 / s4_hl2_2, s4_zLenSlow)
color s4_barCol = (s4_isBullFast and s4_isBullSlow) ? color.new(color.yellow,0) : (not s4_isBullFast and not s4_isBullSlow) ? color.new(color.fuchsia,0) : s4_isBullFast ? col_up : col_dn
float s4_tetikci_z = f_kutu_kutle_z(hl2, 50, 1.5, 0.9)
plot(s4_tetikci_z, "S4 TETÝKÇÝ", color=color.new(color.fuchsia, 0), linewidth=1, style=plot.style_stepline, display=is_sys4 ? display.all : display.none)
float s4_o377 = f_zlema(ta.median(hl2, 233), 610)
plot(s4_o377, "S4 Omurga 377", color=color.fuchsia, linewidth=1, display=is_sys4 ? display.all : display.none)
plotshape(is_sys4 and ta.crossover(s4_tetikci_z, s4_o377), "S4 AL", shape.triangleup, location.belowbar, color=col_up, size=size.large)
plotshape(is_sys4 and ta.crossunder(s4_tetikci_z, s4_o377), "S4 SAT", shape.triangledown, location.abovebar, color=col_dn, size=size.large)
// =================================================================
// SÝSTEM 5: OTONOM TRADE
// =================================================================
string GRP5 = "5. OTONOM TRADE AYARLARI"
string s5_symB = input.symbol("BIST:XU100", "Z-RS Kýyas Endeksi", group=GRP5)
string s5_hft_res = input.timeframe("5", "Kurumsal MTF Çapasý (Örn: 5m)", group=GRP5)
int s5_atrLen = input.int(10, "L1 Hafýza (ATR)", group=GRP5)
float s5_atrMult = input.float(3.5, "L1 Gürültü Duvarý", step=0.1, group=GRP5)
float s5_mu = input.float(0.6, "L1 Yakýnsaklýk (μ)", step=0.1, group=GRP5)
float s5_k_start = input.float(0.01, "Kral Baþlangýç", step=0.01, group=GRP5)
float s5_k_inc = input.float(0.02, "Kral Ývme", step=0.01, group=GRP5)
float s5_k_max = input.float(0.20, "Kral Max", step=0.01, group=GRP5)
[s5_hl2_idx] = request.security(s5_symB, timeframe.period, [hl2], lookahead=barmerge.lookahead_off)
float s5_z_rs4 = f_zlema(ta.median(hl2 / s5_hl2_idx, 8), 89)
bool s5_isRsBull = s5_z_rs4 > s5_z_rs4[1]
bool s5_isRsBear = s5_z_rs4 < s5_z_rs4[1]
f_s5_hft_paket() =>
[z, v] = f_kutu_kutle(hl2, s5_atrLen, s5_atrMult, s5_mu)
[cel, _] = f_kutu_kutle(hl2, 1, 0.01, 0.01)
[z, v, cel, f_zlema(z, 5), f_zlema(z, 20)]
[s5_z_m, s5_v_m, s5_cel_m, s5_f_m, s5_s_m] = request.security(syminfo.tickerid, s5_hft_res, f_s5_hft_paket(), lookahead=barmerge.lookahead_off)
[s5_z_l, s5_v_l] = f_kutu_kutle(hl2, s5_atrLen, s5_atrMult, s5_mu)
[s5_cel_l, _] = f_kutu_kutle(hl2, 1, 0.01, 0.01)
float s5_kin_z = na(s5_z_m) ? s5_z_l : s5_z_m
float s5_celik = na(s5_cel_m) ? s5_cel_l : s5_cel_m
plot(s5_celik, "S5 ÝZ STOP", color=color.new(#d500f9, 0), linewidth=1, style=plot.style_stepline, display=is_sys5 ? display.all : display.none)
[s5_sar_hizli, s5_trend_hizli] = f_ozel_sar(high, low, 0.06, 0.06, 0.30)
float s5_ayna_hizli = s5_trend_hizli > 0 ? hl2 + math.abs(hl2 - s5_sar_hizli) : hl2 - math.abs(hl2 - s5_sar_hizli)
var float[] s5_fibs = array.from(1.0, 2.0, 3.0, 5.0, 8.0, 13.0, 21.0, 34.0, 55.0)
var s5_states = array.new<SARState>()
if barstate.isfirst
for i = 0 to 8
s5_states.push(SARState.new(na, na, s5_k_start, false, 0, 0, false))
float s5_gercek_oynaklik = ta.atr(14)
for i = 0 to 8
SARState s = s5_states.get(i)
s.f_updateState(s5_kin_z, s5_k_start, s5_k_inc, s5_k_max, s5_fibs.get(i), s5_gercek_oynaklik)
var int s5_king_idx = 8
int s5_new_king = -1
for i = 0 to 8
if s5_states.get(i).bounce_count >= 2
s5_new_king := i
break
if s5_new_king != -1
s5_king_idx := s5_new_king
float s5_kral_sar = s5_states.get(s5_king_idx).sar_value
bool s5_kral_yon = s5_states.get(s5_king_idx).isLong
float s5_kral_ayna = s5_kral_yon ? hl2 + math.abs(hl2 - s5_kral_sar) : hl2 - math.abs(hl2 - s5_kral_sar)
plot(s5_kral_sar, "S5 KSAR", color=s5_kral_yon ? col_up : col_dn, style=plot.style_line, linewidth=2, display=is_sys5 ? display.all : display.none)
bool s5_isBullTrigger = (s5_kral_ayna > hl2) and s5_isRsBull
bool s5_isBearTrigger = (s5_kral_ayna < hl2) and s5_isRsBear
float s5_roSar1 = ta.sar(0.03, 0.003, 0.3)
bool s5_trigger = (math.abs(s5_roSar1 - ta.sar(0.05, 0.005, 0.5)) <= syminfo.mintick) and (math.abs(s5_roSar1 - ta.sar(0.10, 0.010, 1.0)) <= syminfo.mintick) and not ((math.abs(s5_roSar1[1] - ta.sar(0.05, 0.005, 0.5)[1]) <= syminfo.mintick) and (math.abs(s5_roSar1[1] - ta.sar(0.10, 0.010, 1.0)[1]) <= syminfo.mintick))
plotshape(is_sys5 and s5_trigger ? s5_roSar1 : na, "S5 3'lü SAR", shape.diamond, location.absolute, color=(hl2 > s5_roSar1) ? color.new(#00e676, 70) : color.new(#ff1744, 70), size=size.large)
// =================================================================
// ORTAK BAR RENKLENDÝRME
// =================================================================
color final_bar_col = na
if is_sys1
final_bar_col := s1_trend == 1 ? color.new(col_up, 0) : color.new(col_dn, 0)
else if is_sys2
final_bar_col := s2_k50_long ? color.new(col_up, 50) : color.new(col_dn, 50)
else if is_sys3
final_bar_col := s3_tetikci_z > s3_tetikci_z[1] ? color.new(col_up, 0) : color.new(col_dn, 0)
else if is_sys4
final_bar_col := s4_barCol
else if is_sys5
final_bar_col := s5_isBullTrigger ? col_up : s5_isBearTrigger ? col_dn : col_gri
barcolor(final_bar_col)
// =================================================================
// MÜÞTEREK MASTER DASHBOARD (ORTAK TABLO)
// =================================================================
var table master_dash = table.new(position.bottom_right, 3, 8, bgcolor=color.new(#131722, 20), border_width=1, border_color=color.new(#363a45, 50))
if barstate.islast
// Baþlýk Satýrý
table.cell(master_dash, 0, 0, "SÝSTEM", text_color=color.white, text_size=size.small, bgcolor=color.new(#2962ff, 50))
table.cell(master_dash, 1, 0, "DEÐER", text_color=color.white, text_size=size.small, bgcolor=color.new(#2962ff, 50))
table.cell(master_dash, 2, 0, "SONUÇ", text_color=color.white, text_size=size.small, bgcolor=color.new(#2962ff, 50))
// Sistem 1 (Durum Güncellemesi ile)
color s1_bg = is_sys1 ? color.new(#2962ff, 80) : color.new(#131722, 10)
string s1_status_txt = s1_trade_dir == 1 ? "AL (AKTÝF)" : s1_trade_dir == -1 ? "SAT (AKTÝF)" : s1_trend == 1 ? "AL (BEKLÝYOR)" : "SAT (BEKLÝYOR)"
color s1_status_col = s1_trade_dir == 1 or (s1_trade_dir == 0 and s1_trend == 1) ? col_up : col_dn
table.cell(master_dash, 0, 1, is_sys1 ? "► Scalping Trade" : "Scalping Trade", text_color=color.white, text_size=size.small, text_halign=text.align_left, bgcolor=s1_bg)
table.cell(master_dash, 1, 1, str.tostring(s1_k_sar, format.mintick), text_color=color.silver, text_size=size.small, bgcolor=s1_bg)
table.cell(master_dash, 2, 1, s1_status_txt, text_color=s1_status_col, text_size=size.small, bgcolor=s1_bg)
// Sistem 2
color s2_bg = is_sys2 ? color.new(#2962ff, 80) : color.new(#131722, 10)
table.cell(master_dash, 0, 2, is_sys2 ? "► Swing Trade" : "Swing Trade", text_color=color.white, text_size=size.small, text_halign=text.align_left, bgcolor=s2_bg)
table.cell(master_dash, 1, 2, str.tostring(s2_k50_val, format.mintick), text_color=color.silver, text_size=size.small, bgcolor=s2_bg)
table.cell(master_dash, 2, 2, s2_k50_long ? "AL" : "SAT", text_color=s2_k50_long ? col_up : col_dn, text_size=size.small, bgcolor=s2_bg)
// Sistem 3
color s3_bg = is_sys3 ? color.new(#2962ff, 80) : color.new(#131722, 10)
table.cell(master_dash, 0, 3, is_sys3 ? "► Scalp + Swing" : "Scalp + Swing", text_color=color.white, text_size=size.small, text_halign=text.align_left, bgcolor=s3_bg)
table.cell(master_dash, 1, 3, str.tostring(s3_tetikci_z, format.mintick), text_color=color.silver, text_size=size.small, bgcolor=s3_bg)
table.cell(master_dash, 2, 3, s3_tetikci_z > s3_celik_zemin ? "AL" : "SAT", text_color=s3_tetikci_z > s3_celik_zemin ? col_up : col_dn, text_size=size.small, bgcolor=s3_bg)
// Sistem 4
color s4_bg = is_sys4 ? color.new(#2962ff, 80) : color.new(#131722, 10)
table.cell(master_dash, 0, 4, is_sys4 ? "► Day Trade" : "Day Trade", text_color=color.white, text_size=size.small, text_halign=text.align_left, bgcolor=s4_bg)
table.cell(master_dash, 1, 4, str.tostring(s4_tetikci_z, format.mintick), text_color=color.silver, text_size=size.small, bgcolor=s4_bg)
table.cell(master_dash, 2, 4, s4_tetikci_z > s4_o377 ? "AL" : "SAT", text_color=s4_tetikci_z > s4_o377 ? col_up : col_dn, text_size=size.small, bgcolor=s4_bg)
// Sistem 5
color s5_bg = is_sys5 ? color.new(#2962ff, 80) : color.new(#131722, 10)
table.cell(master_dash, 0, 5, is_sys5 ? "► Otonom Trade" : "Otonom Trade", text_color=color.white, text_size=size.small, text_halign=text.align_left, bgcolor=s5_bg)
table.cell(master_dash, 1, 5, str.tostring(s5_kral_sar, format.mintick), text_color=color.silver, text_size=size.small, bgcolor=s5_bg)
table.cell(master_dash, 2, 5, s5_kral_yon ? "AL" : "SAT", text_color=s5_kral_yon ? col_up : col_dn, text_size=size.small, bgcolor=s5_bg)
// Ýmza (Sabit Alt Kýsým)
table.cell(master_dash, 0, 6, "Gemini Pro Eðitim Çalýþmasýdýr. Yatýrým tavsiyesi olarak KULLANILAMAZ. @yörük@", text_color=color.new(color.white, 30), text_size=size.tiny, bgcolor=color.new(#000000, 50))
table.merge_cells(master_dash, 0, 6, 2, 6)
Yer Ýmleri