PHP Code:
//@version=5
indicator("🌷", overlay=true, max_lines_count=500, max_labels_count=500)
////
// ─────────────────────────────────────────────────────────────────
// MOTOR AYARLARI (PSAR)
// ─────────────────────────────────────────────────────────────────
grpCore = "Motor Ayarlarύ"
p1_acc = input.float(0.4, "1. SAR (Φncό)", step=0.01, group=grpCore)
p2_acc = input.float(0.02, "2. SAR (Hύzlύ)", step=0.01, group=grpCore)
p3_acc = input.float(0.1, "3. SAR (Ana Hedef)", step=0.01, group=grpCore)
p1 = ta.sar(p1_acc, p1_acc, 0.2)
p2 = ta.sar(p2_acc, p2_acc, 0.2)
p3 = ta.sar(p3_acc, p3_acc, 0.1)
p1_bull = close > p1
p2_bull = close > p2
p3_bull = close > p3
p1_bear = close < p1
p2_bear = close < p2
p3_bear = close < p3
p1_al = ta.crossover(close, p1)
p1_sat = ta.crossunder(close, p1)
p2_al = ta.crossover(close, p2)
p2_sat = ta.crossunder(close, p2)
p3_al = ta.crossover(close, p3)
p3_sat = ta.crossunder(close, p3)
// ─────────────────────────────────────────────────────────────────
// YAPI VE DέNAMέK FέBONACCέ (MέZAN)
// ─────────────────────────────────────────────────────────────────
swing_len = 3
ph = ta.pivothigh(high, swing_len, swing_len)
pl = ta.pivotlow(low, swing_len, swing_len)
var float res_level = na
var float sup_level = na
if not na(ph)
res_level := ph
if not na(pl)
sup_level := pl
// Dinamik Fibo Hesaplamasύ
float fibo_top = not na(res_level) ? (high > res_level ? high : res_level) : high
float fibo_bot = not na(sup_level) ? (low < sup_level ? low : sup_level) : low
float fibo_range = fibo_top - fibo_bot
f_618 = fibo_bot + fibo_range * 0.618
f_500 = fibo_bot + fibo_range * 0.500
f_382 = fibo_bot + fibo_range * 0.382
// ─────────────────────────────────────────────────────────────────
// MTK DAέRE FORMU: SέNYAL VE HEDEF KURALLARI
// ─────────────────────────────────────────────────────────────────
// LONG (AL)
mtk1_long = p1_al and p2_bear and p3_bear
mtk2_long = p2_al and p3_bear
mtk1_2_long = p1_al and p2_al and p3_bear
devam_long = p3_al and p1_bull and p2_bull
// SHORT (SAT)
mtk1_short = p1_sat and p2_bull and p3_bull
mtk2_short = p2_sat and p3_bull
mtk1_2_short = p1_sat and p2_sat and p3_bull
devam_short = p3_sat and p1_bear and p2_bear
// Hedef Takip Mekanizmasύ
var string aktif_faz = "BEKLEMEDE"
var string yon = "YATAY"
if mtk1_long or mtk1_short
aktif_faz := "FAZ 1 (Hedef 2. SAR)"
yon := mtk1_long ? "BOΠA" : "AYI"
if mtk2_long or mtk1_2_long or mtk2_short or mtk1_2_short
aktif_faz := "FAZ 2 (Hedef 3. SAR)"
yon := (mtk2_long or mtk1_2_long) ? "BOΠA" : "AYI"
if devam_long or devam_short
aktif_faz := "FAZ 3 (DEVAM)"
yon := devam_long ? "BOΠA" : "AYI"
if (yon == "BOΠA" and p1_sat) or (yon == "AYI" and p1_al)
aktif_faz := "TREND YORULDU"
yon := "YATAY"
// Grafik άzerinde Gφsterilecek Gφrsel Hedef Deπeri (Dinamik)
float gorsel_hedef = na
if aktif_faz == "FAZ 1 (Hedef 2. SAR)"
gorsel_hedef := p2
else if aktif_faz == "FAZ 2 (Hedef 3. SAR)"
gorsel_hedef := p3
// ─────────────────────────────────────────────────────────────────
// GΦRSELLEήTέRME
// ─────────────────────────────────────────────────────────────────
// Fibo Seviyeleri
plot(f_618, "0.618", color=color.new(color.silver, 100), style=plot.style_linebr)
plot(f_500, "0.500", color=color.new(color.silver, 100), style=plot.style_linebr)
plot(f_382, "0.382", color=color.new(color.silver, 100), style=plot.style_linebr)
// Motorlar
plot(p1, "1.", color=color.new(color.white, 00), style=plot.style_linebr, linewidth=1)
plot(p2, "2.", color=color.new(color.aqua, 00), style=plot.style_linebr, linewidth=1)
plot(p3, "3.", color=color.new(color.yellow, 0), style=plot.style_linebr, linewidth=1)
// Gφrsel Hedef έzleyici (Gόmόώ Halkalar)
plot(gorsel_hedef, "Hedef", color=color.new(color.orange, 00), style=plot.style_circles, linewidth=4)
// Etiketler
plotshape(mtk1_long, "1L", shape.triangleup, location.belowbar, color.white, size=size.small, text="1")
plotshape(mtk2_long, "2L", shape.triangleup, location.belowbar, color.aqua, size=size.small, text="2")
plotshape(mtk1_2_long, "1+2L", shape.triangleup, location.belowbar, color.lime, size=size.small, text="1+2")
plotshape(devam_long, "DEVAM", shape.flag, location.belowbar, color.yellow, size=size.small, text="@")
plotshape(mtk1_short, "1S", shape.triangledown, location.abovebar, color.white, size=size.small, text="1")
plotshape(mtk2_short, "2S", shape.triangledown, location.abovebar, color.aqua, size=size.small, text="2")
plotshape(mtk1_2_short, "1+2S", shape.triangledown, location.abovebar, color.red, size=size.small, text="1+2")
plotshape(devam_short, "DEVAM", shape.flag, location.abovebar, color.yellow, size=size.small, text="@")
// ─────────────────────────────────────────────────────────────────
// v6 BέLGέ TABLOSU (DASHBOARD)
// ─────────────────────────────────────────────────────────────────
var table v6Table = table.new(position.top_right, 2, 6, bgcolor=color.new(color.black, 30), border_width=1)
if barstate.islast
table.cell(v6Table, 0, 0, "@yφrόk@", text_color=color.gray, text_size=size.small)
table.cell(v6Table, 1, 0, "Yatύrύm Tavsiyesi DEΠέLDέR.", text_color=color.gray, text_size=size.small)
table.cell(v6Table, 0, 1, "1.(0.04)", text_color=color.white, text_size=size.small)
table.cell(v6Table, 1, 1, p1_bull ? "BOΠA" : "AYI", text_color=p1_bull ? color.lime : color.red)
table.cell(v6Table, 0, 2, "2.(0.02)", text_color=color.aqua, text_size=size.small)
table.cell(v6Table, 1, 2, p2_bull ? "BOΠA" : "AYI", text_color=p2_bull ? color.lime : color.red)
table.cell(v6Table, 0, 3, "Ana(0.01)", text_color=color.yellow, text_size=size.small)
table.cell(v6Table, 1, 3, p3_bull ? "BOΠA" : "AYI", text_color=p3_bull ? color.lime : color.red)
table.cell(v6Table, 0, 4, "Sistem Yφnό", text_color=color.white, text_size=size.small)
table.cell(v6Table, 1, 4, yon, text_color=yon == "BOΠA" ? color.lime : yon == "AYI" ? color.red : color.gray)
table.cell(v6Table, 0, 5, "Durum", text_color=color.white, text_size=size.small)
table.cell(v6Table, 1, 5, aktif_faz, text_color=color.silver, text_size=size.small)
////////////////////////
swingLen = input.int(3, "Swing Length (bars)", minval=3, maxval=50, group="Swing Detection")
maxSwings = input.int(4, "Max Swings per Side", minval=4, maxval=15, group="Swing Detection")
useFib236 = input.bool(false, "0.236", group="Retracement Levels", inline="r1")
useFib382 = input.bool(false, "0.382", group="Retracement Levels", inline="r1")
useFib500 = input.bool(false, "0.500", group="Retracement Levels", inline="r1")
useFib618 = input.bool(true, "0.618", group="Retracement Levels", inline="r2")
useFib786 = input.bool(false, "0.786", group="Retracement Levels", inline="r2")
useFib1000 = input.bool(false, "1.000", group="Retracement Levels", inline="r2")
showExt113 = input.bool(false, "1.130 (above high)", group="Extension Zones", inline="e1")
showExt127 = input.bool(false, "1.270 (above high)", group="Extension Zones", inline="e1")
showExtN013 = input.bool(false, "-0.130 (below low)", group="Extension Zones", inline="e2")
showExtN027 = input.bool(false, "-0.270 (below low)", group="Extension Zones", inline="e2")
atrMult = input.float(0.5, "Cluster Tolerance (x ATR)", minval=0.1, maxval=3.0, step=0.1, group="Clustering",
tooltip="Two Fib levels from different swing pairs must be within this distance to be counted as confluent. Default 0.5x ATR.")
minStr = input.int(2, "Min Cluster Strength", minval=2, maxval=20, group="Clustering",
tooltip="Minimum number of distinct swing pairs that must agree on a zone for it to be displayed.")
maxClusters = input.int(5, "Max Clusters to Display", minval=1, maxval=10, group="Clustering")
sepMult = input.float(1.5, "Min Separation (x ATR)", minval=0.5, maxval=5.0, step=0.1, group="Clustering",
tooltip="Minimum center-to-center distance between displayed zones. Prevents visual crowding.")
zoneHalfMult = input.float(0.2, "Zone Half-Height (x ATR)", minval=0.1, maxval=2.0, step=0.1, group="Display")
showDots = input.bool(false, "Show Swing Dots", group="Display")
showLabels = input.bool(false, "Show Zone Labels", group="Display")
showDash = input.bool(false, "Show Dashboard", group="Display")
dashSize = input.string("normal", "Dashboard Text Size", options=["tiny","small","normal","large"], group="Display")
extRight = input.int(60, "Extend Right (bars)", minval=5, maxval=300, group="Display")
colElite = input.color(#21c997, "Cluster Elite (>=6)", group="Colors")
colStrong = input.color(#26a69a, "Cluster Strong (4-5)", group="Colors")
colMedium = input.color(#00897b, "Cluster Medium (2-3)", group="Colors")
colExt1 = input.color(#cc24e2, "Ext 1.130 / -0.130", group="Colors")
colExt2 = input.color(#880e4f, "Ext 1.270 / -0.270", group="Colors")
boxTransp = input.int(75, "Box Transparency", minval=0, maxval=100, group="Colors")
brdTransp = input.int(40, "Border Transparency", minval=0, maxval=100, group="Colors")
colLabel = input.color(color.white, "Label Text", group="Colors")
type SwingPt
float price
int barIdx
bool isHigh
type FibCluster
float center
int strength
type DashEntry
float price
int strength
bool isExt
bool isAbove
getDashSize(string s) =>
switch s
"tiny" => size.tiny
"small" => size.small
"large" => size.large
=> size.normal
getCurrentSession() =>
int h = hour(time, "GMT")
string sess = h >= 0 and h < 8 ? "Asian" : h >= 8 and h < 13 ? "London" : h >= 13 and h < 17 ? "London-NY" : h >= 17 and h < 22 ? "New York" : "Asian"
sess
float atr14 = ta.atr(14)
float phVal = ta.pivothigh(high, swingLen, swingLen)
float plVal = ta.pivotlow(low, swingLen, swingLen)
float adr10 = ta.sma(high - low, 10)
var array<SwingPt> swingHighs = array.new<SwingPt>()
var array<SwingPt> swingLows = array.new<SwingPt>()
int swingCap = math.min(maxSwings, 15)
if not na(phVal)
array.unshift(swingHighs, SwingPt.new(phVal, bar_index[swingLen], true))
if array.size(swingHighs) > swingCap
array.pop(swingHighs)
if not na(plVal)
array.unshift(swingLows, SwingPt.new(plVal, bar_index[swingLen], false))
if array.size(swingLows) > swingCap
array.pop(swingLows)
plotshape(showDots and not na(phVal), title="SH", location=location.abovebar, style=shape.circle, color=color.new(#21c997, 20), size=size.tiny)
plotshape(showDots and not na(plVal), title="SL", location=location.belowbar, style=shape.circle, color=color.new(#cc24e2, 20), size=size.tiny)
var array<box> drawnBoxes = array.new<box>()
var array<line> drawnLines = array.new<line>()
var array<label> drawnLabels = array.new<label>()
var table dashTbl = na
if barstate.islast
for bx in drawnBoxes
box.delete(bx)
for ln in drawnLines
line.delete(ln)
for lb in drawnLabels
label.delete(lb)
array.clear(drawnBoxes)
array.clear(drawnLines)
array.clear(drawnLabels)
int nH = array.size(swingHighs)
int nL = array.size(swingLows)
float clusterTol = atr14 * atrMult
float minRange = atr14 * 2.0
array<FibCluster> clusters = array.new<FibCluster>()
array<int> pairHits = array.new_int()
float domHigh = na
float domLow = na
float domRange = 0.0
if nH > 0 and nL > 0
for hi = 0 to nH - 1
SwingPt sh = array.get(swingHighs, hi)
for li = 0 to nL - 1
SwingPt sl = array.get(swingLows, li)
float rng = sh.price - sl.price
if rng < minRange
continue
if rng > domRange
domRange := rng
domHigh := sh.price
domLow := sl.price
array<float> pairLevels = array.new_float()
if useFib236
array.push(pairLevels, sh.price - rng * 0.236)
if useFib382
array.push(pairLevels, sh.price - rng * 0.382)
if useFib500
array.push(pairLevels, sh.price - rng * 0.500)
if useFib618
array.push(pairLevels, sh.price - rng * 0.618)
if useFib786
array.push(pairLevels, sh.price - rng * 0.786)
if useFib1000
array.push(pairLevels, sh.price - rng * 1.000)
int nLevels = array.size(pairLevels)
if nLevels == 0
continue
int nC = array.size(clusters)
array<bool> pairContributed = array.new<bool>()
for k = 0 to math.max(0, nC - 1)
array.push(pairContributed, false)
for lv = 0 to nLevels - 1
float lp = array.get(pairLevels, lv)
int bestK = -1
float bestDist = clusterTol + 1.0
int nCurr = array.size(clusters)
if nCurr > 0
for k = 0 to nCurr - 1
FibCluster ck = array.get(clusters, k)
float dist = math.abs(lp - ck.center)
if dist <= clusterTol and dist < bestDist
bestDist := dist
bestK := k
if bestK >= 0
FibCluster ck = array.get(clusters, bestK)
bool alreadyHit = array.size(pairContributed) > bestK ? array.get(pairContributed, bestK) : false
float newCenter = (ck.center * ck.strength + lp) / (ck.strength + 1)
ck.center := newCenter
if not alreadyHit
ck.strength := ck.strength + 1
if array.size(pairContributed) > bestK
array.set(pairContributed, bestK, true)
array.set(clusters, bestK, ck)
else
array.push(clusters, FibCluster.new(lp, 1))
array.push(pairContributed, true)
int nRaw = array.size(clusters)
array<FibCluster> qualified = array.new<FibCluster>()
if nRaw > 0
for k = 0 to nRaw - 1
FibCluster ck = array.get(clusters, k)
if ck.strength >= minStr
array.push(qualified, ck)
int nQ = array.size(qualified)
if nQ > 1
for i = 0 to nQ - 2
for j = 0 to nQ - 2 - i
FibCluster ca = array.get(qualified, j)
FibCluster cb = array.get(qualified, j + 1)
if ca.strength < cb.strength
array.set(qualified, j, cb)
array.set(qualified, j + 1, ca)
array<FibCluster> selected = array.new<FibCluster>()
float minSep = atr14 * sepMult
if nQ > 0
for i = 0 to nQ - 1
if array.size(selected) >= maxClusters
break
FibCluster cand = array.get(qualified, i)
bool overlaps = false
int nSel = array.size(selected)
if nSel > 0
for j = 0 to nSel - 1
FibCluster ex = array.get(selected, j)
if math.abs(cand.center - ex.center) < minSep
overlaps := true
break
if not overlaps
array.push(selected, cand)
int nSel = array.size(selected)
float zoneHalf = atr14 * zoneHalfMult
if nSel > 0
for i = 0 to nSel - 1
FibCluster cl = array.get(selected, i)
int rank = i + 1
int s = cl.strength
float zTop = cl.center + zoneHalf
float zBottom = cl.center - zoneHalf
color baseCol = s >= 6 ? colElite : s >= 4 ? colStrong : colMedium
color bgCol = color.new(baseCol, boxTransp)
color bdCol = color.new(baseCol, brdTransp)
box newBox = box.new(left=bar_index - 300, top=zTop, right=bar_index + extRight, bottom=zBottom, bgcolor=bgCol, border_color=bdCol, border_width=1, extend=extend.none)
array.push(drawnBoxes, newBox)
line newLine = line.new(x1=bar_index - 300, y1=cl.center, x2=bar_index + extRight, y2=cl.center, color=color.new(baseCol, math.max(0, brdTransp - 10)), style=line.style_dashed, width=1)
array.push(drawnLines, newLine)
if showLabels
string tier = s >= 6 ? "ELITE" : s >= 4 ? "STRONG" : "MEDIUM"
float distPct = math.abs(close - cl.center) / close * 100.0
string txt = "#" + str.tostring(rank) + " STR " + str.tostring(s) + " " + tier + " " + str.tostring(distPct, "#.##") + "% away"
label newLabel = label.new(x=bar_index + extRight, y=cl.center, text=txt, color=color.new(color.black, 100), textcolor=colLabel, size=size.normal, style=label.style_label_left, xloc=xloc.bar_index)
array.push(drawnLabels, newLabel)
bool hasDomSwing = not na(domHigh) and not na(domLow) and domRange > 0.0
float ep1 = na
float ep2 = na
float en1 = na
float en2 = na
if hasDomSwing
if showExt113
ep1 := domHigh + domRange * 0.130
array.push(drawnBoxes, box.new(left=bar_index - 300, top=ep1 + zoneHalf, right=bar_index + extRight, bottom=ep1 - zoneHalf, bgcolor=color.new(colExt1, boxTransp), border_color=color.new(colExt1, brdTransp), border_width=1, extend=extend.none))
array.push(drawnLines, line.new(x1=bar_index - 300, y1=ep1, x2=bar_index + extRight, y2=ep1, color=color.new(colExt1, math.max(0, brdTransp - 10)), style=line.style_dashed, width=1))
if showLabels
float dp1 = math.abs(close - ep1) / close * 100.0
array.push(drawnLabels, label.new(x=bar_index + extRight, y=ep1, text="EXT 1.130 " + str.tostring(dp1, "#.##") + "% away", color=color.new(color.black, 100), textcolor=colLabel, size=size.normal, style=label.style_label_left, xloc=xloc.bar_index))
if showExt127
ep2 := domHigh + domRange * 0.270
array.push(drawnBoxes, box.new(left=bar_index - 300, top=ep2 + zoneHalf, right=bar_index + extRight, bottom=ep2 - zoneHalf, bgcolor=color.new(colExt2, boxTransp), border_color=color.new(colExt2, brdTransp), border_width=1, extend=extend.none))
array.push(drawnLines, line.new(x1=bar_index - 300, y1=ep2, x2=bar_index + extRight, y2=ep2, color=color.new(colExt2, math.max(0, brdTransp - 10)), style=line.style_dashed, width=1))
if showLabels
float dp2 = math.abs(close - ep2) / close * 100.0
array.push(drawnLabels, label.new(x=bar_index + extRight, y=ep2, text="EXT 1.270 " + str.tostring(dp2, "#.##") + "% away", color=color.new(color.black, 100), textcolor=colLabel, size=size.normal, style=label.style_label_left, xloc=xloc.bar_index))
if showExtN013
en1 := domLow - domRange * 0.130
array.push(drawnBoxes, box.new(left=bar_index - 300, top=en1 + zoneHalf, right=bar_index + extRight, bottom=en1 - zoneHalf, bgcolor=color.new(colExt1, boxTransp), border_color=color.new(colExt1, brdTransp), border_width=1, extend=extend.none))
array.push(drawnLines, line.new(x1=bar_index - 300, y1=en1, x2=bar_index + extRight, y2=en1, color=color.new(colExt1, math.max(0, brdTransp - 10)), style=line.style_dashed, width=1))
if showLabels
float dn1 = math.abs(close - en1) / close * 100.0
array.push(drawnLabels, label.new(x=bar_index + extRight, y=en1, text="EXT -0.130 " + str.tostring(dn1, "#.##") + "% away", color=color.new(color.black, 100), textcolor=colLabel, size=size.normal, style=label.style_label_left, xloc=xloc.bar_index))
if showExtN027
en2 := domLow - domRange * 0.270
array.push(drawnBoxes, box.new(left=bar_index - 300, top=en2 + zoneHalf, right=bar_index + extRight, bottom=en2 - zoneHalf, bgcolor=color.new(colExt2, boxTransp), border_color=color.new(colExt2, brdTransp), border_width=1, extend=extend.none))
array.push(drawnLines, line.new(x1=bar_index - 300, y1=en2, x2=bar_index + extRight, y2=en2, color=color.new(colExt2, math.max(0, brdTransp - 10)), style=line.style_dashed, width=1))
if showLabels
float dn2 = math.abs(close - en2) / close * 100.0
array.push(drawnLabels, label.new(x=bar_index + extRight, y=en2, text="EXT -0.270 " + str.tostring(dn2, "#.##") + "% away", color=color.new(color.black, 100), textcolor=colLabel, size=size.normal, style=label.style_label_left, xloc=xloc.bar_index))
/////////////
///////////////////////
// --- 1. AYARLAR: KUTU VE GΦRSELLέK ---
i_boxColor = input.color(color.new(#787b86, 92), "Ana Kutu (Range) Arka Planύ", group="Gφrsel Ayarlar")
i_gpBullishColor = input.color(color.new(#4caf50, 60), "Destek GP Rengi", group="Gφrsel Ayarlar")
i_gpBearishColor = input.color(color.new(#f44336, 60), "Direnη GP Rengi", group="Gφrsel Ayarlar")
i_liqColor = input.color(color.new(#ffeb3b, 85), "Likidite Bφlgeleri Rengi", group="Gφrsel Ayarlar")
i_lineColor = input.color(color.white, "Ηizgi Rengi", group="Gφrsel Ayarlar")
i_autoFit = input.bool(true, "Kutuyu Son Tepe/Dibe Otomatik Uyarla", group="Hesaplama Ayarlarύ")
i_dynamicExpand = input.bool(false, "Dinamik Geniώlemeyi Etkinleώtir", group="Hesaplama Ayarlarύ")
i_lookback = input.int(500, "Geriye Dφnόk Tarama (Max 300)", minval=2, maxval=500, group="Hesaplama Ayarlarύ")
i_offsetR = input.int(10, "Kutuyu Saπa Uzat (Bar Sayύsύ)", minval=0, group="Hesaplama Ayarlarύ")
i_showLabels = input.bool(true, "Fiyat Ηizgilerini ve Etiketleri Gφster", group="Gφrsel Ayarlar")
// --- 2. HESAPLAMALAR: YAPI VE SINIRLAR ---
float windowHigh = ta.highest(high, i_lookback)
float windowLow = ta.lowest(low, i_lookback)
var float rHigh = na
var float rLow = na
if barstate.islast
if i_dynamicExpand
rHigh := windowHigh
rLow := windowLow
else
rHigh := high[i_lookback] > windowHigh ? high[i_lookback] : windowHigh
rLow := low[i_lookback] < windowLow ? low[i_lookback] : windowLow
int hOffLookback = ta.highestbars(high, i_lookback)
int lOffLookback = ta.lowestbars(low, i_lookback)
int anchorBar = i_autoFit ? math.min(bar_index + hOffLookback, bar_index + lOffLookback) : (bar_index - i_lookback)
// Golden Pocket (Altύn Oran) Mesafe Hesaplarύ
float rDiff = rHigh - rLow
float bUp = rLow + (rDiff * 0.382)
float bLo = rLow + (rDiff * 0.35)
float sUp = rHigh - (rDiff * 0.35)
float sLo = rHigh - (rDiff * 0.382)
// --- 3. GΦRSELLEήTέRME: KUTULAR VE ETέKETLER ---
var box b_Range = box.new(na, na, na, na, xloc=xloc.bar_index, bgcolor=i_boxColor, border_color=color.gray)
var box b_Bullish = box.new(na, na, na, na, xloc=xloc.bar_index, bgcolor=i_gpBullishColor, border_color=na, text="", text_color=color.white, text_size=size.small)
var box b_Bearish = box.new(na, na, na, na, xloc=xloc.bar_index, bgcolor=i_gpBearishColor, border_color=na, text="", text_color=color.white, text_size=size.small)
var box b_LiqTop = box.new(na, na, na, na, xloc=xloc.bar_index, bgcolor=i_liqColor, border_color=na, text="", text_color=color.white, text_size=size.tiny)
var box b_LiqBot = box.new(na, na, na, na, xloc=xloc.bar_index, bgcolor=i_liqColor, border_color=na, text="", text_color=color.white, text_size=size.tiny)
var line[] l_levels = array.new_line()
var label[] lb_prices = array.new_label()
if barstate.isfirst
for i = 0 to 7
array.push(l_levels, line.new(na, na, na, na, xloc=xloc.bar_index, color=i_lineColor))
array.push(lb_prices, label.new(na, na, "", xloc=xloc.bar_index, color=color.new(color.black, 100), textcolor=i_lineColor, size=size.small, style=label.style_label_left))
if barstate.islast
int rightBar = bar_index + i_offsetR
// Kutularύ Yatay ve Dikey Olarak Ηiz
box.set_lefttop(b_Range, anchorBar, rHigh)
box.set_rightbottom(b_Range, rightBar, rLow)
box.set_lefttop(b_Bullish, anchorBar, bUp)
box.set_rightbottom(b_Bullish, rightBar, bLo)
box.set_lefttop(b_Bearish, anchorBar, sUp)
box.set_rightbottom(b_Bearish, rightBar, sLo)
box.set_lefttop(b_LiqTop, anchorBar, rHigh)
box.set_rightbottom(b_LiqTop, rightBar, rHigh - (rDiff * 0.05))
box.set_lefttop(b_LiqBot, anchorBar, rLow + (rDiff * 0.05))
box.set_rightbottom(b_LiqBot, rightBar, rLow)
// Sύnύr Ηizgilerini ve Fiyat Etiketlerini Yerleώtir
if i_showLabels
float[] p_vals = array.from(rHigh, rHigh - (rDiff * 0.05), sUp, sLo, bUp, bLo, rLow + (rDiff * 0.05), rLow)
for i = 0 to 7
float v = array.get(p_vals, i)
line.set_xy1(array.get(l_levels, i), anchorBar, v)
line.set_xy2(array.get(l_levels, i), rightBar, v)
label.set_xy(array.get(lb_prices, i), rightBar, v)
label.set_text(array.get(lb_prices, i), " " + str.tostring(v, format.mintick))
Yer έmleri