derleme çalışması versiyon 4.... birleştirme örnekleri.....
örneklem btc...canlı veri alındığı için....
periyot günlük..... değerlerde kısalma yapılacak....
uzunluk takibi.....min 1...max 3 olacak şekilde.....
strateji...osilator v.b birleşimler.....
bu kod üzerinden başlıyoruz...
https://www.tradingview.com/x/cz6t2Vfv/
kod: alarmlar pasif edildi.....
//@version=4
study("derleme", ".", overlay = true, max_bars_back = 501)
// Source
src = input(hl2,defval=close, title="veri")
per = input(defval=1, minval=1, title="1 Gün")
// Range Multiplier
mult = input(defval=1.0, minval=0.1, title="Aralık Bölümleme-10 Aralık")
// Smooth Average Range
smoothrng(x, t, m) =>
wper = t * 2 - 1
avrng = ema(abs(x - x[1]), t)
smoothrng = ema(avrng, wper) * m
smoothrng
smrng = smoothrng(src, per, mult)
// Range Filter
rngfilt(x, r) =>
rngfilt = x
rngfilt := x > nz(rngfilt[1]) ? x - r < nz(rngfilt[1]) ? nz(rngfilt[1]) : x - r :
x + r > nz(rngfilt[1]) ? nz(rngfilt[1]) : x + r
rngfilt
filt = rngfilt(src, smrng)
// Filter Direction
upward = 0.0
upward := filt > filt[1] ? nz(upward[1]) + 1 : filt < filt[1] ? 0 : nz(upward[1])
downward = 0.0
downward := filt < filt[1] ? nz(downward[1]) + 1 : filt > filt[1] ? 0 : nz(downward[1])
// Target Bands
hband = filt + smrng
lband = filt - smrng
// Break Outs
longCond = bool(na)
shortCond = bool(na)
longCond := src > filt and src > src[1] and upward > 0 or
src > filt and src < src[1] and upward > 0
shortCond := src < filt and src < src[1] and downward > 0 or
src < filt and src > src[1] and downward > 0
CondIni = 0
CondIni := longCond ? 1 : shortCond ? -1 : CondIni[1]
longCondition = longCond and CondIni[1] == -1
shortCondition = shortCond and CondIni[1] == 1
//Alerts
plotshape(longCondition, title="Buy Signal", text="AL", textcolor=color.white, style=shape.labelup, size=size.small, location=location.belowbar, color=color.green, transp=0)
plotshape(shortCondition, title="Sell Signal", text="SAT", textcolor=color.white, style=shape.labeldown, size=size.small, location=location.abovebar, color=color.red, transp=0)
//alertcondition(longCondition, title="Buy Alert", message="AL")
//alertcondition(shortCondition, title="Sell Alert", message="SAT")
////////////////////////////////////////////////////////////////////////////////////////////////////////
pivot ekleme.... 3sol-1sağ takipli.....
https://www.tradingview.com/x/bCMwaS5B/
kod: 0 level hesaplamalar bırakıldı....diğerleri pasiflendi....renk...mor seçildi......
//@version=4
left = 3
right = 1
quick_right = 5 // Used to try and detect a more recent significant swing.
pivot_high = pivothigh(high, left, right)
pivot_lows = pivotlow(low, left, right)
quick_pivot_high = pivothigh(high, left, quick_right)
quick_pivot_lows = pivotlow(low, left, quick_right)
level1 = valuewhen(quick_pivot_high, high[quick_right], 0)
level2 = valuewhen(quick_pivot_lows, low[quick_right], 0)
level3 = valuewhen(pivot_high, high[right], 0)
level4 = valuewhen(pivot_lows, low[right], 0)
//level5 = valuewhen(pivot_high, high[right], 1)
//level6 = valuewhen(pivot_lows, low[right], 1)
//level7 = valuewhen(pivot_high, high[right], 2)
//level8 = valuewhen(pivot_lows, low[right], 2)
level1_col = close >= level1 ? color.purple : color.purple
level2_col = close >= level2 ? color.purple : color.purple
level3_col = close >= level3 ? color.purple : color.purple
level4_col = close >= level4 ? color.purple : color.purple
//level5_col = close >= level5 ? color.yellow : color.aqua
//level6_col = close >= level6 ? color.yellow : color.aqua
//level7_col = close >= level7 ? color.yellow : color.aqua
//level8_col = close >= level8 ? color.yellow : color.aqua
plot(level1, style=plot.style_circles, color=level1_col, show_last=1, linewidth=1, trackprice=true)
plot(level2, style=plot.style_circles, color=level2_col, show_last=1, linewidth=1, trackprice=true)
plot(level3, style=plot.style_circles, color=level3_col, show_last=1, linewidth=1, trackprice=true)
plot(level4, style=plot.style_circles, color=level4_col, show_last=1, linewidth=1, trackprice=true)
//plot(level5, style=plot.style_circles, color=level5_col, show_last=1, linewidth=1, trackprice=true)
//plot(level6, style=plot.style_circles, color=level6_col, show_last=1, linewidth=1, trackprice=true)
//plot(level7, style=plot.style_circles, color=level7_col, show_last=1, linewidth=1, trackprice=true)
//plot(level8, style=plot.style_circles, color=level8_col, show_last=1, linewidth=1, trackprice=true)
Doğum tarihim 16/07/2024 olarak güncellenmiştir.
Yer İmleri