PHP Code://@version=6
indicator("Aİ - V139 Hatasız", overlay=true, max_labels_count=500, max_lines_count=500, max_bars_back=500)
// --- 1. Girdiler ---
v_smooth = input.int(1, "Vibe Yumuşatma", minval=1)
v_girth = input.int(2, "Trend Çizgi Kalınlığı")
sar_start = input.float(0.02, "SAR Başlangıç", step=0.01)
sar_inc = input.float(0.02, "SAR Artış", step=0.01)
sar_max = input.float(0.2, "SAR Maks", step=0.01)
shrek_mode = input.color(#48fb01, "Boğa Rengi")
blood_bath = input.color(#ff0000, "Ayı Rengi")
// --- 2. Trend-Vibe Motoru ---
var int vibes = 0
var float bagholder_entry = na
var float pain_threshold = na
consult_the_crystal_ball(int bias) =>
float ancient_price = open
for i = 0 to 499
int candle_attitude = nz(close[i]) > nz(open[i]) ? 1 : nz(close[i]) < nz(open[i]) ? -1 : 0
if candle_attitude == 0
continue
if candle_attitude != bias
break
ancient_price := open[i]
ancient_price
archaeologist_jones(int bias) =>
bool artifact_found = false
float artifact_value = na
for j = 1 to 499
int candle_attitude = nz(close[j]) > nz(open[j]) ? 1 : nz(close[j]) < nz(open[j]) ? -1 : 0
if candle_attitude == 0
continue
if not artifact_found
if candle_attitude == bias
artifact_found := true
artifact_value := open[j]
else
if candle_attitude != bias
break
artifact_value := open[j]
artifact_value
get_origin(bias) =>
float p = open
for i = 1 to 499
if (nz(close[i]) > nz(open[i]) ? 1 : -1) != bias
break
p := open[i]
p
if vibes == 0 and bar_index > 10
first_imp = close > open ? 1 : -1
vibes := first_imp
bagholder_entry := consult_the_crystal_ball(first_imp)
pain_threshold := first_imp == 1 ? high : low
if vibes == 1
if high > pain_threshold
pain_threshold := high
bagholder_entry := close > open ? consult_the_crystal_ball(1) : archaeologist_jones(1)
else if vibes == -1
if low < pain_threshold
pain_threshold := low
bagholder_entry := close < open ? consult_the_crystal_ball(-1) : archaeologist_jones(-1)
shorts_sq = vibes == -1 and ta.ema(close, v_smooth) > bagholder_entry
longs_rk = vibes == 1 and ta.ema(close, v_smooth) < bagholder_entry
if shorts_sq or longs_rk
vibes := shorts_sq ? 1 : -1
bagholder_entry := consult_the_crystal_ball(vibes)
pain_threshold := vibes == 1 ? high : low
active_crayon = vibes == 1 ? shrek_mode : blood_bath
plot(bagholder_entry, "TR", color=active_crayon, linewidth=v_girth)
// --- 3. SAR Hesaplamaları ---
psar_fast = ta.sar(sar_start, sar_inc, sar_max)
psar_mid = ta.sar(sar_start / 2, sar_inc / 2, sar_max)
psar_slow = ta.sar(sar_start / 4, sar_inc / 4, sar_max)
plot(psar_fast, "Hızlı", style=plot.style_cross, color=active_crayon, linewidth=1)
plot(psar_mid, "Orta", style=plot.style_circles, color=color.new(active_crayon, 50), linewidth=1)
plot(psar_slow, "Yavaş", style=plot.style_linebr, color=color.new(active_crayon, 80), linewidth=1)
// --- 4. İmza Tablosu ---
var table tb = table.new(position.top_right, 2, 2, bgcolor = #161114, border_width = 1, border_color = color.gray)
if barstate.islast
vibe_txt = vibes == 1 ? "BOĞA ↗" : "AYI ↘"
vibe_val = str.tostring(bagholder_entry, format.mintick)
sar_txt = "Hızlı: " + str.tostring(psar_fast, format.mintick) + " | Orta: " + str.tostring(psar_mid, format.mintick) + " | Yavaş: " + str.tostring(psar_slow, format.mintick)
full_info = "TR|@yörük@: " + vibe_txt + " (" + vibe_val + ") | " + sar_txt + "|@yörük@ 2026"
table.cell(tb, 0, 0, full_info, text_color = #f4f2ef, text_size = size.normal)
// --- 5. DL Fonksiyonları ---
tanh(v) => (1 - math.exp(-2 * v)) / (1 + math.exp(-2 * v))
td(s) => nz((s - s[1]) / s[1])
calc_dl(float[] n_arr, float[] w_arr) =>
h = array.new_float(0)
for i = 0 to 5
float s = 0.0
for j = 0 to 3
s += array.get(n_arr, j) * array.get(w_arr, (i * 5) + j)
array.push(h, tanh(s + array.get(w_arr, (i * 5) + 4)))
float out = array.get(w_arr, 36)
for i = 0 to 5
out += array.get(h, i) * array.get(w_arr, 30 + i)
tanh(out)
polyreg(s, l, d, e) =>
float[] res = array.new_float(0)
if barstate.islast
X = matrix.new<float>(l, d + 1, 0.0)
Y = matrix.new<float>(l, 1, 0.0)
for i = 0 to l - 1
matrix.set(Y, i, 0, s[l - 1 - i])
for j = 0 to d
matrix.set(X, i, j, math.pow(i, j))
XtX = matrix.mult(matrix.transpose(X), X)
XtY = matrix.mult(matrix.transpose(X), Y)
b = matrix.mult(matrix.inv(XtX), XtY)
for i = 0 to l + e - 1
p = 0.0
for j = 0 to d
p += matrix.get(b, j, 0) * math.pow(i, j)
array.push(res, p)
res
// --- 6. Girdiler & Ağırlıklar ---
gann_p = input.float(0.1, "Gann Hız Katsayısı (P)", step=0.01)
gann_t = input.int(21, "Gann Zaman Aralığı (T)")
poly_extra = input.int(5, "Polinom Tahmin Menzili")
v_shrek = input.color(#cd01fb00, "Vibe"), v_blood = input.color(#cd01fb00, "Vibe Boğa (Lime)")
v_smooth22 = input.int(21, "Vibe Yumuşatma", minval=1)
v_girth22 = input.int(2, "Vibe Çizgi Kalınlığı")
w_o = array.from(0.0305, 5.1130, -26.0857, -5.3202, 7.3547, 4.1679, 7.2258, -0.8712, -8.8945, -7.0647, -0.8062, -0.3044, -3.9097, -5.0099, 5.1275, -29.7360, 28.6684, 0.1384, -57.5885, 2.8249, -0.4293, 0.4827, -0.7897, -2.9874, -4.3107, 1.7583, -0.6180, 2.4493, -1.5831, 1.1658, -0.6530, -4.6469, -1.6789, -17.0776, 0.8754, -6.6724, 6.9407)
w_h = array.from(10.1865, -30.9648, 21.6723, -40.8958, 7.9574, -15.2523, 14.8454, 10.6214, -23.8178, 2.9475, -15.1790, -30.0118, 35.6504, -61.4804, 3.8985, 35.6564, -11.1343, -28.0715, 2.9239, -1.8057, 3.4623, -13.6440, -30.2263, -1.0839, 23.0328, -47.2658, 19.0218, 10.5652, -27.5207, 6.9475, -0.6965, -1.3494, 27.2629, -1.0423, -0.5401, -10.7355, 1.3032)
w_l = array.from(4.3631, -18.3014, -15.3768, 21.2085, -0.4581, -2.6518, 5.2054, -5.9209, -4.8474, 8.3155, 13.8853, -5.5179, -15.2411, -8.6732, -4.9540, 10.4904, -25.2015, 10.2621, -1.1161, -5.2541, -14.6877, 9.0302, -17.3324, 8.0680, 0.7551, 0.8951, -1.7377, 4.8991, -7.7184, 5.4936, 4.1329, -17.5015, 4.6174, -28.4768, -5.8882, -24.4345, 41.3187)
w_c = array.from(22.4271, -26.6917, 4.9371, 9.0349, -10.6929, -38.2880, 10.0500, -44.7063, -17.8163, 30.5662, -33.9954, 14.5017, -43.2865, -13.3874, 24.7080, -14.3929, 28.4830, -22.9793, -7.6582, -5.6505, 28.8379, -26.3544, 0.5206, 25.0049, -17.8832, -4.8113, -4.0364, -8.3327, -1.1571, 0.4667, -22.0533, 3.6525, -4.3904, 2.1030, 20.0272, 11.5101, -0.4150)
// --- 7. Mizan Hesaplamaları ---
n_in = array.from(tanh(td(open)), tanh(td(high)), tanh(td(low)), tanh(td(close)))
f_v(p, w, div, n_arr) => p * (1 - (calc_dl(n_arr, w) - td(p) * div) / div)
o100 = f_v(open, w_o, 100, n_in), h100 = f_v(high, w_h, 100, n_in), l100 = f_v(low, w_l, 100, n_in), c100 = f_v(close, w_c, 100, n_in)
c1000 = f_v(close, w_c, 1000, n_in), o1000 = f_v(open, w_o, 1000, n_in)
// --- 8. 09:55 Mihenk & Gann Hız ---
is_mihenk = hour == 9 and minute == 55
var float m100 = na, var float m1000 = na, var int start_idx = na, var float gann_hiz = na
if is_mihenk
m100 := c100, m1000 := c1000, start_idx := bar_index, gann_hiz := c1000
if not na(gann_hiz)
decay = (syminfo.mintick * 100 * gann_p) / gann_t
gann_hiz := gann_hiz + (c100 > m1000 ? decay : -decay)
// --- 9. Vibe Motoru 2 (Değişken Tanımı Düzeltilmiş) ---
var int vibe = 0
var float entryPrice = na
var float threshold = na
if vibe == 0 and bar_index > 10
vibe := close > open ? 1 : -1
entryPrice := get_origin(vibe)
threshold := vibe == 1 ? high : low
if vibe == 1
if high > threshold
threshold := high
entryPrice := get_origin(1)
else if vibe == -1
if low < threshold
threshold := low
entryPrice := get_origin(-1)
squeezed = vibe == -1 and ta.ema(close, v_smooth22) > entryPrice
rekt = vibe == 1 and ta.ema(close, v_smooth22) < entryPrice
if squeezed or rekt
vibe := squeezed ? 1 : -1
entryPrice := get_origin(vibe)
threshold := vibe == 1 ? high : low
plot(entryPrice, "0", color=vibe == 1 ? v_blood : v_shrek, linewidth=v_girth22)
// --- 10. Görselleştirme ---
plotcandle(o100, h100, l100, c100, "4", color=c100 > c100[100] ? color.rgb(243, 244, 237, 95) : color.rgb(248, 4, 4, 95), bordercolor=color.new(color.yellow, 45))
plotcandle(f_v(open,w_o,250,n_in), f_v(high,w_h,250,n_in), f_v(low,w_l,250,n_in), f_v(close,w_c,250,n_in), "3", color=na, bordercolor=color.new(#d303f8, 25))
plotcandle(f_v(open,w_o,500,n_in), f_v(high,w_h,500,n_in), f_v(low,w_l,500,n_in), f_v(close,w_c,500,n_in), "2", color=na, bordercolor=color.new(color.lime, 30))
isBull1000 = c1000 > o1000
plotcandle(o1000 + (c1000 - o1000) * 0.33, f_v(high,w_h,1000,n_in), f_v(low,w_l,1000,n_in), o1000 + (c1000 - o1000) * 0.66, "1", color=color.new(isBull1000 ? color.lime : color.red, 00), bordercolor=color.new(color.fuchsia, 100))
plot(gann_hiz, "Hız", color=color.aqua, linewidth=1, style=plot.style_linebr)
// Yıldızlar & Polinom
isC = barstate.isconfirmed
if isC and close > open and close > high[1] and open <= high[1] and c100 > gann_hiz and c100 > m1000
label.new(bar_index, high + ta.atr(14)*0.3, "✦", color=color.new(color.yellow, 100), textcolor=color.yellow, style=label.style_label_down, size=size.large)
if isC and close < open and close < low[1] and open >= low[1] and c100 < gann_hiz and c100 < m1000
label.new(bar_index, low - ta.atr(14)*0.3, "✦", color=color.new(color.blue, 100), textcolor=color.blue, style=label.style_label_up, size=size.large)
preds = polyreg(close, gann_t, 1, poly_extra)
if barstate.islast and array.size(preds) > 0
lVal = array.get(preds, array.size(preds) - 1), pCol = lVal > array.get(preds, array.size(preds) - 2) ? color.rgb(255, 255, 255) : color.rgb(0, 0, 0)
pts = array.new<chart.point>(0)
for i = 0 to array.size(preds) - 1
array.push(pts, chart.point.from_index(bar_index - gann_t + 1 + i, array.get(preds, i)))
polyline.new(pts, line_color=pCol, line_width=2)
// --- 11. Tünel & Tablo ---
var line L100 = na, var line L1000 = na, var linefill F_FILL = na
if not na(start_idx) and barstate.islast
line.delete(L100), line.delete(L1000), linefill.delete(F_FILL)
L100 := line.new(start_idx, m100, bar_index + 10, m100, color=color.rgb(0, 0, 0), width=2)
L1000 := line.new(start_idx, m1000, bar_index + 10, m1000, color=color.rgb(253, 253, 253), width=2)
var table tb1 = table.new(position.bottom_center, 1, 1, bgcolor = #161114)
if barstate.islast
valTxt = na(m1000) ? "OTOMATİK HESAPLAMADIR." : "Ş: " + str.tostring(m1000, format.mintick) + " | S: " + str.tostring(m100, format.mintick)
table.cell(tb1, 0, 0, '(Aİ)OLASILIK | ' + valTxt + ' | Eğitim çalışması olup, Yatırım Tavsiyesi Olarak KULLANILAMAZ...@yörük@ 2026', text_color = #f4f2ef)
// --- 12. Gann Modülü (v6 Nizamı) ---
tf_gann = input.timeframe('60', title='Gann Zaman Dilimi')
p_range = input.float(0.1, title='Gann Fiyat Aralığı')
t_range = input.int(21, title='Gann Bar Aralığı')
f_zigzag(_h, _l) =>
var int _tr = 0
_up = _h > _h[1]
_dn = _l < _l[1]
_tr := (_tr > 0 and _dn) ? -1 : (_tr < 0 and _up) ? 1 : (_tr == 0 ? (_up ? 1 : -1) : _tr)
ta.change(_tr) > 0 ? _l[1] : ta.change(_tr) < 0 ? _h[1] : na
zigzag_raw = f_zigzag(high, low)
zigzag_src = request.security(syminfo.tickerid, tf_gann, ta.valuewhen(not na(zigzag_raw), zigzag_raw, 0))
f_bull_gann_line(_pr, _tr, _src) =>
_decay = _pr / _tr
var float _g_line = na
_g_line := nz(_g_line) - _decay
if ta.change(_src) != 0
_g_line := _src
_g_line
bull_gann_1_1 = f_bull_gann_line(p_range, t_range, zigzag_src)
plot(ta.change(zigzag_src) > 0 ? na : bull_gann_1_1, title='Saat', color=color.new(#000000, 0), linewidth=2, style=plot.style_linebr)
// --- 13. Mühürler (0 ve o) [HATA GİDERİLDİ] ---
// [DÜZELTME]: Eksik tanımlamalar (isClosed963, Renkler) buraya eklendi.
isClosed963 = barstate.isconfirmed
brightRed963 = color.black // 0 için siyah (Gündüz modu için görünürlük)
brightGreen963 = color.white // 0 için beyaz
spaceUp963 = (high - close) * 0.35
spaceDown963 = (open - low) * 0.35
bullRaw12963 = isClosed963 and close[1] < open[1] and close < open and close < low[1]
bearRaw12963 = isClosed963 and close[1] > open[1] and close > open and close > high[1]
if bullRaw12963
label.new(bar_index - 1, high[1] + spaceUp963, '0', style=label.style_none, textcolor=brightRed963, size=size.huge)
label.new(bar_index - 1, high + spaceUp963, 'o', style=label.style_none, textcolor=brightRed963, size=size.huge)
if bearRaw12963
label.new(bar_index - 1, low[1] - spaceDown963, '0', style=label.style_none, textcolor=brightGreen963, size=size.huge)
label.new(bar_index - 1, low - spaceDown963, 'o', style=label.style_none, textcolor=brightGreen963, size=size.huge)

Alıntı yaparak yanıtla
Yer İmleri