//
https://t.me/version=6
indicator("Sell & Buy Aqlli Zonalari (Price Labels Only)", overlay=true, max_lines_count=500)
// 1. Matematik hisob-kitob funksiyasi
get_clean_dist(val, mult) =>
float product = val * mult
float root_val = math.sqrt(product)
float(math.round(root_val))
// 2. Chizish mantiqi
draw_logic(u_h, u_l, u_t, is_buy, prefix) =>
if u_h > 0 and u_l > 0
diff = math.abs(u_h - u_l)
float base = is_buy ? u_l : u_h
color main_c = is_buy ? #00FF00 : #FF0000 // Asosiy zonalar: Buy=Yashil, Sell=Qizil
// TP matn rangi
color tp_text_c = is_buy ? #00FF00 : #FF0000 // Buy=Yashil, Sell=Qizil
// --- HIGH/LOW SELEKTORLAR (Sichqoncha bilan boshqarish uchun) ---
http://line.new/(u_t, u_h, last_bar_time, u_h, xloc.bar_time, color=main_c, width=2)
http://line.new/(u_t, u_l, last_bar_time, u_l, xloc.bar_time, color=main_c, width=2)
http://label.new/(u_t, u_h, prefix + " H", xloc.bar_time, color=main_c, textcolor=color.white, style=label.style_label_down, size=size.small)
http://label.new/(u_t, u_l, prefix + " L", xloc.bar_time, color=main_c, textcolor=color.white, style=label.style_label_up, size=size.small)
// --- ASOSIY ZONALAR (Qalinligi 1) ---
d1 = get_clean_dist(diff, 9.0), d2 = get_clean_dist(diff, 6.18)
m2 = is_buy ? base + (d2 * 0.5) : base - (d2 * 0.5)
e2 = is_buy ? base + d2 : base - d2
m1 = is_buy ? base + (d1 * 0.5) : base - (d1 * 0.5)
e1 = is_buy ? base + d1 : base - d1
http://line.new/(u_t, m2, last_bar_time, m2, xloc.bar_time, color=main_c, width=1)
http://line.new/(u_t, e2, last_bar_time, e2, xloc.bar_time, color=main_c, width=1)
http://line.new/(u_t, m1, last_bar_time, m1, xloc.bar_time, color=main_c, width=1)
http://line.new/(u_t, e1, last_bar_time, e1, xloc.bar_time, color=main_c, width=1)
// --- TP FAQAT YOZUV VA NARX (Liniyasiz) ---
unit = (diff * 6.18) / 10
for i = 1 to 3
tp_price = is_buy ? m2 + (unit * i) : m2 - (unit * i)
// Liniya chizilmaydi, faqat label qo'yiladi
http://label.new/(last_bar_time, tp_price, prefix + " TP" + str.tostring(i) + ": " + str.tostring(tp_price, "#.###"),
xloc.bar_time,
color= http://color.new/(tp_text_c, 100),
textcolor=tp_text_c,
style=label.style_label_left,
size=size.normal)
// 3. SOZLAMALAR
g1 = "Sell zona topish uchun"
z1_h = input.price(0.0, "High", group=g1)
z1_l = input.price(0.0, "Low", group=g1)
z1_t = input.time(timestamp("2026-05-01 00:00"), "Sell Vaqti", group=g1)
g2 = "Buy zona topish uchun"
z2_h = input.price(0.0, "High", group=g2)
z2_l = input.price(0.0, "Low", group=g2)
z2_t = input.time(timestamp("2026-05-01 00:00"), "Buy Vaqti", group=g2)
// 4. Tozalash va Ijro
if barstate.islast
var lines = line.all
if array.size(lines) > 0
for i = array.size(lines) - 1 to 0
line.delete(array.get(lines, i))
var labels = label.all
if array.size(labels) > 0
for i = array.size(labels) - 1 to 0
label.delete(array.get(labels, i))
draw_logic(z1_h, z1_l, z1_t, false, "SELL")
draw_logic(z2_h, z2_l, z2_t, true, "BUY")