-
https://tr.tradingview.com/script/u4YafpVP/
birleştirilmiş kod yazmış....pivot hesaplaması var....
34 uzunlukla trend hesaplaması....rsi stock var....
kodun uzun olmasının sebebi ise.....
mum formasyonlarını birleştirmiş olması....
labelların anlamı...kısaltılmış mum formasyonları....
https://www.tradingview.com/x/xC9jTgim/
-
-
PHP Code:
//@version=5
indicator("Acceleration Bands", overlay=true)
ma(sourcexz, lengthxz, type) =>
switch type
"SMA" => ta.sma(sourcexz, lengthxz)
"EMA" => ta.ema(sourcexz, lengthxz)
"SMMA (RMA)" => ta.rma(sourcexz, lengthxz)
"WMA" => ta.wma(sourcexz, lengthxz)
"VWMA" => ta.vwma(sourcexz, lengthxz)
factorxz= input(0.004)
lengthxz = input(20)
maTypeInput = input.string("EMA", title="MA Type", options=["SMA", "EMA", "SMMA (RMA)", "WMA", "VWMA"], group="MA Settings")
logHigh = math.log10(high)
logLow = math.log10(low)
logAvg = math.log10((high + low) / 2)
logUpperband = ma(logHigh * (1 + 2 * (((logHigh - logLow) / (logAvg)) * 1000) * factorxz), lengthxz, maTypeInput)
logLowerband = ma(logLow * (1 - 2 * (((logHigh - logLow) / (logAvg)) * 1000) * factorxz), lengthxz, maTypeInput)
logCentral = (logUpperband + logLowerband) / 2
Upperbandxz = math.pow(10, logUpperband)
Centralxz = math.pow(10, logCentral)
Lowerbandxz = math.pow(10, logLowerband)
plot(Upperbandxz, title="Olası-Tepe", color=color.rgb(255, 82, 82, 100))
plot(Centralxz,title="Olası-Ort", color=color.rgb(255, 153, 0, 100))
plot(Lowerbandxz,title="Olası-Dip", color=color.rgb(76, 175, 79, 100))
draw_prediction = input.bool(true, title="Draw Prediction Lines")
slope_length = input(20, title = "Slope Length")
customLogarithmicRegression(_data, _color) =>
logData = math.log10(_data)
linreg = ta.linreg(logData, slope_length, 0)
linreg_p = ta.linreg(logData, slope_length, 0 + 1)
x = bar_index
slope = linreg - linreg_p
intercept = linreg - x * slope
deviationSum = 0.0
for i = 0 to slope_length - 1 by 1
deviationSum += math.pow(logData[i] - (slope * (x - i) + intercept), 2)
deviation = math.sqrt(deviationSum / slope_length)
x1 = x - slope_length
x2 = x
y1 = slope * (x - slope_length) + intercept
y2 = linreg
var line b = na
updating = timestamp("20 Jul 2050 00:00 +0300") >= time
displacement = false
if draw_prediction
if updating
b := line.new(x1, math.pow(10, y1), x2, math.pow(10, y2), xloc.bar_index, extend.right, _color, style=line.style_dotted, width=2)
if not displacement
line.delete(b[1])
customLogarithmicRegression(Upperbandxz, color.red)
customLogarithmicRegression(Centralxz, color.orange)
customLogarithmicRegression(Lowerbandxz, color.green)
log kanallar...
-
PHP Code:
//@version=2
study("SAR", overlay = true)
startds = input(0)
incds = input(0.01)
maxids = input(0.1)
Pds = 1
EPds = max(high, high[1])
SARds = min(low, low[1])
AFds = startds
EPnewds = 0
AFnewds = startds
if nz(Pds[1]) == 0
Pds := 1
else
if (Pds[1] == 1)
EPnewds := max(high, EPds[1])
else
EPnewds := min(low, EPds[1])
if EPnewds != EPds[1]
AFnewds := min(maxids, AFds[1] + incds)
else
AFnewds := AFds[1]
if nz(Pds[1]) == 0
Pds := 1
else
if Pds[1] == 1 and SARds[1] + AFds[1] * (EPnewds - SARds[1]) <= low
Pds := 1
SARds := SARds[1] + AFnewds * (EPnewds - SARds[1])
EPds := EPnewds
AFds := AFnewds
else
if Pds[1] == 1 and SARds[1] + AFds[1] * (EPnewds - SARds[1]) > low
if low >= SARds[1]
Pds := 1
SARds := low
EPds := EPnewds
AFds := AFnewds
else
Pds := -1
SARds := max(high, EPds[1])
EPds := min(low, low[1])
AFds := startds
else
if Pds[1] == -1 and SARds[1] - AFds[1] * (SARds[1] - EPnewds) >= high
Pds := -1
SARds := SARds[1] - AFnewds * (SARds[1] - EPnewds)
EPds := EPnewds
AFds := AFnewds
else
if Pds[1] == -1 and SARds[1] - AFds[1] * (SARds[1] - EPnewds) < high
if high <= SARds[1]
Pds := -1
SARds := high
EPds := EPnewds
AFds := AFnewds
else
Pds := 1
SARds := min(low, EPds[1])
EPds := max(high, high[1])
AFds := startds
//plot(SARds, color = white, style = cross, linewidth = 2)
/////////////////////////////
y3 = sar(0,0.01,0.1)
y2 = sar(0,0.02,0.1)
y1 = sar(0,0.03,0.1)
y33 = sar(0.01,0.02,0.2)
y22 = sar(0.01,0.04,0.4)
y11 = sar(0.01,0.06,0.6)
acx32fX = input(true, title="Adaptive Coloring", type=bool)
plot(y1, title="A", style=circles, color=acx32fX?(y1>close?red:lime) : silver, transp=100, linewidth=1)
plot(y11, title="AA", style=circles, color=acx32fX?(y11>close?red:lime) : silver, transp=00, linewidth=1)
plot(y2, title="B", style=circles, color=acx32fX?(y2>close?red:lime) : silver, transp=100, linewidth=1)
plot(y22, title="BB", style=circles, color=acx32fX?(y22>close?red:lime) : silver, transp=00, linewidth=1)
plot(y3, title="C", style=circles, color=acx32fX?(y3>close?red:lime) : silver, transp=100, linewidth=1)
plot(y33, title="CC", style=circles, color=acx32fX?(y33>close?red:lime) : silver, transp=00, linewidth=1)
plot(SARds, title="ABC", style=line, color=acx32fX?(SARds>close?red:lime) : silver, transp=00, linewidth=2)
///////////////////
-
PHP Code:
//@version=5
indicator(title="Vsar", overlay = true)
// ------------------- INPUTS
ATRPeriod = input(10, "ATR Period")
ATRMultiplicator = input.float(10.2, "ARC constant muliplicator", minval=0, step=0.1)
source1 = input(high, "Source 1")
source2 = input(low, "Source 2")
source3 = input(hl2, "Source 3")
// ------------------- FIRST INIT
SIC1 = source1
SAR1 = 0.0
SIC2 = source2
SAR2 = 0.0
SIC3 = source3
SAR3 = 0.0
// -------------------
// Display SAR (calculated from the previous candle)
plot1 = plot(SAR1[1], color = source1 < SAR1[1] ? color.rgb(255, 82, 82, 100) : color.rgb(76, 175, 79, 100), style = plot.style_circles)
plot2 = plot(SAR2[1], color = source2 < SAR2[1] ? color.rgb(255, 82, 82, 100) : color.rgb(76, 175, 79, 100), style = plot.style_circles)
plot(SAR3[1], color = source3 < SAR3[1] ? color.rgb(255, 82, 82, 100) : color.rgb(76, 175, 79, 100), style = plot.style_circles)
//fill(plot1, plot2, title='SAR fill', color=#FFFFFF40)
// Calculate ARC (ATR x multiplicator)
ARC = ATRMultiplicator * ta.atr(ATRPeriod)
// Calculate the new SIC
if(source1 > SAR1[1])
// Long trade in progress, the new SIC is the max between the current price and the previous SIC
SIC1 := math.max(source1, SIC1[1])
// Calculate SAR for the next candle
SAR1 := SIC1 - ARC
if(source1 < SAR1[1])
// Short trade in progress, the new SIC is the min between the current price and the previous SIC
SIC1 := math.min(source1, SIC1[1])
// Calculate SAR for the next candle
SAR1 := SIC1 + ARC
if(source2 > SAR2[1])
// Long trade in progress, the new SIC is the max between the current price and the previous SIC
SIC2 := math.max(source2, SIC2[1])
// Calculate SAR for the next candle
SAR2 := SIC2 - ARC
if(source2 < SAR2[1])
// Short trade in progress, the new SIC is the min between the current price and the previous SIC
SIC2 := math.min(source2, SIC2[1])
// Calculate SAR for the next candle
SAR2 := SIC2 + ARC
if(source3 > SAR3[1])
// Long trade in progress, the new SIC is the max between the current price and the previous SIC
SIC3 := math.max(source3, SIC3[1])
// Calculate SAR for the next candle
SAR3 := SIC3 - ARC
if(source3 < SAR3[1])
// Short trade in progress, the new SIC is the min between the current price and the previous SIC
SIC3 := math.min(source3, SIC3[1])
// Calculate SAR for the next candle
SAR3 := SIC3 + ARC
-
PHP Code:
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © RafaelZioni
//@version=5
indicator(title='SAR', overlay=true)
lenxc = input(5)
lenxc20 = input(20)
lenxc50 = input(50)
z(close, lenxc) =>
hxc = 0.0
dxc = 0.0
for i = 0 to lenxc - 1 by 1
kxc = (lenxc - i) * lenxc
hxc += kxc
dxc += close[i] * kxc
dxc
dxc / hxc
cxc = z(close, math.floor(math.sqrt(lenxc)))
//
z20(close, lenxc20) =>
hcx20 = 0.0
dxc20 = 0.0
for i = 0 to lenxc20 - 1 by 1
kxc20 = (lenxc20 - i) * lenxc20
hcx20 += kxc20
dxc20 += close[i] * kxc20
dxc20
dxc20 / hcx20
cxc20 = z(close, math.floor(math.sqrt(lenxc20)))
//
z50(close, lenxc50) =>
hxc50 = 0.0
dxc50 = 0.0
for i = 0 to lenxc50 - 1 by 1
kxc50 = (lenxc50 - i) * lenxc50
hxc50 += kxc50
dxc50 += close[i] * kxc50
dxc50
dxc50 / hxc50
cxc50 = z(close, math.floor(math.sqrt(lenxc50)))
//
//
startsx = 0
incrementsx = 0.01
maximumsx = 0.1
ssx = ta.sar(startsx, incrementsx, maximumsx)
s1sx = z(ssx, lenxc)
pcsx = close < s1sx ? color.red : color.green
plot(s1sx, title="5",style=plot.style_cross, color=pcsx, linewidth=1)
startsx20 = 0
incrementsx20 = 0.01
maximumsx20 = 0.1
ssx20 = ta.sar(startsx20, incrementsx20, maximumsx20)
s1sx20 = z(ssx20, lenxc20)
pcsx20 = close < s1sx20 ? color.red : color.green
plot(s1sx20, title="20",style=plot.style_cross, color=pcsx20, linewidth=1)
startsx50 = 0
incrementsx50 = 0.01
maximumsx50 = 0.1
ssx50 = ta.sar(startsx50, incrementsx50, maximumsx50)
s1sx50 = z50(ssx50, lenxc50)
pcsx50 = close < s1sx50 ? color.red : color.green
plot(s1sx50, title="50",style=plot.style_cross, color=pcsx50, linewidth=1)
-
PHP Code:
//@version=5
indicator('SAR', overlay=true)
// INPUTS //
//
startq = input(0)
incrementq = input(0.01)
maximumq = input(0.1)
s1q = ta.sar(startq, incrementq, maximumq)
pcq = close < s1q ? color.red : color.green
//plot(s1q, style=plot.style_line, color=pcq)
//
lookBackq = input(20)
//
multiq = input.float(2, title='Multiplier', minval=0.001, maxval=2)
meanq = ta.ema(s1q, lookBackq)
stddevq = multiq * ta.stdev(s1q, lookBackq)
bq = meanq + stddevq
s2q = meanq - stddevq
low1q = ta.crossover(s1q, s2q)
high1q = ta.crossunder(s1q, bq)
//meanp = plot(meanq, title='Mean', color=color.new(color.gray, 0))
bsign = plot(bq, title='TEPE', color=color.new(#4caf4f, 100), linewidth=2)
ssign = plot(s2q, title='DİP', color=color.new(#ff5252, 100), linewidth=2)
plotshape(low1q, title='low', text='DİP', color=color.new(color.green, 0), style=shape.labelup, location=location.belowbar, size=size.tiny, textcolor=color.new(color.white, 0)) //plot for buy icon
plotshape(high1q, title='high', text='TEPE', color=color.new(color.red, 0), style=shape.labeldown, location=location.abovebar, size=size.tiny, textcolor=color.new(color.white, 0)) //plot for sell icon
//////////////////
lenxc = input(5)
lenxc20 = input(20)
lenxc50 = input(50)
z(close, lenxc) =>
hxc = 0.0
dxc = 0.0
for i = 0 to lenxc - 1 by 1
kxc = (lenxc - i) * lenxc
hxc += kxc
dxc += close[i] * kxc
dxc
dxc / hxc
cxc = z(close, math.floor(math.sqrt(lenxc)))
//
z20(close, lenxc20) =>
hcx20 = 0.0
dxc20 = 0.0
for i = 0 to lenxc20 - 1 by 1
kxc20 = (lenxc20 - i) * lenxc20
hcx20 += kxc20
dxc20 += close[i] * kxc20
dxc20
dxc20 / hcx20
cxc20 = z(close, math.floor(math.sqrt(lenxc20)))
//
z50(close, lenxc50) =>
hxc50 = 0.0
dxc50 = 0.0
for i = 0 to lenxc50 - 1 by 1
kxc50 = (lenxc50 - i) * lenxc50
hxc50 += kxc50
dxc50 += close[i] * kxc50
dxc50
dxc50 / hxc50
cxc50 = z(close, math.floor(math.sqrt(lenxc50)))
//
//
startsx = 0
incrementsx = 0.01
maximumsx = 0.1
ssx = ta.sar(startsx, incrementsx, maximumsx)
s1sx = z(ssx, lenxc)
pcsx = close < s1sx ? color.red : color.green
plot(s1sx, title="5",style=plot.style_cross, color=pcsx, linewidth=1)
startsx20 = 0
incrementsx20 = 0.01
maximumsx20 = 0.1
ssx20 = ta.sar(startsx20, incrementsx20, maximumsx20)
s1sx20 = z(ssx20, lenxc20)
pcsx20 = close < s1sx20 ? color.red : color.green
plot(s1sx20, title="20",style=plot.style_cross, color=pcsx20, linewidth=1)
startsx50 = 0
incrementsx50 = 0.01
maximumsx50 = 0.1
ssx50 = ta.sar(startsx50, incrementsx50, maximumsx50)
s1sx50 = z50(ssx50, lenxc50)
pcsx50 = close < s1sx50 ? color.red : color.green
plot(s1sx50, title="50",style=plot.style_cross, color=pcsx50, linewidth=1)
//////////////////////////
// ------------------- INPUTS
ATRPeriod = input(10, "ATR Period")
ATRMultiplicator = input.float(10.2, "ARC constant muliplicator", minval=0, step=0.1)
source1 = input(high, "Source 1")
source2 = input(low, "Source 2")
source3 = input(hl2, "Source 3")
// ------------------- FIRST INIT
SIC1 = source1
SAR1 = 0.0
SIC2 = source2
SAR2 = 0.0
SIC3 = source3
SAR3 = 0.0
// -------------------
// Display SAR (calculated from the previous candle)
plot1 = plot(SAR1[1], color = source1 < SAR1[1] ? color.rgb(255, 82, 82, 100) : color.rgb(76, 175, 79, 100), style = plot.style_circles)
plot2 = plot(SAR2[1], color = source2 < SAR2[1] ? color.rgb(255, 82, 82, 100) : color.rgb(76, 175, 79, 100), style = plot.style_circles)
plot(SAR3[1], color = source3 < SAR3[1] ? color.rgb(255, 82, 82, 100) : color.rgb(76, 175, 79, 100), style = plot.style_circles)
//fill(plot1, plot2, title='SAR fill', color=#FFFFFF40)
// Calculate ARC (ATR x multiplicator)
ARC = ATRMultiplicator * ta.atr(ATRPeriod)
// Calculate the new SIC
if(source1 > SAR1[1])
// Long trade in progress, the new SIC is the max between the current price and the previous SIC
SIC1 := math.max(source1, SIC1[1])
// Calculate SAR for the next candle
SAR1 := SIC1 - ARC
if(source1 < SAR1[1])
// Short trade in progress, the new SIC is the min between the current price and the previous SIC
SIC1 := math.min(source1, SIC1[1])
// Calculate SAR for the next candle
SAR1 := SIC1 + ARC
if(source2 > SAR2[1])
// Long trade in progress, the new SIC is the max between the current price and the previous SIC
SIC2 := math.max(source2, SIC2[1])
// Calculate SAR for the next candle
SAR2 := SIC2 - ARC
if(source2 < SAR2[1])
// Short trade in progress, the new SIC is the min between the current price and the previous SIC
SIC2 := math.min(source2, SIC2[1])
// Calculate SAR for the next candle
SAR2 := SIC2 + ARC
if(source3 > SAR3[1])
// Long trade in progress, the new SIC is the max between the current price and the previous SIC
SIC3 := math.max(source3, SIC3[1])
// Calculate SAR for the next candle
SAR3 := SIC3 - ARC
if(source3 < SAR3[1])
// Short trade in progress, the new SIC is the min between the current price and the previous SIC
SIC3 := math.min(source3, SIC3[1])
// Calculate SAR for the next candle
SAR3 := SIC3 + ARC
//////////////////////////////////////////////////
-
PHP Code:
//@version=5
indicator("*", overlay = true, max_boxes_count=100,max_lines_count = 100, max_labels_count = 100, format=format.price)
//////////////////////Parabolic Sar ile Trend Takip Sistemidir.//////////////////////////////////////////////////////////////////////////////////////////////////////////////
psar(start1, inc1, maximum1) =>
out1 = float(na)
isUpTrend1 = bool(na)
maxMin1 = float(na)
acc1 = float(na)
prev1 = float(na)
if bar_index >= 1
prev1 := out1[1]
if bar_index == 1
if close > close[1]
isUpTrend1 := true
maxMin1 := math.max(high, high[1])
prev1 := math.min(low, low[1])
prev1
else
isUpTrend1 := false
maxMin1 := math.min(low, low[1])
prev1 := math.max(high, high[1])
prev1
acc1 := start1
acc1
else
isUpTrend1 := isUpTrend1[1]
acc1 := acc1[1]
maxMin1 := maxMin1[1]
maxMin1
if isUpTrend1
if high > maxMin1
maxMin1 := high
acc1 := math.min(acc1 + inc1, maximum1)
acc1
else
if low < maxMin1
maxMin1 := low
acc1 := math.min(acc1 + inc1, maximum1)
acc1
if na(out1)
out1 := prev1 + acc1 * (maxMin1 - prev1)
out1
if isUpTrend1
if low <= out1
isUpTrend1 := false
out1 := maxMin1
maxMin1 := low
acc1 := start1
acc1
else
if high >= out1
isUpTrend1 := true
out1 := maxMin1
maxMin1 := high
acc1 := start1
acc1
if na(out1)
if isUpTrend1
out1 := math.min(out1, bar_index == 1 ? low[1] : math.min(low[1], low[2]))
out1
else
out1 := math.max(out1, bar_index == 1 ? high[1] : math.max(high[1], high[2]))
out1
[out1, acc1, maxMin1, isUpTrend1]
start1 = input(0)
increment1 = input(0.01)
maximum1 = input(0.1)
[p1, AF1, EP1, isUpTrend1] = psar(start1, increment1, maximum1)
newEP1 = EP1 != EP1[1]
epNew1 = newEP1 ? EP1 : na
plot(p1, 'Trend-1', style=plot.style_cross, color=isUpTrend1 ? color.rgb(76, 175, 79, 100) : color.rgb(255, 82, 82, 100), linewidth=2)
//plot(EP1, 'ONAY', style=plot.style_circles, color=isUpTrend1 ? color.green : color.red, linewidth=2)
plot(epNew1, 'Trend-2', style=plot.style_linebr, color=isUpTrend1 ? color.rgb(76, 175, 79, 100) : color.rgb(255, 82, 82, 100), linewidth=2)
///////////////Parabolic Sar ortalamaları ile onaylama sistemidir...///////////////////////////////////////////
//////////////////////////////////////////////Alarmlı Kısa-orta ve uzun reverse sistemidir............///////////////
requestSecurity(string _symbol, string _res, bool _repaints) =>
repIndex = _repaints ? 0 : barstate.isrealtime ? 1 : 0
resIndex = _repaints ? 0 : barstate.isrealtime ? 0 : 1
[h, l, t] = request.security(_symbol, _res, [high[repIndex], low[repIndex], time[repIndex]])
[h[resIndex], l[resIndex], t[resIndex]]
var GRP1 = "General Settings"
string res = input.timeframe(title = "Resolution", defval = "", group = GRP1)
bool ignoreInsideBars = input.bool(title = "Ignore Inside Bars?", defval = true, group = GRP1)
bool rep = input.bool(title = "Allow Repainting?", defval = false, group = GRP1)
var string GRP2 = "Short Term Settings"
bool showSTHighs = input.bool(title = "Show Short Term Highs?", defval = true, group = GRP2)
color stHighsColor = input.color(color.yellow, "Short Term Highs Color", group = GRP2)
bool showSTLows = input.bool(title = "Show Short Term Lows?", defval = true, group = GRP2)
color stLowsColor = input.color(color.yellow, "Short Term Lows Color", group = GRP2)
var string GRP3 = "Mid Term Settings"
bool showMTHighs = input.bool(title = "Show Mid Term Highs?", defval = true, group = GRP3)
color mtHighsColor = input.color(color.aqua, "Mid Term Highs Color", group = GRP3)
bool showMTLows = input.bool(title = "Show Mid Term Lows?", defval = true, group = GRP3)
color mtLowsColor = input.color(color.aqua, "Mid Term Lows Color", group = GRP3)
var string GRP4 = "Long Term Settings"
bool showLTHighs = input.bool(title = "Show Long Term Highs?", defval = true, group = GRP4)
color ltHighsColor = input.color(color.white, "Long Term Highs Color", group = GRP4)
bool showLTLows = input.bool(title = "Show Long Term Lows?", defval = true, group = GRP4)
color ltLowsColor = input.color(color.white, "Long Term Lows Color", group = GRP4)
[h, l, t] = requestSecurity(syminfo.ticker, res, rep)
type ReversalPoint
int bar_time
float price
var lowShortRevPoints = array.new<ReversalPoint>()
var highShortRevPoints = array.new<ReversalPoint>()
var lowMediumRevPoints = array.new<ReversalPoint>()
var highMediumRevPoints = array.new<ReversalPoint>()
isReversalPoint(bool isLow, float firstSrc, float midSrc, float lastSrc, bool isInsideBar) =>
bool isReversalPoint = false
if not (isInsideBar and ignoreInsideBars)
if isLow
isReversalPoint := lastSrc > midSrc and midSrc < firstSrc
else
isReversalPoint := lastSrc < midSrc and midSrc > firstSrc
isReversalPoint
plotReversalPoint(bool isLow, ReversalPoint revPoint, color revPointColor, string labelSize, bool createLabel) =>
if createLabel
label.new(revPoint.bar_time, revPoint.price, isLow ? '▲' : '▼',
xloc = xloc.bar_time, yloc = isLow ? yloc.belowbar : yloc.abovebar, size = labelSize, color = color(na),
textcolor = revPointColor, style = label.style_text_outline)
getReversalPoints(bool isLow, ReversalPoint[] sourceArray, color plotColor, ReversalPoint newRp, string labelSize,
bool createLabel, bool isInsideBar) =>
ReversalPoint result = na
sourceArray.push(newRp)
plotReversalPoint(isLow, newRp, plotColor, labelSize, createLabel)
int arraySize = sourceArray.size()
float midArrayValue = arraySize >= 2 ? sourceArray.get(arraySize - 2).price : na
float firstArrayValue = arraySize >= 3 ? sourceArray.get(arraySize - 3).price : na
if not na(firstArrayValue) and not na(midArrayValue) and isReversalPoint(isLow, firstArrayValue, midArrayValue, newRp.price, isInsideBar)
result := sourceArray.get(arraySize - 2)
result
bool isInsideBar = h < nz(h[1]) and l > nz(l[1])
ReversalPoint shortTermLow = isReversalPoint(true, nz(l[2]), nz(l[1]), l, isInsideBar) ? ReversalPoint.new(nz(t[1]), nz(l[1])) : na
ReversalPoint midTermLow = na
ReversalPoint longTermLow = na
if not na(shortTermLow)
midTermLow := getReversalPoints(true, lowShortRevPoints, stLowsColor, shortTermLow, size.tiny, showSTLows, isInsideBar)
if not na(midTermLow)
longTermLow := getReversalPoints(true, lowMediumRevPoints, mtLowsColor, midTermLow, size.small, showMTLows, isInsideBar)
if not na(longTermLow)
plotReversalPoint(true, longTermLow, ltLowsColor, size.normal, showLTLows)
ReversalPoint shortTermHigh = isReversalPoint(false, nz(h[2]), nz(h[1]), h, isInsideBar) ? ReversalPoint.new(nz(t[1]), nz(h[1])) : na
ReversalPoint midTermHigh = na
ReversalPoint longTermHigh = na
if not na(shortTermHigh)
midTermHigh := getReversalPoints(false, highShortRevPoints, stHighsColor, shortTermHigh, size.tiny, showSTHighs, isInsideBar)
if not na(midTermHigh)
longTermHigh := getReversalPoints(false, highMediumRevPoints, mtHighsColor, midTermHigh, size.small, showMTHighs, isInsideBar)
if not na(longTermHigh)
plotReversalPoint(false, longTermHigh, ltHighsColor, size.normal, showLTHighs)
alertcondition(not na(midTermLow) or not na(longTermLow), "Strong Buy Signal", "Strong Bullish Change Detected")
alertcondition(not na(midTermHigh) or not na(longTermHigh), "Strong Sell Signal", "Strong Bearish Change Detected")
alertcondition(not na(shortTermLow), "Buy Signal", "Bullish Change Detected")
alertcondition(not na(shortTermHigh), "Sell Signal", "Bearish Change Detected")
alertcondition(not na(shortTermLow) or not na(midTermLow) or not na(longTermLow), "All Buy Signals", "Any Bullish Change Detected")
alertcondition(not na(shortTermHigh) or not na(midTermHigh) or not na(longTermHigh), "All Sell Signals", "Any Bearish Change Detected")
///////////////////////////////////Kırılım çizgileri.....////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
ma(sourcexz, lengthxz, type) =>
switch type
"SMA" => ta.sma(sourcexz, lengthxz)
"EMA" => ta.ema(sourcexz, lengthxz)
"SMMA (RMA)" => ta.rma(sourcexz, lengthxz)
"WMA" => ta.wma(sourcexz, lengthxz)
"VWMA" => ta.vwma(sourcexz, lengthxz)
factorxz= input(0.004)
lengthxz = input(20)
maTypeInput = input.string("EMA", title="MA Type", options=["SMA", "EMA", "SMMA (RMA)", "WMA", "VWMA"], group="MA Settings")
logHigh = math.log10(high)
logLow = math.log10(low)
logAvg = math.log10((high + low) / 2)
logUpperband = ma(logHigh * (1 + 2 * (((logHigh - logLow) / (logAvg)) * 1000) * factorxz), lengthxz, maTypeInput)
logLowerband = ma(logLow * (1 - 2 * (((logHigh - logLow) / (logAvg)) * 1000) * factorxz), lengthxz, maTypeInput)
logCentral = (logUpperband + logLowerband) / 2
Upperbandxz = math.pow(10, logUpperband)
Centralxz = math.pow(10, logCentral)
Lowerbandxz = math.pow(10, logLowerband)
//plot(Upperbandxz, title="Olası-Tepe", color=color.rgb(255, 82, 82, 100))
//plot(Centralxz,title="Olası-Ort", color=color.rgb(255, 153, 0, 100))
//plot(Lowerbandxz,title="Olası-Dip", color=color.rgb(76, 175, 79, 100))
draw_prediction = input.bool(true, title="Draw Prediction Lines")
slope_length = input(20, title = "Slope Length")
customLogarithmicRegression(_data, _color) =>
logData = math.log10(_data)
linreg = ta.linreg(logData, slope_length, 0)
linreg_p = ta.linreg(logData, slope_length, 0 + 1)
xxz = bar_index
slope = linreg - linreg_p
intercept = linreg - xxz * slope
deviationSum = 0.0
for i = 0 to slope_length - 1 by 1
deviationSum += math.pow(logData[i] - (slope * (xxz - i) + intercept), 2)
deviation = math.sqrt(deviationSum / slope_length)
x1 = xxz - slope_length
x2 = xxz
y1 = slope * (xxz - slope_length) + intercept
y2 = linreg
var line b = na
updating = timestamp("20 Jul 2050 00:00 +0300") >= time
displacement = false
if draw_prediction
if updating
b := line.new(x1, math.pow(10, y1), x2, math.pow(10, y2), xloc.bar_index, extend.right, _color, style=line.style_dotted, width=2)
if not displacement
line.delete(b[1])
customLogarithmicRegression(Upperbandxz, color.red)
customLogarithmicRegression(Centralxz, color.orange)
customLogarithmicRegression(Lowerbandxz, color.green)
/////////////////////////////////////////////////////////////
// INPUTS //
//
startq = input(0)
incrementq = input(0.01)
maximumq = input(0.1)
s1q = ta.sar(startq, incrementq, maximumq)
pcq = close < s1q ? color.red : color.green
//plot(s1q, style=plot.style_line, color=pcq)
//
lookBackq = input(20)
//
multiq = input.float(2, title='Multiplier', minval=0.001, maxval=2)
meanq = ta.ema(s1q, lookBackq)
stddevq = multiq * ta.stdev(s1q, lookBackq)
bq = meanq + stddevq
s2q = meanq - stddevq
low1q = ta.crossover(s1q, s2q)
high1q = ta.crossunder(s1q, bq)
plotshape(low1q, title='low', text='DİP', color=color.new(color.green, 0), style=shape.labelup, location=location.belowbar, size=size.tiny, textcolor=color.new(color.white, 0)) //plot for buy icon
plotshape(high1q, title='high', text='TEPE', color=color.new(color.red, 0), style=shape.labeldown, location=location.abovebar, size=size.tiny, textcolor=color.new(color.white, 0)) //plot for sell icon
//////////////////
lenxc = input(5)
lenxc20 = input(20)
lenxc50 = input(50)
z(close, lenxc) =>
hxc = 0.0
dxc = 0.0
for i = 0 to lenxc - 1 by 1
kxc = (lenxc - i) * lenxc
hxc += kxc
dxc += close[i] * kxc
dxc
dxc / hxc
cxc = z(close, math.floor(math.sqrt(lenxc)))
//
z20(close, lenxc20) =>
hcx20 = 0.0
dxc20 = 0.0
for i = 0 to lenxc20 - 1 by 1
kxc20 = (lenxc20 - i) * lenxc20
hcx20 += kxc20
dxc20 += close[i] * kxc20
dxc20
dxc20 / hcx20
cxc20 = z20(close, math.floor(math.sqrt(lenxc20)))
//
z50(close, lenxc50) =>
hxc50 = 0.0
dxc50 = 0.0
for i = 0 to lenxc50 - 1 by 1
kxc50 = (lenxc50 - i) * lenxc50
hxc50 += kxc50
dxc50 += close[i] * kxc50
dxc50
dxc50 / hxc50
cxc50 = z50(close, math.floor(math.sqrt(lenxc50)))
//
//
startsx = 0
incrementsx = 0.01
maximumsx = 0.1
ssx = ta.sar(startsx, incrementsx, maximumsx)
s1sx = z(ssx, lenxc)
pcsx = close < s1sx ? color.red : color.green
plot(s1sx, title="5",style=plot.style_cross, color=pcsx, linewidth=1)
startsx20 = 0
incrementsx20 = 0.01
maximumsx20 = 0.1
ssx20 = ta.sar(startsx20, incrementsx20, maximumsx20)
s1sx20 = z20(ssx20, lenxc20)
pcsx20 = close < s1sx20 ? color.red : color.green
plot(s1sx20, title="20",style=plot.style_cross, color=pcsx20, linewidth=1)
startsx50 = 0
incrementsx50 = 0.01
maximumsx50 = 0.1
ssx50 = ta.sar(startsx50, incrementsx50, maximumsx50)
s1sx50 = z50(ssx50, lenxc50)
pcsx50 = close < s1sx50 ? color.red : color.green
plot(s1sx50, title="50",style=plot.style_cross, color=pcsx50, linewidth=1)
//////////////////////////