0% found this document useful (0 votes)
15 views5 pages

Message

Uploaded by

endergndz98
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views5 pages

Message

Uploaded by

endergndz98
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 5

//@version=4

study(title="HedefVuran", shorttitle="HedefVuran", overlay=true)

//Kullanici bilgileri
Anafib = input(true, "Günlük fib, Aç / Kapa")
dashOn = input(false, "Panel Açık / Kapalı")
srLines = input(false, "Destek & Direnç Açık / Kapalı")
dashDist = input(8, "Panel uzaklığı")
dashColor = input(color.new(#696969, 80), "Panel rengi", inline="Dash Line")
dashTextColor = input(color.new(#ffffff, 0), "Yazı rengi", inline="Dash Line")
afibOn = input(false, "Fibonacci Geri Çekilmesi Açık / Kapalı")

Fib=input(365)
maxr = highest(high, Fib)
minr = lowest(low, Fib)
ranr = maxr - minr
ON=plot( maxr , title="100%", color=#888787, linewidth=3, transp=15)
SS=plot( maxr - 0.236 * ranr, title="23,6%", color=#00bcd4, linewidth=3, transp=15)
SO=plot( maxr - 0.382 * ranr, title="38.2%", color=#ffa726, linewidth=2, transp=15)
FI=plot( maxr - 0.50 * ranr, title="50%", color=#888787, linewidth=3, transp=15)
TE=plot( minr + 0.382 * ranr, title="61.8%", color=#4caf50, linewidth=2, transp=15)
TT=plot( minr + 0.214 * ranr, title="78.6%", color=#1976d2, linewidth=3, transp=15)
ZZ=plot( minr , title="0%", color=#888787, linewidth=3, transp=15)
fill(ON,SS, color=#f91111, transp=87)
fill(SS,SO, color=#f91111, transp=87)
fill(TE,TT, color=#4CAF50, transp=87)
fill(TT,ZZ, color=#4CAF50, transp=87)

atr = atr(14)
stdAtr = 2 * stdev(atr, 20)
smaAtr = sma(atr, 20)
topAtrDev = smaAtr + stdAtr
bottomAtrDev = smaAtr - stdAtr
calcDev = (atr - bottomAtrDev) / (topAtrDev - bottomAtrDev)
percentVol = (40 * calcDev + 30)

//Destek / Direnç Çizgileri


h1000 = highest(1000)
h750 = highest(750)
h500 = highest(500)
h250 = highest(250)
h100 = highest(100)
h50 = highest(50)
h10 = highest(10)
plot(srLines ? h1000 : na, title='R1', color = close > h1000 ? color.green :
color.red, linewidth=1, offset=-9999, trackprice=true)
plot(srLines ? h750 : na, title='R2', color = close > h750 ? color.green :
color.red, linewidth=1, offset=-9999, trackprice=true)
plot(srLines ? h500 : na, title='R3', color = close > h500 ? color.green :
color.red, linewidth=1, offset=-9999, trackprice=true)
plot(srLines ? h250 : na, title='R4', color = close > h250 ? color.green :
color.red, linewidth=1, offset=-9999, trackprice=true)
plot(srLines ? h100 : na, title='R5', color = close > h100 ? color.green :
color.red, linewidth=1, offset=-9999, trackprice=true)
plot(srLines ? h50 : na, title='R6', color = close > h50 ? color.green : color.red,
linewidth=1, offset=-9999, trackprice=true)
plot(srLines ? h10 : na, title='R6', color = close > h50 ? color.green : color.red,
linewidth=1, offset=-9999, trackprice=true)
l1000 = lowest(1000)
l750 = lowest(750)
l500 = lowest(500)
l250 = lowest(250)
l100 = lowest(100)
l50 = lowest(50)
l10 = lowest(10)
plot(srLines ? l1000 : na, title='S1', color = close > l1000 ? color.green :
color.red, linewidth=1, offset=-9999, trackprice=true)
plot(srLines ? l750 : na, title='S2', color = close > l750 ? color.green :
color.red, linewidth=1, offset=-9999, trackprice=true)
plot(srLines ? l500 : na, title='S3', color = close > l500 ? color.green :
color.red, linewidth=1, offset=-9999, trackprice=true)
plot(srLines ? l250 : na, title='S4', color = close > l250 ? color.green :
color.red, linewidth=1, offset=-9999, trackprice=true)
plot(srLines ? l100 : na, title='S5', color = close > l100 ? color.green :
color.red, linewidth=1, offset=-9999, trackprice=true)
plot(srLines ? l50 : na, title='S6', color = close > l50 ? color.green : color.red,
linewidth=1, offset=-9999, trackprice=true)
plot(srLines ? l10 : na, title='S6', color = close > l50 ? color.green : color.red,
linewidth=1, offset=-9999, trackprice=true)

threshold_multiplier = input(3, "Fibonacci Sapması")


dev_threshold = atr(10) / close * 100 * threshold_multiplier
depth = 10
reverse = input(false, "Ters Fibo Çekilmesi")
var extendLeft = input(false, "Sola Uzat | Sağa Uzat", inline = "Extend
Lines")
var extendRight = input(true, "", inline = "Extend Lines")
var extending = extend.none
if extendLeft and extendRight
extending := extend.both
if extendLeft and not extendRight
extending := extend.left
if not extendLeft and extendRight
extending := extend.right
prices = input(true, "Fiyat Göster / Gizle")
levels = input(true, "Seviyeleri Göster / Gizle", inline = "Levels")
levelsFormat = input("Yüzdelik", "", options = ["Değer", "Yüzdelik"], inline =
"Levels")
labelsPosition = input("Sağ", "Fib pozisyonu", options = ["Sol", "Sağ"])

var line lineLast = na


var int iLast = 0
var int iPrev = 0
var float pLast = 0
var isHighLast = false

pivots(src, length, isHigh) =>


l2 = length * 2
c2 = nz(src[length])
ok = true
for i = 0 to l2
if isHigh and src[i] > c2
ok := false

if not isHigh and src[i] < c2


ok := false
if ok
[bar_index[length], c2]
else
[int(na), float(na)]
[iH, pH] = pivots(high, depth / 2, true)
[iL, pL] = pivots(low, depth / 2, false)

calc_dev(base_price, price) =>


100 * (price - base_price) / price

pivotFound(dev, isHigh, index, price) =>


if isHighLast == isHigh and not na(lineLast)
// same direction
if isHighLast ? price > pLast : price < pLast
line.set_xy2(lineLast, index, price)
[lineLast, isHighLast]
else
[line(na), bool(na)]
else // reverse the direction (or create the very first line)
if abs(dev) > dev_threshold
// price move is significant
id = line.new(iLast, pLast, index, price, color=na, width=1,
style=line.style_dashed)
[id, isHigh]
else
[line(na), bool(na)]

if not na(iH)
dev = calc_dev(pLast, pH)
[id, isHigh] = pivotFound(dev, true, iH, pH)
if not na(id)
if id != lineLast
line.delete(lineLast)
lineLast := id
isHighLast := isHigh
iPrev := iLast
iLast := iH
pLast := pH
else
if not na(iL)
dev = calc_dev(pLast, pL)
[id, isHigh] = pivotFound(dev, false, iL, pL)
if not na(id)
if id != lineLast
line.delete(lineLast)
lineLast := id
isHighLast := isHigh
iPrev := iLast
iLast := iL
pLast := pL

_draw_line(price, col) =>


var id = line.new(iLast, price, bar_index, price, color=col, width=1,
extend=extending)
if not na(lineLast)
line.set_xy1(id, line.get_x1(lineLast), price)
line.set_xy2(id, line.get_x2(lineLast), price)

_draw_label(price, txt, txtColor) =>


x = labelsPosition == "Sol" ? line.get_x1(lineLast) : not extendRight ?
line.get_x2(lineLast) : bar_index
labelStyle = labelsPosition == "Sol" ? label.style_label_right :
label.style_label_left
align = labelsPosition == "Sol" ? text.align_right : text.align_left
labelsAlignStrLeft = txt + '\n
\n'
labelsAlignStrRight = ' ' + txt + '\n
\n'
labelsAlignStr = labelsPosition == "Sol" ? labelsAlignStrLeft :
labelsAlignStrRight
var id = label.new(x=x, y=price, text=labelsAlignStr, textcolor=txtColor,
style=labelStyle, textalign=align, color=#00000000)
label.set_xy(id, x, price)
label.set_text(id, labelsAlignStr)
label.set_textcolor(id, txtColor)

_wrap(txt) =>
"(" + tostring(txt, "#.##") + ")"

_label_txt(level, price) =>


l = levelsFormat == "Değer" ? tostring(level) + " " : tostring(level * 100) +
"% "
(levels ? l : " ") + (prices ? _wrap(price) : " ")

_crossing_level(sr, r) =>
(r > sr and r < sr[1]) or (r < sr and r > sr[1])

startPrice = reverse ? line.get_y1(lineLast) : pLast


endPrice = reverse ? pLast : line.get_y1(lineLast)

iHL = startPrice > endPrice


diff = (iHL ? -1 : 1) * abs(startPrice - endPrice)

processLevel(show, value, colorL) =>


float m = value
r = startPrice + diff * m
if show
_draw_line(r, colorL)
_draw_label(r, _label_txt(m, r), colorL)

show_0 = true
value_0 = 0
color_0 = #787b86
if afibOn
processLevel(show_0, value_0, color_0)

show_0_236 = true
value_0_236 = 0.236
color_0_236 = #f44336
if afibOn
processLevel(show_0_236, value_0_236, color_0_236)

show_0_382 = true
value_0_382 = 0.382
color_0_382 = #81c784
if afibOn
processLevel(show_0_382, value_0_382, color_0_382)

show_0_5 = true
value_0_5 = 0.5
color_0_5 = #4caf50
if afibOn
processLevel(show_0_5, value_0_5, color_0_5)

show_0_618 = true
value_0_618 = 0.618
color_0_618 = #009688
if afibOn
processLevel(show_0_618, value_0_618, color_0_618)

show_0_786 = true
value_0_786 = 0.786
color_0_786 = #64b5f6
if afibOn
processLevel(show_0_786, value_0_786, color_0_786)

show_1 = true
value_1 = 1
color_1 = #787b86
if afibOn
processLevel(show_1, value_1, color_1)

volumeDash = volume
rsiDash = rsi(close, 14)
ema9 = ema(close, 9)
totalSentTxt = ema9 > ema9[2] ? "Boğa" : ema9 < ema9[2] ? "Ayı" : "Flat"
sma = sma(close, 50)

if dashOn
label lemonLabel = label.new(time, close,
text="\n━━━━━━━━━━━━━━━━━"
+ "\n Volatilite | " + "%" + tostring(percentVol, "##.##")
+ "\n Hacim | " + tostring(volumeDash,"##.##" )
+ "\n RSI | " + tostring(rsiDash, "##.##")
+ "\n Boğa/Ayı | " + totalSentTxt,

color=dashColor, xloc= xloc.bar_time, style=label.style_label_left,


textcolor=dashTextColor, textalign=text.align_left)
label.set_x(lemonLabel, label.get_x(lemonLabel) + round(change(time)*dashDist))
label.delete(lemonLabel[1])

length = input(14, minval=1, title="Williams %R Uzunluğu")


willTL = input(10, minval=5, maxval=95, title="Williams %R Tetikleri")
swill = input(true, title="Williams Arkaplan Rengi Açık / Kapalı")
red = color.red
green= color.green
upper = highest(length)
lower = lowest(length)
willR = 100 * (close - upper) / (upper - lower)
willRAbove = willR > (0 - willTL) ? 1 : 0
willRBelow = willR < (-100 + willTL) ? 1 : 0
condWill = swill and willRAbove ? red : swill and willRBelow ? green : na
bgcolor(condWill, transp=85)

You might also like