PHP Code:
//@version=6
////
UV = ta.sar(0.01, 0.02, 0.2)
OV = ta.sar(0.01, 0.04, 0.4)
OV1 = ta.sar(0.1, 0.04, 0.4)
plot(UV, title = '4', style = plot.style_cross, color = renk ? UV > close ? color.rgb(247, 3, 3, 00) : color.rgb(24, 250, 4, 00) : color.silver, linewidth = 1)
plot(OV, title = '2', style = plot.style_cross, color = renk ? OV > close ? color.rgb(247, 3, 3, 00) : color.rgb(24, 250, 4, 00) : color.silver, linewidth = 1)
plot(OV1, title = '1', style = plot.style_cross, color = renk ? OV1 > close ? color.rgb(247, 3, 3, 00) : color.rgb(24, 250, 4, 00) : color.silver, linewidth = 1)
kv = ta.sar(0.01, 0.06, 0.6)
kv1 = input.timeframe(title = 'Timeframe', defval = '1')
kv15 = input.timeframe(title = 'Timeframe', defval = '15')
kv60 = input.timeframe(title = 'Timeframe', defval = '60')
kv240 = input.timeframe(title = 'Timeframe', defval = '240')
kvD = input.timeframe(title = 'Timeframe', defval = 'D')
s1 = request.security(syminfo.tickerid, kv1, kv, gaps = barmerge.gaps_on)
s15 = request.security(syminfo.tickerid, kv15, kv, gaps = barmerge.gaps_on)
s60 = request.security(syminfo.tickerid, kv60, kv, gaps = barmerge.gaps_on)
s240 = request.security(syminfo.tickerid, kv240, kv, gaps = barmerge.gaps_on)
sD = request.security(syminfo.tickerid, kvD, kv, gaps = barmerge.gaps_on)
plot(s1, title = 'TR1', style = plot.style_line, color = renk ? s1 > close ? color.rgb(247, 3, 3, 100) : color.rgb(24, 250, 4, 100) : color.silver, linewidth = 1)
plot(s15, title = 'TR15', style = plot.style_line, color = renk ? s15 > close ? color.rgb(247, 3, 3, 100) : color.rgb(24, 250, 4, 100) : color.silver, linewidth = 1)
plot(s60, title = 'TR60', style = plot.style_line, color = renk ? s60 > close ? color.rgb(247, 3, 3, 100) : color.rgb(24, 250, 4, 100) : color.silver, linewidth = 1)
plot(s240, title = 'TR240', style = plot.style_line, color = renk ? s240 > close ? color.rgb(247, 3, 3, 100) : color.rgb(24, 250, 4, 100) : color.silver, linewidth = 1)
plot(sD, title = 'TRG', style = plot.style_line, color = renk ? sD > close ? color.rgb(247, 3, 3, 100) : color.rgb(24, 250, 4, 100) : color.silver, linewidth = 1)
a1 = ta.sar(0., 0.043, 0.34)
a2 = ta.sar(0.1, 0., 0.34)
a3 = ta.sar(0.1, 0.01, 0.5)
a4 = ta.sar(0.01, 0., 0.1)
a5 = ta.sar(0., 0.04, 0.4)
a6 = ta.sar(0., 0.03, 0.3)
a7 = ta.sar(0., 0.02, 0.2)
a8 = ta.sar(0., 0.01, 0.1)
//plot(a1, title='6', style=plot.style_stepline, color=renk ? a1 > close ? color.rgb(247, 3, 3, 00) : color.rgb(24, 250, 4, 00) : color.silver, linewidth=1)
//plot(a2, title='4', style=plot.style_stepline, color=renk ? a2 > close ? color.rgb(247, 3, 3, 00) : color.rgb(24, 250, 4, 00) : color.silver, linewidth=1)
plot(a3, title = '3', style = plot.style_cross, color = renk ? a3 > close ? color.rgb(247, 3, 3, 00) : color.rgb(24, 250, 4, 00) : color.silver, linewidth = 1)
//plot(a4, title='7', style=plot.style_stepline, color=renk ? a4 > close ? color.rgb(247, 3, 3, 00) : color.rgb(24, 250, 4, 00) : color.silver, linewidth=1)
plot(a5, title = '2', style = plot.style_cross, color = renk ? a5 > close ? color.rgb(247, 3, 3, 00) : color.rgb(24, 250, 4, 00) : color.silver, linewidth = 1)
//plot(a6, title='2', style=plot.style_stepline, color=renk ? a6 > close ? color.rgb(247, 3, 3, 00) : color.rgb(24, 250, 4, 00) : color.silver, linewidth=1)
plot(a7, title = '5', style = plot.style_cross, color = renk ? a7 > close ? color.rgb(247, 3, 3, 00) : color.rgb(24, 250, 4, 00) : color.silver, linewidth = 1)
//plot(a8, title='0', style=plot.style_stepline, color=renk ? a8 > close ? color.rgb(247, 3, 3, 00) : color.rgb(24, 250, 4, 00) : color.silver, linewidth=1)
//@version=6
mt = input.timeframe('D', title = 'S/R timeframe')
sh = input.int(10, title = 'Shift S/R Forward/Backward')
start = input.float(title = 'Start', step = 0.01, defval = 0.02)
increment = input.float(title = 'Increment', step = 0.01, defval = 0.02)
maximum = input.float(title = 'Maximum', step = 0.01, defval = 0.2)
sar = request.security(syminfo.tickerid, mt, ta.sar(start, increment, maximum))
plot(sar, style = plot.style_circles, linewidth = 1,title = '@yörük@', color = #e302fc00)
dir = sar < close ? 1 : -1
buy = dir == 1 and dir[1] == -1
sell = dir == -1 and dir[1] == 1
h = ta.valuewhen(buy, close, 0)
l = ta.valuewhen(sell, close, 0)
buyalert = open > h and close > h and open[1] < h
sellalert = open < l and close < l and open[1] > h
y = ta.valuewhen(buy, close[0], 0)
u = plot(y, color = #0abbc400, linewidth = 1, title = 'Yüksek', offset = sh)
z = ta.valuewhen(sell, close[0], 0)
d = plot(z, color = #e4f00600, linewidth = 1, title = 'Düşük', offset = sh)
//@version=6
pSARbeginningValue = input.int(2, minval = 0, maxval = 10, title = 'PSAR Beginning Value')
pSARendValue = input.int(2, minval = 1, maxval = 10, title = 'PSAR End Value')
pSARmultiplierValue = input.int(2, minval = 0, maxval = 10, title = ' PSAR Multiplier Value')
pSARbeginningMethod = pSARbeginningValue * .01
pSARendMethod = pSARendValue * .10
pSARmultiplierMethod = pSARmultiplierValue * .01
pSAR_UpValue = ta.sar(pSARbeginningMethod, pSARmultiplierMethod, pSARendMethod)
pSAR_DownValue = ta.sar(pSARbeginningMethod, pSARmultiplierMethod, pSARendMethod)
pSAR_UpColor = close >= pSAR_DownValue ? color.white : na
pSAR_DownColor = close <= pSAR_UpValue ? color.fuchsia : na
plot(bool(pSAR_UpValue) ? pSAR_UpValue : na, style = plot.style_linebr, color = pSAR_UpColor, linewidth = 1, title = 'PSAR')
plot(bool(pSAR_DownValue) ? pSAR_DownValue : na, style = plot.style_linebr, color = pSAR_DownColor, linewidth = 1, title = 'PSAR')
//5 HMA - These 5 HMAs are used to see the crossover and the strength of the candle. But only 2 HMAs are used to determine the candles
showHMA1 = input(false, title = 'Hull Moving Average - Tiny')
showHMA2 = input(true, title = 'Hull Moving Average - Lower Period')
showHMA3 = input(true, title = 'Hull Moving Average - Medium Period')
showHMA4 = input(false, title = 'Hull Moving Average - Intermediate')
showHMA5 = input(false, title = 'Hull Moving Average - Long Term')
showSMA1 = input(false, title = 'Simple Moving Average - Medium Term')
hmaPeriodOne = input(10, 'HMA Tiny Period')
hmaPeriodTwo = input(20, 'HMA Lower Period')
hmaPeriodThree = input(50, 'HMA Medium Period')
hmaPeriodFour = input(100, 'HMA Intermediate Period')
hmaPeriodFive = input(200, 'HMA Long Period')
hmaOne = ta.hma(input(close), hmaPeriodOne)
hmaTwo = ta.hma(input(close), hmaPeriodTwo)
hmaThree = ta.hma(input(close), hmaPeriodThree)
hmaFour = ta.hma(input(close), hmaPeriodFour)
hmaFive = ta.hma(input(close), hmaPeriodFive)
//1 SMA - Single Moving Average Medium Term
smaPeriodOne = input(50, 'SMA Medium Period')
smaOne = ta.sma(input(close), smaPeriodOne)
plot(showSMA1 and bool(smaOne) ? smaOne : na, color = color.new(color.red, 0), linewidth = 2, title = 'SMA Medium Period')
//Bar Color
candleClose = close > hmaTwo ? 1 : -1
isInBetween = close > hmaTwo and close < hmaThree or close < hmaTwo and close > hmaThree
isNeutral = close > pSAR_DownValue and candleClose == -1 or close < pSAR_DownValue and candleClose == 1
barcolor(isNeutral or isInBetween ? color.yellow : candleClose == -1 ? color.red : candleClose == 1 ? color.green : color.black)
start1 = input(0.02)
increment1 = input(0.02)
maximum1 = input(0.2)
xo = input(0.10)
xpr = input(0.01)
psar = 0.0 // PSAR
af = 0.0 // Acceleration Factor
trend_dir = 0 // Current direction of PSAR
ep = 0.0 // Extreme point
sar_long_to_short = trend_dir[1] == 1 and close <= psar[1] * (1 - xo) // PSAR switches from long to short and exceeds xo filter
sar_short_to_long = trend_dir[1] == -1 and close >= psar[1] * (1 + xo) // PSAR switches from short to long and exceeds xo filter
trend_change = barstate.isfirst[1] or sar_long_to_short or sar_short_to_long
// Calculate trend direction
trend_dir := barstate.isfirst[1] and close[1] > open[1] ? 1 : barstate.isfirst[1] and close[1] <= open[1] ? -1 : sar_long_to_short ? -1 : sar_short_to_long ? 1 : nz(trend_dir[1])
// Calculate Acceleration Factor
af := trend_change ? start1 : trend_dir == 1 and high > ep[1] or trend_dir == -1 and low < ep[1] ? math.min(maximum1, af[1] + increment1) : af[1]
// Calculate extreme point
ep := trend_change and trend_dir == 1 ? high : trend_change and trend_dir == -1 ? low : trend_dir == 1 ? math.max(ep[1], high * (1 + xpr)) : math.min(ep[1], low * (1 - xpr))
// Calculate PSAR
psar := barstate.isfirst[1] and close[1] > open[1] ? low[1] : barstate.isfirst[1] and close[1] <= open[1] ? high[1] : trend_change ? ep[1] : trend_dir == 1 ? psar[1] + af * (ep - psar[1]) : psar[1] - af * (psar[1] - ep)
plot(psar, style = plot.style_circles, color = trend_dir == 1 ? color.white : color.fuchsia,title = "Karşıt",linewidth = 2)
pSARbeginningValue1 = input.int(2, minval = 0, maxval = 10, title = 'PSAR başlangıç değeri')
pSARendValue1 = input.int(2, minval = 1, maxval = 10, title = 'PSAR bitiş değeri')
pSARmultiplierValue1 = input.int(2, minval = 0, maxval = 10, title = ' PSAR katsayi değeri')
pSARbeginningMethod1 = pSARbeginningValue1 * .01
pSARendMethod1 = pSARendValue1 * .10
pSARmultiplierMethod1 = pSARmultiplierValue1 * .01
pSAR_UpValue1 = ta.sar(pSARbeginningMethod1, pSARmultiplierMethod1, pSARendMethod1)
pSAR_DownValue1 = ta.sar(pSARbeginningMethod1, pSARmultiplierMethod1, pSARendMethod1)
pSAR_UpColor1 = close >= pSAR_DownValue1 ? color.green : na
pSAR_DownColor1 = close <= pSAR_UpValue1 ? color.red : na
zoneSource = input(hl2, title = 'Kaynak')
src = input(hl2, title = 'Kaynak')
zoneLength = input(defval = 10, title = 'ATR Alan Uzunluğu')
zoneMultiplier = input.float(defval = 3.0, step = 0.1, title = 'ATR Alan Katsayısı')
zoneATR = ta.atr(zoneLength)
downZone = zoneSource + zoneMultiplier * zoneATR
downZoneNew = nz(downZone[1], downZone)
downZone := close[1] < downZoneNew ? math.min(downZone, downZoneNew) : downZone
upZone = zoneSource - zoneMultiplier * zoneATR
upZoneNew = nz(upZone[1], upZone)
upZone := close[1] > upZoneNew ? math.max(upZone, upZoneNew) : upZone
zoneDecider = 1
zoneDecider := nz(zoneDecider[1], zoneDecider)
zoneDecider := zoneDecider == -1 and close > downZoneNew ? 1 : zoneDecider == 1 and close < upZoneNew ? -1 : zoneDecider
redZone = zoneDecider == -1 and zoneDecider[1] == 1
greenZone = zoneDecider == 1 and zoneDecider[1] == -1
downZoneColor = zoneDecider == -1 ? color.red : color.gray
upZoneColor = zoneDecider == 1 ? color.green : color.gray
downZonePlot = plot(zoneDecider == 1 ? na : downZone, style = plot.style_linebr, linewidth = 2, color = color.new(color.red, 100), title = 'Düşüş')
upZonePlot = plot(zoneDecider == 1 ? upZone : na, style = plot.style_linebr, linewidth = 2, color = color.new(color.green, 100), title = 'Yükseliş')
aldigimfiyat = str.tostring(ta.valuewhen(greenZone, zoneSource, 0))
sattigimfiyat = str.tostring(ta.valuewhen(redZone, zoneSource, 0))
Buy = greenZone
Sell = redZone
if greenZone == bool(1)
l2 = label.new(bar_index, na)
label.set_text(l2, aldigimfiyat)
label.set_color(l2, color.green)
label.set_yloc(l2, yloc.belowbar)
label.set_style(l2, label.style_label_up)
if redZone == bool(1)
l2 = label.new(bar_index, na)
label.set_text(l2, sattigimfiyat)
label.set_color(l2, color.red)
label.set_yloc(l2, yloc.abovebar)
label.set_style(l2, label.style_label_down)
//neutralZonePlot = plot(ohlc4, style = plot.style_circles, linewidth = math.max(1, 0), title = 'Stop')
Yer İmleri