Untitled

Anonymous
Plain Text
08/17/2025 6:06 PM
2.4 KB
99
Indexable
Never
//@version=5
indicator("BIST MarketCap Hacim Girişi AL Sinyali (Auto)", overlay=true)

// === MarketCap Hesaplama (Tamamen Otomatik)
tso      = request.financial(syminfo.tickerid, "TOTAL_SHARES_OUTSTANDING", "FQ")
mc_final = na(tso) ? na : tso * close

// === MarketCap Formatlama
formatCap(val) =>
    if na(val)
        "—"
    else
        absVal = math.abs(val)
        sign   = val < 0 ? "-" : ""
        num    = absVal
        unit   = ""
        if absVal >= 1e12
            num := absVal / 1e12
            unit := " TR"
        else if absVal >= 1e9
            num := absVal / 1e9
            unit := " B"
        else if absVal >= 1e6
            num := absVal / 1e6
            unit := " M"
        else if absVal >= 1e3
            num := absVal / 1e3
            unit := " K"
        sign + str.tostring(num, "#.##") + unit

// === Köşe tablosu
var table t = table.new(position.top_right, 2, 2, border_width=1)
if barstate.islast
    table.cell(t, 0, 0, "Sembol", text_size=size.small, text_color=color.white, bgcolor=color.new(color.blue, 15))
    table.cell(t, 1, 0, syminfo.ticker, text_size=size.small)
    table.cell(t, 0, 1, "Piyasa Değeri", text_size=size.small, text_color=color.white, bgcolor=color.new(color.blue, 15))
    table.cell(t, 1, 1, formatCap(mc_final), text_size=size.small)

// === Grafikte son bar etiket
var label lbl = na
if barstate.islastconfirmedhistory
    txt = "MCap: " + formatCap(mc_final) + " (" + syminfo.currency + ")"
    if na(lbl)
        lbl := label.new(bar_index, high, text=txt, xloc=xloc.bar_index, yloc=yloc.price,
                         color=color.new(color.blue, 0), style=label.style_label_right, textcolor=color.white)
    else
        label.set_xy(lbl, bar_index, high)
        label.set_text(lbl, txt)

// === İşlem Tutarı (Fiyat x Hacim)
tradeValue = close * volume

// === Eşik değerler (%10 - %15)
lowThreshold  = mc_final * 0.10
highThreshold = mc_final * 0.15

// === AL Sinyali (Hacim girişi %10-15 arası)
buySignal = not na(mc_final) and tradeValue >= lowThreshold and tradeValue <= highThreshold

// === Grafiğe sinyal çiz
plotshape(buySignal, title="AL Sinyali", style=shape.triangleup,
          location=location.belowbar, color=color.lime, size=size.large, text="AL")

// === Alarm
alertcondition(buySignal, title="AL Sinyali", 
     message="İşlem hacmi MarketCap’in %10-15 aralığında → AL Sinyali")
Editor is loading...
Leave a Comment