PHP Code:
//@version=5
indicator("🌷", overlay=true, max_lines_count=500, max_labels_count=500)
///////
// 3. Av Kφpeπi (Ηok hύzlύ tepki, ηok yόksek maksimum hύz)
sar_3 = ta.sar(0.001, 0.001, 0.2)
plot(sar_3, "@yφrόk@", color=color.new(color.orange, 00), style=plot.style_cross, linewidth=2)
// ─────────────────────────────────────────────────────────────────
// MOTOR AYARLARI (PSAR)
// ─────────────────────────────────────────────────────────────────
grpCore = "Motor Ayarlarύ"
p1_acc = input.float(0.04, "1.", step=0.01, group=grpCore)
p2_acc = input.float(0.02, "2.", step=0.01, group=grpCore)
p3_acc = input.float(0.01, "3.", 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)
// Motor Konumlarύ
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)
// ─────────────────────────────────────────────────────────────────
// TRέGONOMETRέK έVME (AΗI) HESAPLAMASI - MATS MANTIΠI
// ─────────────────────────────────────────────────────────────────
grpAngle = "έvme (Aηύ) Filtresi"
min_aci = input.float(10.0, "Minimum Akύώ Aηύsύ (Derece)", group=grpAngle, tooltip="Fiyatύn eπimi bu derecenin altύndaysa yatay piyasa sayύlύr ve sinyal όretilmez.")
// Eπim ve Aηύ Formόlό
atr_ivme = ta.ema(ta.tr, 14)
// Fiyatύn 10 mumluk deπiώimini ATR ile normalize ederek eπimi buluyoruz
egim = (close - close[10]) / (atr_ivme * 10)
// Eπimi radyana, ardύndan dereceye ηeviriyoruz
aci_radyan = math.atan(egim)
aci_derece = aci_radyan * 180 / math.pi
// έvme Onaylarύ (Aηύ yeterince dik mi?)
ivme_long_onay = aci_derece > min_aci
ivme_short_onay = aci_derece < -min_aci
// ─────────────────────────────────────────────────────────────────
// MTK DAέRE FORMU: SέNYAL KURALLARI (έVME FέLTRELέ)
// ─────────────────────────────────────────────────────────────────
// LONG (AL) - Hem PSAR kurallarύ saπlanmalύ hem de yukarύ ivme olmalύ
mtk1_long = p1_al and p2_bear and p3_bear and ivme_long_onay
mtk2_long = p2_al and p3_bear and ivme_long_onay
mtk1_2_long = p1_al and p2_al and p3_bear and ivme_long_onay
devam_long = p3_al and p1_bull and p2_bull and ivme_long_onay
// SHORT (SAT) - Hem PSAR kurallarύ saπlanmalύ hem de aώaπύ ivme olmalύ
mtk1_short = p1_sat and p2_bull and p3_bull and ivme_short_onay
mtk2_short = p2_sat and p3_bull and ivme_short_onay
mtk1_2_short = p1_sat and p2_sat and p3_bull and ivme_short_onay
devam_short = p3_sat and p1_bear and p2_bear and ivme_short_onay
// Hedef Takibi
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 ? "LONG" : "SHORT"
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) ? "LONG" : "SHORT"
if devam_long or devam_short
aktif_faz := "FAZ 3 (DEVAM)"
yon := devam_long ? "LONG" : "SHORT"
if (yon == "LONG" and p1_sat) or (yon == "SHORT" and p1_al)
aktif_faz := "TREND YORULDU"
yon := "YATAY"
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
// ─────────────────────────────────────────────────────────────────
plot(p1, "1.", color=color.new(color.blue, 00), style=plot.style_circles, linewidth=2)
plot(p2, "2.", color=color.new(color.white, 00), style=plot.style_circles, linewidth=2)
plot(p3, "3.", color=color.new(color.yellow, 00), style=plot.style_circles, linewidth=2)
plot(gorsel_hedef, "Hedef", color=color.new(color.fuchsia, 00), style=plot.style_cross, linewidth=4)
plotshape(mtk1_long, "1 AL", shape.triangleup, location.belowbar, color.white, size=size.small, text="1 AL")
plotshape(mtk2_long, "2 AL", shape.triangleup, location.belowbar, color.aqua, size=size.small, text="2 AL")
plotshape(mtk1_2_long, "1+2 AL", shape.triangleup, location.belowbar, color.lime, size=size.small, text="1+2 AL")
plotshape(devam_long, "DEVAM", shape.flag, location.belowbar, color.yellow, size=size.small, text="DEVAM")
plotshape(mtk1_short, "1 SAT", shape.triangledown, location.abovebar, color.white, size=size.small, text="1 SAT")
plotshape(mtk2_short, "2 SAT", shape.triangledown, location.abovebar, color.aqua, size=size.small, text="2 SAT")
plotshape(mtk1_2_short, "1+2 SAT", shape.triangledown, location.abovebar, color.red, size=size.small, text="1+2 SAT")
plotshape(devam_short, "DEVAM", shape.flag, location.abovebar, color.yellow, size=size.small, text="DEVAM")
// ─────────────────────────────────────────────────────────────────
// 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, "MTK MOTOR", text_color=color.gray, text_size=size.small)
table.cell(v6Table, 1, 0, "DURUM", 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 ? "BULL" : "BEAR", 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 ? "BULL" : "BEAR", 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 ? "BULL" : "BEAR", text_color=p3_bull ? color.lime : color.red)
// Aηύ bilgisini Tabloya ekledik
table.cell(v6Table, 0, 4, "(έvme)", text_color=color.white, text_size=size.small)
table.cell(v6Table, 1, 4, str.tostring(math.round(aci_derece, 1)) + "°", text_color=math.abs(aci_derece) > min_aci ? color.lime : color.gray)
table.cell(v6Table, 0, 5, "Mevcut Durum", text_color=color.white, text_size=size.small)
table.cell(v6Table, 1, 5, aktif_faz, text_color=color.silver, text_size=size.small)
////////////////////
// ─────────────────────────────────────────────────────────────────
// ORέJέNAL MATEMATέKSEL FONKSέYONLAR (HέΗ DOKUNULMADI)
// ─────────────────────────────────────────────────────────────────
cosh(float x) =>
(math.exp(x) + math.exp(-x)) / 2
acosh(float x) =>
x < 1 ? na : math.log(x + math.sqrt(x * x - 1))
sinh(float x) =>
(math.exp(x) - math.exp(-x)) / 2
asinh(float x) =>
math.log(x + math.sqrt(x * x + 1))
atan(float x) =>
math.pi / 2 - math.atan(1 / x)
chebyshevI(float src, int len, float ripple) =>
a = 0., b = 0., g = 0., chebyshev = 0.
a := cosh(1 / len * acosh(1 / (1 - ripple)))
b := sinh(1 / len * asinh(1 / ripple))
g := (a - b) / (a + b)
chebyshev := (1 - g) * src + g * nz(chebyshev[1])
chebyshev
bool_to_float(bool source) =>
source ? 1 : 0
ema(source)=>
var float ema = 0.0
var int count = 0
count := nz(count[1]) + 1
ema := (1.0 - 2.0 / (count + 1.0)) * nz(ema[1]) + 2.0 / (count + 1.0) * source
ema
atan2(y, x) =>
var float angle = 0.0
if x > 0
angle := math.atan(y / x)
else
if x < 0 and y >= 0
angle := math.atan(y / x) + math.pi
else
if x < 0 and y < 0
angle := math.atan(y / x) - math.pi
else
if x == 0 and y > 0
angle := math.pi / 2
else
if x == 0 and y < 0
angle := -math.pi / 2
angle
degrees(float source) =>
source * 180 / math.pi
tra()=>
atr = ema(ta.tr)
slope = (close - close[10]) / (atr * 10)
angle_rad = atan2(slope, 1)
degrees = degrees(angle_rad)
source = ta.sma((degrees > 0 ? high : low), 2)
mats(source, length) =>
smooth = 0.
higher_high = math.max(math.sign(ta.change(ta.highest(length))), 0)
lower_low = math.max(math.sign(ta.change(ta.lowest(length)) * -1), 0)
time_constant = math.pow(ta.sma(bool_to_float(higher_high or lower_low), length), 2)
smooth := nz(smooth[1] + time_constant * (source - smooth[1]), source)
wilders_period = length * 4 - 1
atr = math.abs(nz(smooth[1]) - smooth)
ma_atr = ta.ema(atr, wilders_period)
delta_fast_atr = ta.ema(ma_atr, wilders_period) * length * 0.4
result = 0.0
if smooth > nz(result[1])
if smooth - delta_fast_atr < result[1]
result := result[1]
else
result := smooth - delta_fast_atr
else
if smooth + delta_fast_atr > result[1]
result := result[1]
else
result := smooth + delta_fast_atr
result
// ─────────────────────────────────────────────────────────────────
// 3'Lά MOTOR AYARLARI VE HESAPLAMALARI
// ─────────────────────────────────────────────────────────────────
len1 = input.int(5, "1. Motor (Hύzlύ)")
len2 = input.int(20, "2. Motor (Orta)")
len3 = input.int(50, "3. Motor (Yavaώ / Ana)")
up_color = input.color(#00E676, "Yόkseliώ Rengi")
down_color = input.color(#FF1744, "Dόώόώ Rengi")
// Eπim deπeri her bar iηin sadece BέR KEZ hesaplanύr (Hafύza bozulmamasύ iηin)
src_tra = tra()
// 3 Farklύ Uzunluk iηin MATS Hesaplamasύ
mats_1 = mats(src_tra, len1)
mats_2 = mats(src_tra, len2)
mats_3 = mats(src_tra, len3)
// Renk Belirleme (Orijinal koddaki gibi SMA(2) ile kύyaslama)
sma_ref = ta.sma(close, 2)
c1 = sma_ref > mats_1 ? up_color : down_color
c2 = sma_ref > mats_2 ? up_color : down_color
c3 = sma_ref > mats_3 ? up_color : down_color
// ─────────────────────────────────────────────────────────────────
// GΦRSELLEήTέRME (ΗέZέMLER)
// ─────────────────────────────────────────────────────────────────
// 1. Motor (Saniye)
plot(mats_1, "5", color=c1, linewidth=1)
// 2. Motor (Dakika)
plot(mats_2, "20", color=c2, linewidth=1)
// 3. Motor (Akrep) - Orijinal Glow/Parlama efektiyle
plot(mats_3, "50", color=c3, linewidth=1)
//plot(mats_3, "MATS 50 Parlama 1", color=color.new(c3, 70), linewidth=5, editable=false)
//plot(mats_3, "MATS 50 Parlama 2", color=color.new(c3, 85), linewidth=8, editable=false)
/////////////////
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))
////////////// /////////////
Yer έmleri