deneyselin φrnek gφrόntόleri....
https://www.tradingview.com/x/W5jFBqit/
https://www.tradingview.com/x/yX1YHssK/
https://www.tradingview.com/x/Zt7ja6zt/
deneyselin φrnek gφrόntόleri....
https://www.tradingview.com/x/W5jFBqit/
https://www.tradingview.com/x/yX1YHssK/
https://www.tradingview.com/x/Zt7ja6zt/
16.07.2024 - 10.12.2024
PHP Code:// © Kinetik Komuta Merkezi - V9.3 άΗ ΗEKέRDEKLέ ARBέTRAJ MATRIX
//@version=6
strategy("V9.3 Tri-Core Arbitraj", overlay=true, initial_capital=10000, default_qty_type=strategy.percent_of_equity, default_qty_value=100, commission_type=strategy.commission.percent, commission_value=0.04)
// ═════════════════════════════════════════════════════════════════════════
// 1. GέRDέLER VE CEPHANELέK (3 HέSSE)
// ═════════════════════════════════════════════════════════════════════════
grp_sym = "Hedef Hisseler (άηgen Kombinasyon)"
symA = input.symbol("BIST:MCARD", "A Hissesi", group=grp_sym)
symB = input.symbol("BIST:NETCD", "B Hissesi", group=grp_sym)
symC = input.symbol("BIST:DOFRB", "C Hissesi", group=grp_sym)
grp_logic = "Ηift Namlulu Motor Ayarlarύ"
longZLength = input.int(240, "Aπύr Namlu (Uzun Z-Score)", minval=100, maxval=500, group=grp_logic)
shortZLength = input.int(80, "Hafif Namlu (Kύsa Z-Score)", minval=20, maxval=150, group=grp_logic)
entryZ = input.float(1.70, "Taarruz Sύnύrύ (+/-)", step=0.1, group=grp_logic)
exitZ = input.float(0.50, "Tahliye Sύnύrύ (Kύsa Namluya Gφre)", step=0.1, group=grp_logic)
minIntegrity = input.float(55.0, "Minimum Gόvenlik Puanύ", minval=0.0, maxval=100.0, group=grp_logic)
hide_session = input.session("1810-0950", "Gizlenecek Φlό Saatler", group="Zaman Kalkanύ")
tz = input.string("UTC+3", "Saat Dilimi", group="Zaman Kalkanύ")
in_hide_session = not na(time(timeframe.period, hide_session, tz))
should_hide = (dayofweek == dayofweek.saturday or dayofweek == dayofweek.sunday) or in_hide_session
// ═════════════════════════════════════════════════════════════════════════
// 2. VERέ έSTέHBARATI
// ═════════════════════════════════════════════════════════════════════════
cA_raw = request.security(symA, timeframe.period, close, gaps=barmerge.gaps_on)
cB_raw = request.security(symB, timeframe.period, close, gaps=barmerge.gaps_on)
cC_raw = request.security(symC, timeframe.period, close, gaps=barmerge.gaps_on)
var float cA = na, var float cB = na, var float cC = na
if not should_hide and cA_raw > 0 and cB_raw > 0 and cC_raw > 0
cA := cA_raw, cB := cB_raw, cC := cC_raw
// ═════════════════════════════════════════════════════════════════════════
// 3. KANTέTATέF MOTOR (ΦZEL FONKSέYON)
// ═════════════════════════════════════════════════════════════════════════
f_arb_engine(price1, price2) =>
float ratio = (not na(price1) and not na(price2)) ? (price1 / price2) : na
float logRatio = not na(ratio) ? math.log(ratio) : na
float meanL = ta.sma(logRatio, longZLength)
float devL = ta.stdev(logRatio, longZLength)
float zLong = devL > 0 ? (logRatio - meanL) / devL : na
float meanS = ta.sma(logRatio, shortZLength)
float devS = ta.stdev(logRatio, shortZLength)
float zShort = devS > 0 ? (logRatio - meanS) / devS : na
float ret1 = (not na(price1) and not na(price1[1])) ? math.log(price1 / nz(price1[1], price1)) : na
float ret2 = (not na(price2) and not na(price2[1])) ? math.log(price2 / nz(price2[1], price2)) : na
float pairCorr = ta.correlation(ret1, ret2, 60)
float volShortInt = ta.stdev(logRatio, 20)
float volBaseInt = ta.stdev(logRatio, 60)
float volExpansion = volBaseInt > 0 ? volShortInt / volBaseInt : na
float meanDrift = (devL > 0 and not na(meanL[20])) ? math.abs(meanL - meanL[20]) / devL : na
float corrNorm = na(pairCorr) ? 0.0 : math.max(0, math.min(1, (pairCorr + 1.0) / 2.0))
float driftNorm = na(meanDrift) ? 0.0 : math.max(0, math.min(1, 1.0 - meanDrift / 0.45))
float volNorm = na(volExpansion) ? 0.0 : math.max(0, math.min(1, 1.0 - math.max(0, volExpansion - 1.0) / 0.45))
float integrityScore = math.max(0, math.min(100, 100.0 * (0.45 * corrNorm + 0.30 * driftNorm + 0.25 * volNorm)))
bool integrityOk = integrityScore >= minIntegrity
[zLong, zShort, integrityScore, integrityOk]
// άη farklύ cephe iηin motoru ηalύώtύr
[zL_AB, zS_AB, int_AB, ok_AB] = f_arb_engine(cA, cB) // Cephe 1: A vs B
[zL_AC, zS_AC, int_AC, ok_AC] = f_arb_engine(cA, cC) // Cephe 2: A vs C
[zL_BC, zS_BC, int_BC, ok_BC] = f_arb_engine(cB, cC) // Cephe 3: B vs C
// ═════════════════════════════════════════════════════════════════════════
// 4. STRATEJέ FάZYONU (SAVAή ALANI)
// ═════════════════════════════════════════════════════════════════════════
// έώlem Tetiπi (Strateji motoru sadece Grafikteki Hisse - A Hissesi iηin iώlem aηar, kβrύ oradan φlηer)
// A Hissesinin dahil olduπu en gόηlό makasύ bul
bool t_long_AB = (zL_AB <= -entryZ) and (zS_AB <= -entryZ) and ok_AB
bool t_short_AB = (zL_AB >= entryZ) and (zS_AB >= entryZ) and ok_AB
bool t_long_AC = (zL_AC <= -entryZ) and (zS_AC <= -entryZ) and ok_AC
bool t_short_AC = (zL_AC >= entryZ) and (zS_AC >= entryZ) and ok_AC
bool t_long_giris = (t_long_AB or t_long_AC) and barstate.isconfirmed
bool t_short_giris = (t_short_AB or t_short_AC) and barstate.isconfirmed
if t_long_giris
strategy.entry("LONG", strategy.long)
if t_short_giris
strategy.entry("SHORT", strategy.short)
// Tahliye (Herhangi bir aktif cephenin makasύ kapanύrsa ηύk)
bool tahliye_long = (zS_AB >= -exitZ) or (zS_AC >= -exitZ)
bool tahliye_short = (zS_AB <= exitZ) or (zS_AC <= exitZ)
if strategy.position_size > 0 and tahliye_long and barstate.isconfirmed
strategy.close("LONG", comment="Makas Kapandύ")
if strategy.position_size < 0 and tahliye_short and barstate.isconfirmed
strategy.close("SHORT", comment="Makas Kapandύ")
// Acil Tahliye (Gόvenlik έhlali)
bool acil_tahliye = (not ok_AB and math.abs(zL_AB) >= entryZ) or (not ok_AC and math.abs(zL_AC) >= entryZ)
if acil_tahliye and strategy.position_size != 0 and barstate.isconfirmed
strategy.close_all(comment="INTEGRITY BLOCK! Tahliye")
// ═════════════════════════════════════════════════════════════════════════
// 5. DEV KOMUTA PANELέ (HUD)
// ═════════════════════════════════════════════════════════════════════════
color position_bar_col = strategy.position_size > 0 ? color.new(color.aqua, 0) : strategy.position_size < 0 ? color.new(color.fuchsia, 0) : color.new(color.gray, 50)
barcolor(position_bar_col, title="Operasyon Bar Rengi")
float br_kar = strategy.grossprofit, float br_zarar = strategy.grossloss
float kar_faktoru = br_zarar == 0 ? (br_kar > 0 ? 99.99 : 0.0) : (br_kar / br_zarar)
if barstate.islast
string nA = str.replace_all(symA, "BIST:", "")
string nB = str.replace_all(symB, "BIST:", "")
string nC = str.replace_all(symC, "BIST:", "")
color c_bull = color.rgb(34, 197, 166)
color c_bear = color.rgb(244, 114, 182)
color c_neut = color.rgb(245, 189, 92)
var table hud = table.new(position.top_right, 4, 6, bgcolor=color.new(#0D0D0D, 15), border_color=color.new(color.gray, 70), border_width=1)
// άst Baώlύk
table.cell(hud, 0, 0, "⚔️ V9.3 TRI-CORE MATRIX ⚔️", text_color=color.white, text_size=size.normal, bgcolor=color.new(#181818, 0), text_halign=text.align_center)
table.merge_cells(hud, 0, 0, 3, 0)
// Sόtun Baώlύklarύ
table.cell(hud, 0, 1, "Kombinasyon (Cephe)", text_color=color.gray, text_size=size.small, bgcolor=color.new(#111111, 0))
table.cell(hud, 1, 1, "Z-Score (Aπύr/Hafif)", text_color=color.gray, text_size=size.small, bgcolor=color.new(#111111, 0))
table.cell(hud, 2, 1, "Gόvenlik", text_color=color.gray, text_size=size.small, bgcolor=color.new(#111111, 0))
table.cell(hud, 3, 1, "Sistem Emri", text_color=color.gray, text_size=size.small, bgcolor=color.new(#111111, 0))
// 1. Cephe (A vs B)
bool is_AB_active = math.abs(zL_AB) >= entryZ and math.abs(zS_AB) >= entryZ and ok_AB
string emir_AB = is_AB_active ? (zL_AB > 0 ? nA+" SAT\n"+nB+" AL" : nA+" AL\n"+nB+" SAT") : "BEKLE"
color c_AB = is_AB_active ? (zL_AB > 0 ? c_bear : c_bull) : color.gray
table.cell(hud, 0, 2, nA + " / " + nB, text_color=color.white, text_size=size.small, bgcolor=color.new(#161616, 0))
table.cell(hud, 1, 2, str.tostring(zL_AB, "#.##") + " | " + str.tostring(zS_AB, "#.##"), text_color=math.abs(zL_AB)>=entryZ ? c_neut : color.white, text_size=size.small, bgcolor=color.new(#161616, 0))
table.cell(hud, 2, 2, str.tostring(int_AB, "#"), text_color=ok_AB ? c_bull : c_bear, text_size=size.small, bgcolor=color.new(#161616, 0))
table.cell(hud, 3, 2, emir_AB, text_color=c_AB, text_size=size.small, bgcolor=color.new(#161616, 0))
// 2. Cephe (A vs C)
bool is_AC_active = math.abs(zL_AC) >= entryZ and math.abs(zS_AC) >= entryZ and ok_AC
string emir_AC = is_AC_active ? (zL_AC > 0 ? nA+" SAT\n"+nC+" AL" : nA+" AL\n"+nC+" SAT") : "BEKLE"
color c_AC = is_AC_active ? (zL_AC > 0 ? c_bear : c_bull) : color.gray
table.cell(hud, 0, 3, nA + " / " + nC, text_color=color.white, text_size=size.small, bgcolor=color.new(#1A1A1A, 0))
table.cell(hud, 1, 3, str.tostring(zL_AC, "#.##") + " | " + str.tostring(zS_AC, "#.##"), text_color=math.abs(zL_AC)>=entryZ ? c_neut : color.white, text_size=size.small, bgcolor=color.new(#1A1A1A, 0))
table.cell(hud, 2, 3, str.tostring(int_AC, "#"), text_color=ok_AC ? c_bull : c_bear, text_size=size.small, bgcolor=color.new(#1A1A1A, 0))
table.cell(hud, 3, 3, emir_AC, text_color=c_AC, text_size=size.small, bgcolor=color.new(#1A1A1A, 0))
// 3. Cephe (B vs C)
bool is_BC_active = math.abs(zL_BC) >= entryZ and math.abs(zS_BC) >= entryZ and ok_BC
string emir_BC = is_BC_active ? (zL_BC > 0 ? nB+" SAT\n"+nC+" AL" : nB+" AL\n"+nC+" SAT") : "BEKLE"
color c_BC = is_BC_active ? (zL_BC > 0 ? c_bear : c_bull) : color.gray
table.cell(hud, 0, 4, nB + " / " + nC, text_color=color.white, text_size=size.small, bgcolor=color.new(#161616, 0))
table.cell(hud, 1, 4, str.tostring(zL_BC, "#.##") + " | " + str.tostring(zS_BC, "#.##"), text_color=math.abs(zL_BC)>=entryZ ? c_neut : color.white, text_size=size.small, bgcolor=color.new(#161616, 0))
table.cell(hud, 2, 4, str.tostring(int_BC, "#"), text_color=ok_BC ? c_bull : c_bear, text_size=size.small, bgcolor=color.new(#161616, 0))
table.cell(hud, 3, 4, emir_BC, text_color=c_BC, text_size=size.small, bgcolor=color.new(#161616, 0))
// Alt Kύsύm: Kβr Faktφrό Φzeti
table.cell(hud, 0, 5, "Sistem Kβr Faktφrό", text_color=color.white, text_size=size.small, bgcolor=color.new(#111111, 0))
table.merge_cells(hud, 0, 5, 2, 5)
table.cell(hud, 3, 5, str.tostring(kar_faktoru, "#.##"), text_color=kar_faktoru >= 1.2 ? c_bull : c_bear, text_size=size.small, bgcolor=color.new(#111111, 0))
16.07.2024 - 10.12.2024
ai ye yazdύrύlan strateji deneme φrnekleri...
PHP Code:// © Kinetik Komuta Merkezi - V8.3 CYBORG MATRIX (Canlύ PF Radarύ)
//@version=6
strategy("V8.3 Cyborg Matrix", overlay=true, initial_capital=1000, default_qty_type=strategy.percent_of_equity, default_qty_value=100, commission_type=strategy.commission.percent, commission_value=0.04)
///indicator('Gόnlόk Statik Regresyon Kanalύ [Karargah]', overlay=true, max_lines_count=500)
// ═════════════════════════════════════════════════════════════════════════
// 1. MATEMATέKSEL ΗEKέRDEK
// ═════════════════════════════════════════════════════════════════════════
pine_ema(src, length) =>
float alpha = 2 / (length + 1)
var float sum = na
sum := na(sum[1]) ? src : alpha * src + (1 - alpha) * nz(sum[1])
sum
clamp(x, a, b) => math.min(math.max(x, a), b)
f_tanh(v) => (1 - math.exp(-2 * v)) / (1 + math.exp(-2 * v))
// ═════════════════════════════════════════════════════════════════════════
// 2. GέRDέLER
// ═════════════════════════════════════════════════════════════════════════
grp_kalman = "Kalman Radar Ayarlarύ"
factor = input.float(0.5, "Ηift EMA Hύzύ", minval=0.1, step=0.1, group=grp_kalman)
r_ratiob = input.int(5, "Yavaώ Kalman R", step=5, group=grp_kalman)
r_ratios = input.int(20, "Hύzlύ Kalman R", step=5, group=grp_kalman)
q_ratio = input.float(0.002, "Kalman Q Sabiti", step=0.001, group=grp_kalman)
i_period = input.int(19, "έzotropik Dόrbόn Periyodu", minval=5, group="έzotropik Dόrbόn")
// ═════════════════════════════════════════════════════════════════════════
// 3. KALMAN RADARI (GέRέή YΦNά έΗέN ΦRS)
// ═════════════════════════════════════════════════════════════════════════
calc_kalman(float src, float p_state, float p_cv, float R_raw, float Q_raw) =>
float q_process = clamp(nz(Q_raw, 0.1), 0.001, 10.0) * q_ratio
float r_adaptive = math.max(nz(R_raw, 1.0), 1.0)
float current_p_cov = p_cv + q_process
float k_gain = current_p_cov / (current_p_cov + r_adaptive + 1e-10)
float next_state = nz(p_state, src) + k_gain * (src - nz(p_state, src))
float next_cov = (1 - k_gain) * current_p_cov
[next_state, next_cov]
float ema_val = pine_ema(pine_ema(close, factor), factor)
float vol_base = math.max(ta.atr(14), 1e-6)
var float kf_stateb = na, var float p_covb = 1.0
float resb = ema_val - nz(kf_stateb[1], ema_val)
float res_varb = math.pow(resb, 2) / math.pow(vol_base, 2)
[new_valb, new_covb] = calc_kalman(ema_val, kf_stateb, p_covb, nz(ta.rma(res_varb, r_ratiob), 1.0), nz(ta.rma(res_varb, 5), 0.1))
kf_stateb := new_valb, p_covb := new_covb
float kalman_yavas = pine_ema(kf_stateb, 3)
var float kf_states = na, var float p_covs = 1.0
float ress = ema_val - nz(kf_states[1], ema_val)
float res_vars = math.pow(ress, 2) / math.pow(vol_base, 2)
[new_vals, new_covs] = calc_kalman(ema_val, kf_states, p_covs, nz(ta.rma(res_vars, r_ratios), 1.0), nz(ta.rma(res_vars, 5), 0.1))
kf_states := new_vals, p_covs := new_covs
float kalman_hizli = pine_ema(kf_states, 5)
bool makro_boga = kalman_hizli > kalman_yavas
bool makro_ayi = kalman_hizli < kalman_yavas
// ═════════════════════════════════════════════════════════════════════════
// 4. έZOTROPέK KANAL (GέRέή TETέΠέ έΗέN ΗEKέΗ)
// ═════════════════════════════════════════════════════════════════════════
float iso_chUp = ta.highest(high, i_period)[1]
float iso_chLo = ta.lowest(low, i_period)[1]
bool tavan_kirildi = close > iso_chUp
bool taban_kirildi = close < iso_chLo
// ═════════════════════════════════════════════════════════════════════════
// 5. DBHF KALKANI (ΗIKIή/TAHLέYE έΗέN έZ SάREN STOP)
// ═════════════════════════════════════════════════════════════════════════
f_dbhf_sniper(src, atrLen, atrMult, enterMult, exitMult, response) =>
var float dbhf = na
if na(dbhf)
dbhf := src
float tauEnter = ta.atr(atrLen) * atrMult * enterMult
float diff = src - dbhf
if diff > tauEnter
dbhf += response * (diff - tauEnter)
else if diff < -tauEnter
dbhf += response * (diff + tauEnter)
dbhf
float dbhf_macro_cizgi = f_dbhf_sniper(hl2, 14, 1.5, 1.0, 0.5, 0.1)
// ═════════════════════════════════════════════════════════════════════════
// 6. STRATEJέ FάZYONU (GέRέή VE ΗIKIή BΦLάNMESέ)
// ═════════════════════════════════════════════════════════════════════════
bool t_long_giris = makro_boga and tavan_kirildi and barstate.isconfirmed
bool t_short_giris = makro_ayi and taban_kirildi and barstate.isconfirmed
if t_long_giris
strategy.entry("LONG", strategy.long)
if t_short_giris
strategy.entry("SHORT", strategy.short)
var float iz_suren_stop = na
if strategy.position_size > 0
iz_suren_stop := math.max(nz(iz_suren_stop[1], iz_suren_stop), dbhf_macro_cizgi)
if close < iz_suren_stop and barstate.isconfirmed
strategy.close("LONG", comment="Kalkan Delindi")
else if strategy.position_size < 0
iz_suren_stop := math.min(nz(iz_suren_stop[1], iz_suren_stop), dbhf_macro_cizgi)
if close > iz_suren_stop and barstate.isconfirmed
strategy.close("SHORT", comment="Kalkan Delindi")
else
iz_suren_stop := na
// ═════════════════════════════════════════════════════════════════════════
// 7. TAKTέKSEL ARAYάZ (GΦRSEL FάZYON)
// ═════════════════════════════════════════════════════════════════════════
plot(iso_chUp, "Tavan", color=color.new(color.aqua, 40), style=plot.style_stepline)
plot(iso_chLo, "Taban", color=color.new(color.red, 40), style=plot.style_stepline)
plot(iz_suren_stop, "έz Sόren DBHF Kalkanύ", color=strategy.position_size > 0 ? color.aqua : strategy.position_size < 0 ? color.fuchsia : na, style=plot.style_stepline, linewidth=3)
plotshape(t_long_giris and strategy.position_size <= 0, "AL", shape.triangleup, location.belowbar, color.aqua, size=size.small)
plotshape(t_short_giris and strategy.position_size >= 0, "SAT", shape.triangledown, location.abovebar, color.red, size=size.small)
//color position_bar_col = strategy.position_size > 0 ? color.new(color.aqua, 0) : strategy.position_size < 0 ? color.new(color.fuchsia, 0) : na
//barcolor(position_bar_col, title="Operasyon Bar Rengi")
// ═════════════════════════════════════════════════════════════════════════
// 8. CANLI KΒR FAKTΦRά (PF) RADARI
// ═════════════════════════════════════════════════════════════════════════
float br_kar = strategy.grossprofit
float br_zarar = strategy.grossloss
float kar_faktoru = br_zarar == 0 ? (br_kar > 0 ? 99.99 : 0.0) : (br_kar / br_zarar)
if barstate.islast
var table hud = table.new(position.top_right, 2, 3, bgcolor=color.new(#0D0D0D, 20), border_color=color.new(color.gray, 80), border_width=1)
table.cell(hud, 0, 0, "@yφrόk@ Matrix V8.3", text_color=color.white, text_size=size.small, bgcolor=color.new(#111111, 0), text_halign=text.align_center)
table.merge_cells(hud, 0, 0, 1, 0)
table.cell(hud, 0, 1, "Operasyon", text_color=color.white, text_size=size.small, bgcolor=color.new(#1A1A1A, 0))
table.cell(hud, 1, 1, strategy.position_size > 0 ? "LONG AKTέF" : strategy.position_size < 0 ? "SHORT AKTέF" : "PUSUDA", text_color=strategy.position_size > 0 ? color.aqua : strategy.position_size < 0 ? color.fuchsia : color.gray, text_size=size.small, bgcolor=color.new(#1A1A1A, 0))
color pf_color = kar_faktoru >= 1.2 ? color.lime : color.red
table.cell(hud, 0, 2, "Kβr Faktφrό", text_color=color.white, text_size=size.small, bgcolor=color.new(#161616, 0))
table.cell(hud, 1, 2, str.tostring(kar_faktoru, "#.##"), text_color=pf_color, text_size=size.small, bgcolor=color.new(#161616, 0))
///////////////
// ═════════════════════════════════════════════════════════════════════════
// 1. GέRDέLER VE ZIRH AYARLARI
// ═════════════════════════════════════════════════════════════════════════
src = input.source(close, 'Kaynak Fiyat')
mult = input.float(1.0, 'Bant Geniώliπi (Sapma Ηarpanύ)', step=0.1, minval=0.1)
bands = input.bool(true, 'Dύώ Koruma Bantlarύnύ Gφster')
grpC = "Renk Ayarlarύ"
col = input.color(#FF5D00, 'Tek Renk Modu', group=grpC)
bicolor = input.bool(true, 'Trende Gφre Ηift Renk (Akύllύ)', group=grpC)
colA = input.color(color.rgb(246, 247, 244), 'Yόkseliώ Rengi', group=grpC)
colB = input.color(color.rgb(243, 235, 2), 'Dόώόώ Rengi', group=grpC)
// ═════════════════════════════════════════════════════════════════════════
// 2. GάNLάK (DAILY) ZAMAN DέLέMέ TESPέTέ
// ═════════════════════════════════════════════════════════════════════════
// Gόn deπiώtiπinde 'true' dφner, bφylece dόnόn ηizgisi biter ve yeni gόnόn kanalύ baώlar.
bool new_day = ta.change(time("D")) != 0 or barstate.isfirst
// ═════════════════════════════════════════════════════════════════════════
// 3. MATRέS VE HAFIZA DEΠέήKENLERέ
// ═════════════════════════════════════════════════════════════════════════
var line ln = na
var line lnU = na
var line lnD = na
var array<int> aX = array.new<int>()
var array<float> aY = array.new<float>()
var float Ex = 0.
var float Ey = 0.
var float Ex2 = 0.
var float Exy = 0.
var int N = 0
// ═════════════════════════════════════════════════════════════════════════
// 4. STATέK REGRESYON MOTORU (EN KάΗάK KARELER YΦNTEMέ)
// ═════════════════════════════════════════════════════════════════════════
if new_day
// Yeni gόn doπduπunda tόm hafύzayύ temizle ve o gόne ait yeni lazerleri fύrlat
Ex := 0.
Ey := 0.
Ex2 := 0.
Exy := 0.
array.clear(aX)
array.clear(aY)
N := 0
ln := line.new(bar_index, src, bar_index, src, color=col, style=line.style_dashed, width=2)
//if bands
//lnU := line.new(bar_index, src, bar_index, src, color=col, style=line.style_dotted, width=1)
//lnD := line.new(bar_index, src, bar_index, src, color=col, style=line.style_dotted, width=1)
// Canlύ mermileri (verileri) matrise ekle
Ex += bar_index
Ey += src
Ex2 += math.pow(bar_index, 2)
Exy += bar_index * src
N += 1
array.unshift(aX, bar_index)
array.unshift(aY, src)
// Bant Geniώliπi iηin Gόvenli Standart Sapma Hesaplamalarύ (Sύfύra Bφlόnme Korumalύ)
float cov = array.size(aX) > 1 ? array.covariance(aY, aX) : 0
float stdev_Y = array.size(aY) > 1 ? array.stdev(aY) : 0
float stdev_X = array.size(aX) > 1 ? array.stdev(aX) : 0
float aY_var = array.size(aY) > 1 ? array.variance(aY) : 0
float r2 = (stdev_Y != 0 and stdev_X != 0) ? math.pow(cov / (stdev_Y * stdev_X), 2) : 0
float rss = aY_var - (r2 * aY_var)
float dist = math.sqrt(math.max(rss, 0)) * mult
// Eπim (Slope - m) ve Kesiώim (Intercept - b)
float denominator = (N * Ex2 - math.pow(Ex, 2))
float m = denominator != 0 ? (N * Exy - Ex * Ey) / denominator : 0
float b = N != 0 ? (Ey - m * Ex) / N : 0
// O anki barύn bitiώ noktasύ
float yMx = m * bar_index + b
// ═════════════════════════════════════════════════════════════════════════
// 5. ΗέZGέLERέ GάNCELLE (LAZER HέZALAMA)
// ═════════════════════════════════════════════════════════════════════════
if not na(ln)
// Eπime gφre yeώil/kύrmύzύ akύllύ renk seηimi
color cl = bicolor ? (m > 0 ? colA : colB) : col
int x1 = line.get_x1(ln)
// Orta Denge Ηizgisi
line.set_xy2(ln, bar_index, yMx)
line.set_y1(ln, m * x1 + b)
line.set_color(ln, cl)
if bands
// άst Kalkan
line.set_xy2(lnU, bar_index, yMx + dist)
line.set_y1(lnU, m * x1 + b + dist)
line.set_color(lnU, cl)
// Alt Kalkan
line.set_xy2(lnD, bar_index, yMx - dist)
line.set_y1(lnD, m * x1 + b - dist)
line.set_color(lnD, cl)
///////////////////
// ═════════════════════════════════════════════════════════════════════════
// 1. GέRDέLER VE AYARLAR
// ═════════════════════════════════════════════════════════════════════════
string f_type = input.string("Type 1", title="Filtre Tipi", options=["Type 1", "Type 2"])
string mov_src = input.string("Close", title="Hareket Kaynaπύ", options=["Wicks", "Close"])
float rng_qty = input.float(2.618, title="Range Boyutu (Ηarpan)", minval=0.0000001)
string rng_scale = input.string("Average Change", title="Range Φlηeπi", options=["Points", "Pips", "Ticks", "% of Price", "ATR", "Average Change", "Standard Deviation", "Absolute"])
int rng_per = input.int(14, title="Range Periyodu", minval=1)
bool smooth_range = input.bool(true, title="Range Yumuώatma (Smooth)")
int smooth_per = input.int(27, title="Yumuώatma Periyodu", minval=1)
bool av_vals = input.bool(false, title="Filtre Deπiώimlerini Ortalamaya Al")
int av_samples = input.int(2, title="Ortalama Alύnacak Deπiώim Sayύsύ", minval=1)
// ═════════════════════════════════════════════════════════════════════════
// 2. MATEMATέKSEL ΗEKέRDEK (Koώullu Diziler)
// ═════════════════════════════════════════════════════════════════════════
Cond_EMA(float x, bool cond, float n) =>
var val = array.new<float>()
var ema_val = array.new<float>(1, na)
if cond
array.push(val, x)
if array.size(val) > 1
array.remove(val, 0)
float current_val = array.get(val, 0)
float prev_ema = array.get(ema_val, 0)
if na(prev_ema)
prev_ema := current_val
float new_ema = (current_val - prev_ema) * (2 / (n + 1)) + prev_ema
array.set(ema_val, 0, new_ema)
array.get(ema_val, 0)
Cond_SMA(float x, bool cond, float n) =>
var vals = array.new<float>()
if cond
array.push(vals, x)
if array.size(vals) > n
array.remove(vals, 0)
array.avg(vals)
Stdev(float x, float n) =>
math.sqrt(Cond_SMA(math.pow(x, 2), true, n) - math.pow(Cond_SMA(x, true, n), 2))
rng_size(float x, string scale, float qty, float n) =>
float ATR = Cond_EMA(ta.tr(true), true, n)
float AC = Cond_EMA(math.abs(ta.change(x)), true, n)
float SD = Stdev(x, n)
float res = scale=="Pips" ? qty*0.0001 : scale=="Points" ? qty*syminfo.pointvalue : scale=="% of Price" ? close*qty/100 : scale=="ATR" ? qty*ATR : scale=="Average Change" ? qty*AC : scale=="Standard Deviation" ? qty*SD : scale=="Ticks" ? qty*syminfo.mintick : qty
res
rng_filt(float h, float l, float rng_, float n, string type, bool smooth, float sn, bool av_rf, float av_n) =>
float rng_smooth = Cond_EMA(rng_, true, sn)
float r = smooth ? rng_smooth : rng_
var rfilt = array.new<float>(2, (h + l)/2)
array.set(rfilt, 1, array.get(rfilt, 0))
float rfilt_1 = array.get(rfilt, 1)
float rfilt_0 = rfilt_1
if type == "Type 1"
if h - r > rfilt_1
rfilt_0 := h - r
if l + r < rfilt_1
rfilt_0 := l + r
else if type == "Type 2"
if h >= rfilt_1 + r
rfilt_0 := rfilt_1 + math.floor(math.abs(h - rfilt_1)/r)*r
if l <= rfilt_1 - r
rfilt_0 := rfilt_1 - math.floor(math.abs(l - rfilt_1)/r)*r
array.set(rfilt, 0, rfilt_0)
float rng_filt1 = array.get(rfilt, 0)
float hi_band1 = rng_filt1 + r
float lo_band1 = rng_filt1 - r
bool is_changed = rng_filt1 != rfilt_1
float rng_filt2 = Cond_EMA(rng_filt1, is_changed, av_n)
float hi_band2 = Cond_EMA(hi_band1, is_changed, av_n)
float lo_band2 = Cond_EMA(lo_band1, is_changed, av_n)
float final_filt = av_rf ? rng_filt2 : rng_filt1
float final_hi = av_rf ? hi_band2 : hi_band1
float final_lo = av_rf ? lo_band2 : lo_band1
[final_hi, final_lo, final_filt]
// ═════════════════════════════════════════════════════════════════════════
// 3. SέNYAL VE GΦRSELLEήTέRME (SADECE BAR RENKLENDέRME)
// ═════════════════════════════════════════════════════════════════════════
float h_val = mov_src == "Wicks" ? high : close
float l_val = mov_src == "Wicks" ? low : close
// Range Filter deπerlerini hesapla (Ηizgileri sildik, sadece filtre deπerini 'filt' olarak ηekiyoruz)
[_, _, filt] = rng_filt(h_val, l_val, rng_size((h_val + l_val)/2, rng_scale, rng_qty, rng_per), rng_per, f_type, smooth_range, smooth_per, av_vals, av_samples)
var float fdir = 0.0
fdir := filt > nz(filt[1], filt) ? 1 : filt < nz(filt[1], filt) ? -1 : fdir
bool upward = fdir == 1
bool downward = fdir == -1
// Gόηlό yόkseliώler Parlak Yeώil, Zayύf yόkseliώler Koyu Yeώil
// Gόηlό dόώόώler Parlak Pembe/Kύrmύzύ, Zayύf dόώόώler Koyu Kύrmύzύ
color bar_color = upward and (close > filt) ? (close > nz(close[1], close) ? #05ff9b : #05ff9b) : downward and (close < filt) ? (close < nz(close[1], close) ? #ff0583 : #ff0583) : #faf602
barcolor(bar_color, title="Trend Bar Renkleri")
////////
show_ayna = input.bool(true, "Ayna Radarύnύ (Tepe/Dip) Gφster", group="Gφrsel Ayarlar")
f_ozel_sar_ep(src_h, src_l, _start, _inc, _max) =>
var int trend_sar = 0, var float sar_val = 0.0, var float ep = 0.0, var float af = 0.0
if trend_sar == 0 and not na(src_h[1])
trend_sar := src_h >= src_h[1] or src_l >= src_l[1] ? 1 : -1
sar_val := trend_sar > 0 ? src_l[1] : src_h[1], ep := trend_sar > 0 ? src_h[1] : src_l[1], af := _start
else
float nextsar = sar_val
if trend_sar > 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_sar := -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_sar := 1, nextsar := ep, ep := src_h, af := _start
sar_val := nextsar
[sar_val, trend_sar, ep]
f_kuantum_lrb_dinamik(src, base_decay, smooth, max_atr_dist, evrensel_ivme) =>
var float hh = na, var float ll = na
float pre_hh = nz(hh[1], src), float pre_ll = nz(ll[1], src)
float atr_gucu = nz(ta.atr(14), ta.tr)
float decay_mult = 2.0 - (evrensel_ivme * 1.5)
float cur_decay = atr_gucu * base_decay * decay_mult
float decay_sma = ta.sma(cur_decay, smooth)
float temp_hh = src >= pre_hh ? src : pre_hh - decay_sma
float temp_ll = src <= pre_ll ? src : pre_ll + decay_sma
float max_mesafe = atr_gucu * max_atr_dist
hh := math.min(temp_hh, src + max_mesafe)
ll := math.max(temp_ll, src - max_mesafe)
float mid = math.avg(hh, ll)
[hh, ll, mid]
// 6. AYNA RADARI (YENέ EKLENEN GΦRSEL MODάL)
// ═════════════════════════════════════════════════════════════════════════
float ham_volatilite = ta.tr(true)
float max_vol = nz(ta.highest(ham_volatilite, 3), 0.0001)
float min_vol = nz(ta.lowest(ham_volatilite, 3), 0.0)
float vol_orani = (max_vol == min_vol) ? 0.0 : ((ham_volatilite - min_vol) / (max_vol - min_vol))
float ayna_start = 0.02 + (vol_orani * 0.08)
float ayna_inc = 0.02 + (vol_orani * 0.08)
float ayna_max = 0.20 + (vol_orani * 0.30)
[ayna_sar, ayna_trend, ayna_ep] = f_ozel_sar_ep(high, low, ayna_start, ayna_inc, ayna_max)
float ayna = ayna_trend > 0 ? hl2 + math.abs(hl2 - ayna_sar) : hl2 - math.abs(hl2 - ayna_sar)
float ayna_ivme = math.abs(ayna - nz(ayna[1], ayna))
float max_ivme = nz(ta.highest(ayna_ivme, 3), 0.0001)
float min_ivme = nz(ta.lowest(ayna_ivme, 3), 0.0)
float evrensel_ivme = (max_ivme == min_ivme) ? 0.0 : ((ayna_ivme - min_ivme) / (max_ivme - min_ivme))
[ayna_hh, ayna_ll, ayna_mid] = f_kuantum_lrb_dinamik(ayna, 0.10, 4, 4.0, evrensel_ivme)
// ═════════════════════════════════════════════════════════════════════════
// 7. GΦRSELLEήTέRME VE HUD PANEL
// ═════════════════════════════════════════════════════════════════════════
// Yeni Ayna Radarύ Ηizgileri (Toggle'a Baπlύ)
plot(show_ayna ? ayna : na, "Ayna", color=color.new(color.white, 0), linewidth=1, style=plot.style_stepline)
plot(show_ayna ? ayna_hh : na, "Ayna Tepe", color=color.new(color.red, 0), linewidth=1, style=plot.style_stepline)
plot(show_ayna ? ayna_ll : na, "Ayna Dip", color=color.new(color.lime, 0), linewidth=1, style=plot.style_stepline)
sar_fast = ta.sar(0.02, 0.02, 0.20)
sar_mid = ta.sar(0.03, 0.03, 0.25)
sar_slow = ta.sar(0.04, 0.04, 0.30)
plot(sar_fast, 'C', color = color.rgb(255, 238, 0), style = plot.style_cross, linewidth = 1)
plot(sar_mid, 'B', color = color.rgb(0, 255, 238), style = plot.style_cross, linewidth = 1)
plot(sar_slow, 'A', color = color.rgb(255, 0, 0), style = plot.style_cross, linewidth = 1)
psar_uzun = ta.sar(0., 0.01, 0.10)
plot(psar_uzun, title = 'D', color = close > psar_uzun ? #0901ff : #0901ff, style = plot.style_cross, linewidth = 2)
////////////
16.07.2024 - 10.12.2024
PHP Code:// © Kinetik Komuta Merkezi - V8.10 NέHAέ GANN MATRIX (Hatasύz Ηekirdek)
//@version=6
strategy("V8.10 Nihai Gann Matrix", overlay=true, initial_capital=1000, commission_type=strategy.commission.percent, commission_value=0.04)
// ═════════════════════════════════════════════════════════════════════════
// 1. GέRDέLER
// ═════════════════════════════════════════════════════════════════════════
grp_kalman = "Kalman Radar Ayarlarύ"
factor = input.float(0.5, "Ηift EMA Hύzύ", minval=0.1, step=0.1, group=grp_kalman)
r_ratiob = input.int(5, "Yavaώ Kalman R", step=5, group=grp_kalman)
r_ratios = input.int(20, "Hύzlύ Kalman R", step=5, group=grp_kalman)
q_ratio = input.float(0.002, "Kalman Q Sabiti", step=0.001, group=grp_kalman)
i_period = input.int(19, "έzotropik Dόrbόn Periyodu", minval=5, group="έzotropik Dόrbόn")
// ═════════════════════════════════════════════════════════════════════════
// 2. KALMAN VE έZOTROPέK KANAL (V8.3 SAF ΗEKέRDEK)
// ═════════════════════════════════════════════════════════════════════════
pine_ema(src, length) =>
float alpha = 2 / (length + 1)
var float sum = na
sum := na(sum[1]) ? src : alpha * src + (1 - alpha) * nz(sum[1])
sum
clamp(x, a, b) => math.min(math.max(x, a), b)
calc_kalman(float src, float p_state, float p_cv, float R_raw, float Q_raw) =>
float q_process = clamp(nz(Q_raw, 0.1), 0.001, 10.0) * q_ratio
float r_adaptive = math.max(nz(R_raw, 1.0), 1.0)
float current_p_cov = p_cv + q_process
float k_gain = current_p_cov / (current_p_cov + r_adaptive + 1e-10)
float next_state = nz(p_state, src) + k_gain * (src - nz(p_state, src))
float next_cov = (1 - k_gain) * current_p_cov
[next_state, next_cov]
float ema_val = pine_ema(pine_ema(close, factor), factor)
float vol_base = math.max(ta.atr(14), 1e-6)
var float kf_stateb = na, var float p_covb = 1.0
float resb = ema_val - nz(kf_stateb[1], ema_val)
float res_varb = math.pow(resb, 2) / math.pow(vol_base, 2)
[new_valb, new_covb] = calc_kalman(ema_val, kf_stateb, p_covb, nz(ta.rma(res_varb, r_ratiob), 1.0), nz(ta.rma(res_varb, 5), 0.1))
kf_stateb := new_valb, p_covb := new_covb
float kalman_yavas = pine_ema(kf_stateb, 3)
var float kf_states = na, var float p_covs = 1.0
float ress = ema_val - nz(kf_states[1], ema_val)
float res_vars = math.pow(ress, 2) / math.pow(vol_base, 2)
[new_vals, new_covs] = calc_kalman(ema_val, kf_states, p_covs, nz(ta.rma(res_vars, r_ratios), 1.0), nz(ta.rma(res_vars, 5), 0.1))
kf_states := new_vals, p_covs := new_covs
float kalman_hizli = pine_ema(kf_states, 5)
bool makro_boga = kalman_hizli > kalman_yavas
bool makro_ayi = kalman_hizli < kalman_yavas
float iso_chUp = ta.highest(high, i_period)[1]
float iso_chLo = ta.lowest(low, i_period)[1]
bool tavan_kirildi = close > iso_chUp
bool taban_kirildi = close < iso_chLo
// Orijinal DBHF Kalkanύ
f_dbhf_sniper(src, atrLen, atrMult, enterMult, exitMult, response) =>
var float dbhf = na
if na(dbhf)
dbhf := src
float tauEnter = ta.atr(atrLen) * atrMult * enterMult
float diff = src - dbhf
if diff > tauEnter
dbhf += response * (diff - tauEnter)
else if diff < -tauEnter
dbhf += response * (diff + tauEnter)
dbhf
float dbhf_macro_cizgi = f_dbhf_sniper(hl2, 14, 1.5, 1.0, 0.5, 0.1)
// ═════════════════════════════════════════════════════════════════════════
// 3. SέNYALLER VE έZ SάREN STOP (HATASIZ)
// ═════════════════════════════════════════════════════════════════════════
bool t_long_giris = makro_boga and tavan_kirildi and barstate.isconfirmed
bool t_short_giris = makro_ayi and taban_kirildi and barstate.isconfirmed
if t_long_giris
strategy.entry("LONG", strategy.long)
if t_short_giris
strategy.entry("SHORT", strategy.short)
var float iz_suren_stop = na
// BUG DάZELTέLDέ: nz fonksiyonuna DBHF referans gφsterilerek kilitlenme ηφzόldό
if strategy.position_size > 0
iz_suren_stop := math.max(nz(iz_suren_stop[1], dbhf_macro_cizgi), dbhf_macro_cizgi)
if close < iz_suren_stop and barstate.isconfirmed
strategy.close("LONG", comment="Kalkan Delindi")
else if strategy.position_size < 0
iz_suren_stop := math.min(nz(iz_suren_stop[1], dbhf_macro_cizgi), dbhf_macro_cizgi)
if close > iz_suren_stop and barstate.isconfirmed
strategy.close("SHORT", comment="Kalkan Delindi")
else
iz_suren_stop := na
// ═════════════════════════════════════════════════════════════════════════
// 4. GANN KOZMέK PROJEKSέYON (MUM BAZLI - ΦLά SAAT YUTUCU)
// ═════════════════════════════════════════════════════════════════════════
var int b_anchor1 = na
var int b_anchor2 = na
var int dongu_uzunlugu = na
bool is_new_entry = (t_long_giris and strategy.position_size <= 0) or (t_short_giris and strategy.position_size >= 0)
if is_new_entry
b_anchor1 := nz(b_anchor2, bar_index)
b_anchor2 := bar_index
if b_anchor1 != b_anchor2
dongu_uzunlugu := b_anchor2 - b_anchor1
var int gann_faz = 0
int tepeye_kalan_bar = na
int dibe_kalan_bar = na
if not na(dongu_uzunlugu) and dongu_uzunlugu > 0
int gecen_bar = bar_index - b_anchor2
int dongu_ici_bar = gecen_bar % dongu_uzunlugu
// Dφngόnόn Yarύsύ Boπa, Yarύsύ Ayύ
int tepe_noktasi = math.round(dongu_uzunlugu * 0.50)
if dongu_ici_bar <= tepe_noktasi
gann_faz := 1
tepeye_kalan_bar := tepe_noktasi - dongu_ici_bar
else
gann_faz := -1
dibe_kalan_bar := dongu_uzunlugu - dongu_ici_bar
bgcolor(gann_faz == 1 ? color.new(color.green, 96) : gann_faz == -1 ? color.new(color.red, 96) : na, title="Dinamik Gann Zemin")
// ═════════════════════════════════════════════════════════════════════════
// 5. GΦRSELLEήTέRME VE HUD PANEL
// ═════════════════════════════════════════════════════════════════════════
plot(iso_chUp, color=color.new(color.aqua, 50), style=plot.style_stepline)
plot(iso_chLo, color=color.new(color.red, 50), style=plot.style_stepline)
plot(iz_suren_stop, "έz Sόren Kalkan", color=strategy.position_size > 0 ? color.aqua : color.fuchsia, linewidth=2, style=plot.style_stepline)
float br_kar = strategy.grossprofit
float br_zarar = strategy.grossloss
float kar_faktoru = br_zarar == 0 ? (br_kar > 0 ? 99.99 : 0.0) : (br_kar / br_zarar)
if barstate.islast
var table hud = table.new(position.top_right, 2, 7, bgcolor=color.new(#0D0D0D, 15), border_color=color.new(color.gray, 70), border_width=1)
table.cell(hud, 0, 0, "⚔️ V8.10 NέHAέ GANN MATRIX ⚔️", text_color=color.white, text_size=size.normal, bgcolor=color.new(#181818, 0), text_halign=text.align_center)
table.merge_cells(hud, 0, 0, 1, 0)
table.cell(hud, 0, 1, "Kβr Faktφrό", text_color=color.silver, text_size=size.small, bgcolor=color.new(#1A1A1A, 0))
table.cell(hud, 1, 1, str.tostring(kar_faktoru, "#.##"), text_color=kar_faktoru >= 1.2 ? color.lime : color.red, text_size=size.small, bgcolor=color.new(#1A1A1A, 0))
table.cell(hud, 0, 2, "Operasyon Yφnό", text_color=color.silver, text_size=size.small, bgcolor=color.new(#161616, 0))
table.cell(hud, 1, 2, strategy.position_size > 0 ? "LONG" : strategy.position_size < 0 ? "SHORT" : "PUSUDA", text_color=strategy.position_size > 0 ? color.aqua : strategy.position_size < 0 ? color.fuchsia : color.gray, text_size=size.small, bgcolor=color.new(#161616, 0))
table.cell(hud, 0, 3, "--- DΦNGά (ΦLά SAATLER HARέΗ) ---", text_color=color.purple, text_size=size.small, bgcolor=color.new(#1A1A1A, 0))
table.merge_cells(hud, 0, 3, 1, 3)
table.cell(hud, 0, 4, "Mevcut Dφngό Fazύ", text_color=color.silver, text_size=size.small, bgcolor=color.new(#161616, 0))
table.cell(hud, 1, 4, gann_faz == 1 ? "YάKSELέή EVRESέ" : gann_faz == -1 ? "Dάήάή EVRESέ" : "VERέ BEKLENέYOR", text_color=gann_faz == 1 ? color.lime : gann_faz == -1 ? color.orange : color.gray, text_size=size.small, bgcolor=color.new(#161616, 0))
table.cell(hud, 0, 5, "Zirveye Kalan", text_color=color.silver, text_size=size.small, bgcolor=color.new(#1A1A1A, 0))
table.cell(hud, 1, 5, not na(tepeye_kalan_bar) ? str.tostring(tepeye_kalan_bar) + " Mum" : "-", text_color=color.yellow, text_size=size.small, bgcolor=color.new(#1A1A1A, 0))
table.cell(hud, 0, 6, "Dibe Kalan", text_color=color.silver, text_size=size.small, bgcolor=color.new(#161616, 0))
table.cell(hud, 1, 6, not na(dibe_kalan_bar) ? str.tostring(dibe_kalan_bar) + " Mum" : "-", text_color=color.orange, text_size=size.small, bgcolor=color.new(#161616, 0))
16.07.2024 - 10.12.2024
PHP Code:// © Kinetik Komuta Merkezi - V12 CYBORG-GANN HέBRέT MATRIX
//@version=6
strategy("V12 Cyborg-Gann Hibrit Matrix", overlay=true, initial_capital=1000)
// 1. AYNA RADAR VE KALMAN PARAMETRELERέ
q_ratio = input.float(0.002, "Kalman Q Sabiti (Dόrbόn)", step=0.001)
// Gann DBHF Kalkan Ayarlarύ
atrLen = input.int(14, "Kalkan ATR Periyodu")
atrMult = input.float(1.5, "Kalkan Geniώliπi")
// 2. έZOTROPέK KALMAN DάRBάNά (Cyborg Ηekirdek)
calc_kalman(float src, float p_state, float p_cv) =>
float q_process = 0.1 * q_ratio
float k_gain = (p_cv + q_process) / (p_cv + q_process + 1.0 + 1e-10)
float next_state = nz(p_state, src) + k_gain * (src - nz(p_state, src))
float next_cov = (1 - k_gain) * (p_cv + q_process)
[next_state, next_cov]
var float kf_state = close, var float p_cov = 1.0
[new_state, new_cov] = calc_kalman(close, kf_state, p_cov)
kf_state := new_state, p_cov := new_cov
// 3. AYNA RADAR SέNYALέ
mirror_signal = ta.ema(kf_state, 10) - ta.ema(kf_state, 20)
// 4. DBHF SNIPER KALKANI (Nihai Drawdown Sύnύrlandύrύcύ)
f_dbhf_sniper(src, atrLen, mult) =>
var float dbhf = src
float tau = ta.atr(atrLen) * mult
float diff = src - dbhf
if diff > tau
dbhf += (diff - tau) * 0.1 // Esnek Kalkan
else if diff < -tau
dbhf += (diff + tau) * 0.1
dbhf
float kalkan = f_dbhf_sniper(hl2, atrLen, atrMult)
// 5. TETέKLEME (Cyborg Sinyali + Gann Onayύ)
bool t_long = ta.crossover(mirror_signal, 0) and barstate.isconfirmed
bool t_short = ta.crossunder(mirror_signal, 0) and barstate.isconfirmed
if t_long
strategy.entry("LONG", strategy.long, comment="Ayna Giriώ")
if t_short
strategy.entry("SHORT", strategy.short, comment="Ayna Giriώ")
// 6. NέHAέ SAVUNMA (DBHF Kalkanύ έle Ηύkύώ)
if strategy.position_size > 0 and close < kalkan and barstate.isconfirmed
strategy.close("LONG", comment="Kalkan Delindi")
if strategy.position_size < 0 and close > kalkan and barstate.isconfirmed
strategy.close("SHORT", comment="Kalkan Delindi")
// VέZYON
plot(kf_state, "Kalman Dόrbόnό", color=color.white, linewidth=1)
plot(kalkan, "DBHF Sniper Kalkanύ", color=strategy.position_size > 0 ? color.lime : color.red, linewidth=3)
16.07.2024 - 10.12.2024
PHP Code:// © Kinetik Komuta Merkezi - V13 OMEGA-CYBORG-SNIPER MATRIX
//@version=6
strategy("V13 Cyborg-Sniper Matrix", overlay=true, initial_capital=1000, commission_type=strategy.commission.percent, commission_value=0.04)
// 1. AYNA RADAR VE KALMAN PARAMETRELERέ
q_ratio = input.float(0.002, "Kalman Q Sabiti (Dόrbόn Hassasiyeti)")
atrLen = input.int(14, "Kalkan ATR Periyodu")
atrMult = input.float(1.5, "Kalkan Geniώliπi (Sniper)")
// 2. έZOTROPέK KALMAN DάRBάNά (Giriώin Mimarύ)
calc_kalman(float src, float p_state, float p_cv) =>
float q_process = 0.1 * q_ratio
float k_gain = (p_cv + q_process) / (p_cv + q_process + 1.0 + 1e-10)
float next_state = nz(p_state, src) + k_gain * (src - nz(p_state, src))
float next_cov = (1 - k_gain) * (p_cv + q_process)
[next_state, next_cov]
var float kf_state = close, var float p_cov = 1.0
[new_state, new_cov] = calc_kalman(close, kf_state, p_cov)
kf_state := new_state, p_cov := new_cov
// 3. AYNA RADAR SέNYALέ (Cyborg Sinyal Motoru)
mirror_signal = ta.ema(kf_state, 10) - ta.ema(kf_state, 20)
// 4. DBHF SNIPER KALKANI (Pozisyon Yφnetim Motoru)
f_dbhf_sniper(src, atrLen, mult) =>
var float dbhf = src
float tau = ta.atr(atrLen) * mult
float diff = src - dbhf
if diff > tau
dbhf += (diff - tau) * 0.1
else if diff < -tau
dbhf += (diff + tau) * 0.1
dbhf
float kalkan = f_dbhf_sniper(hl2, atrLen, atrMult)
// 5. TETέKLEME (V8.3'όn Safkan Giriώi)
bool t_long = ta.crossover(mirror_signal, 0) and barstate.isconfirmed
bool t_short = ta.crossunder(mirror_signal, 0) and barstate.isconfirmed
if t_long
strategy.entry("LONG", strategy.long, comment="Cyborg Giriώ")
if t_short
strategy.entry("SHORT", strategy.short, comment="Cyborg Giriώ")
// 6. NέHAέ SAVUNMA (DBHF Sniper ile Tahliye)
if strategy.position_size > 0 and close < kalkan and barstate.isconfirmed
strategy.close("LONG", comment="Sniper Stop")
if strategy.position_size < 0 and close > kalkan and barstate.isconfirmed
strategy.close("SHORT", comment="Sniper Stop")
// VέZYON
plot(kf_state, "έzotropik Dόrbόn", color=color.white, linewidth=1)
plot(kalkan, "DBHF Sniper Kalkanύ", color=strategy.position_size > 0 ? color.lime : strategy.position_size < 0 ? color.red : color.gray, linewidth=3)
// ALARM
alertcondition(t_long, "Cyborg LONG", "🚀 LONG Sinyali Aktif")
alertcondition(t_short, "Cyborg SHORT", "🔻 SHORT Sinyali Aktif")
16.07.2024 - 10.12.2024
PHP Code:// © Kinetik Komuta Merkezi - V14.1 Cyborg-Sniper (HUD Entegreli)
//@version=6
strategy("V14.1 Cyborg-Sniper HUD", overlay=true, initial_capital=1000, commission_type=strategy.commission.percent, commission_value=0.04)
// 1. GέRDέLER
q_ratio = input.float(0.002, "Kalman Q Sabiti")
atrLen = input.int(14, "Kalkan ATR Periyodu")
atrMult = input.float(1.3, "Kalkan Geniώliπi")
// 2. έZOTROPέK KALMAN VE AYNA RADAR
calc_kalman(float src, float p_state, float p_cv) =>
float q_process = 0.1 * q_ratio
float k_gain = (p_cv + q_process) / (p_cv + q_process + 1.0 + 1e-10)
float next_state = nz(p_state, src) + k_gain * (src - nz(p_state, src))
float next_cov = (1 - k_gain) * (p_cv + q_process)
[next_state, next_cov]
var float kf_state = close, var float p_cov = 1.0
[new_state, new_cov] = calc_kalman(close, kf_state, p_cov)
kf_state := new_state, p_cov := new_cov
mirror_signal = ta.ema(kf_state, 10) - ta.ema(kf_state, 20)
// 3. DBHF SNIPER KALKANI
f_dbhf_sniper(src, atrLen, mult) =>
var float dbhf = src
float tau = ta.atr(atrLen) * mult
float diff = src - dbhf
if diff > tau
dbhf += (diff - tau) * 0.1
else if diff < -tau
dbhf += (diff + tau) * 0.1
dbhf
float kalkan = f_dbhf_sniper(hl2, atrLen, atrMult)
// 4. TETέKLEME VE SAVUNMA
bool t_long = ta.crossover(mirror_signal, 0) and barstate.isconfirmed
bool t_short = ta.crossunder(mirror_signal, 0) and barstate.isconfirmed
if t_long
strategy.entry("LONG", strategy.long, comment="Cyborg Giriώ")
if t_short
strategy.entry("SHORT", strategy.short, comment="Cyborg Giriώ")
if strategy.position_size > 0 and close < kalkan and barstate.isconfirmed
strategy.close("LONG", comment="Sniper Stop")
if strategy.position_size < 0 and close > kalkan and barstate.isconfirmed
strategy.close("SHORT", comment="Sniper Stop")
// 5. HUD TABLO (Canlύ Performans Radarύ)
float kar_faktoru = strategy.grossloss == 0 ? (strategy.grossprofit > 0 ? 99.99 : 0.0) : (strategy.grossprofit / strategy.grossloss)
if barstate.islast
var table hud = table.new(position.top_right, 2, 3, bgcolor=color.new(#0D0D0D, 20), border_color=color.new(color.gray, 80), border_width=1)
table.cell(hud, 0, 0, "V14.1 Cyborg-Sniper", text_color=color.white, text_size=size.small, bgcolor=color.new(#111111, 0))
table.merge_cells(hud, 0, 0, 1, 0)
table.cell(hud, 0, 1, "Pozisyon", text_color=color.white, text_size=size.small, bgcolor=color.new(#1A1A1A, 0))
table.cell(hud, 1, 1, strategy.position_size > 0 ? "LONG" : strategy.position_size < 0 ? "SHORT" : "PUSUDA",
text_color=strategy.position_size != 0 ? color.lime : color.gray, text_size=size.small)
table.cell(hud, 0, 2, "Kar Faktφrό", text_color=color.white, text_size=size.small, bgcolor=color.new(#161616, 0))
table.cell(hud, 1, 2, str.tostring(kar_faktoru, "#.##"),
text_color=kar_faktoru >= 2.0 ? color.lime : color.red, text_size=size.small)
// VέZYON
plot(kf_state, "Dόrbόn", color=color.white, linewidth=1)
plot(kalkan, "Sniper Kalkanύ", color=strategy.position_size > 0 ? color.lime : strategy.position_size < 0 ? color.red : color.gray, linewidth=3)
16.07.2024 - 10.12.2024
PHP Code:// © Kinetik Komuta Merkezi - V10 OMEGA-VέZYON MATRIX (Trend + Gann + PA)
//@version=6
strategy("V10 Omega-Vizyon Matrix", overlay=true, initial_capital=1000, commission_type=strategy.commission.percent, commission_value=0.04)
// 1. INPUTS
hPeriod = input.int(13, "Gann HIGH Period")
lPeriod = input.int(21, "Gann LOW Period")
atrLen = input.int(14, "ATR Filter Length", minval=1)
atrMult = input.float(0.8, "ATR Filter Multiplier", step=0.05)
// 2. GANN HILO ΗEKέRDEΠέ
sma_high = ta.sma(high, hPeriod), sma_low = ta.sma(low, lPeriod)
var int hl_direction = 0
hl_direction := close > nz(sma_low[1]) ? 1 : close < nz(sma_high[1]) ? -1 : hl_direction
float hi_lo = (hl_direction == 1) ? sma_low : sma_high
// 3. DUAL WICK REVERSAL (PA ONAYI)
float atr = ta.atr(atrLen)
float candleRange = high - low
float safeRange = candleRange == 0.0 ? syminfo.mintick : candleRange
float bodyPct = math.abs(close - open) / safeRange * 100.0
bool dualWick = (high - math.max(open, close)) / safeRange * 100.0 >= 20.0 and (math.min(open, close) - low) / safeRange * 100.0 >= 20.0 and bodyPct <= 50.0 and candleRange >= (atr * atrMult)
bool bullReversal = dualWick and (math.min(open, close) - low) > (high - math.max(open, close)) and close > open
bool bearReversal = dualWick and (high - math.max(open, close)) > (math.min(open, close) - low) and close < open
// 4. FάZYON TETέKLEME (Gann + PA Onaylύ)
// Robot artύk SADECE ηizgi kύrύlύmύ deπil, dφnόώ mumu gφrdόπόnde giriώ yapar.
bool t_long = (ta.crossover(close, hi_lo) or bullReversal) and close > hi_lo and barstate.isconfirmed
bool t_short = (ta.crossunder(close, hi_lo) or bearReversal) and close < hi_lo and barstate.isconfirmed
if t_long
strategy.entry("LONG", strategy.long, comment="Gann+PA Giriώ")
if t_short
strategy.entry("SHORT", strategy.short, comment="Gann+PA Giriώ")
// 5. έZ SάREN STOP (Kalkan)
if strategy.position_size > 0 and close < hi_lo and barstate.isconfirmed
strategy.close("LONG", comment="Kalkan Delindi")
if strategy.position_size < 0 and close > hi_lo and barstate.isconfirmed
strategy.close("SHORT", comment="Kalkan Delindi")
plot(hi_lo, "Gann HiLo", color=hl_direction == 1 ? color.blue : color.maroon, linewidth=3)
16.07.2024 - 10.12.2024
Yer έmleri