-
2046 nolu mesajdaki örneğe...
ortalama hesaplaması(birden fazla ortalamanın ortalaması) eklenmiş örnek....
denemek isteyene....
not alan sarla belirlenmiştir...
PHP Code:
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © carefulCode53358
//@version=5
indicator(". ", overlay = true)
//Reverse
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.red, "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.red, "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.red, "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)
//TrailingStop
//Stop
//Top-Bottom
plot = input.bool(true, title="Display past dots")
OverSold = input(0)
OverBought = input(100)
length1 = input.int(2, title = "Length")
tr = input.int(1, title = "Trigger Length")
// Define the function
func(source, int len, int tr) =>
HP = 0.00, a1 = 0.00, b1 = 0.00, c1 = 0.00, c2 = 0.00, c3 = 0.00, ag = 0.00, Sp = 0.00, X = 0.00, Quotient1 = 0.00, Quotient2 = 0.00, w = math.sqrt(.5)
HP := 2500 * (source - 2 * nz(source[1]) + nz(source[2])) + 1.92 * nz(HP[1]) - .9216 * nz(HP[2])
a1 := math.exp(-math.sqrt(2) * math.pi / len)
b1 := 2 * a1 * math.cos(math.sqrt(2) * math.pi / len)
c2 := b1
c3 := -a1 * a1
c1 := 1 - c2 - c3
ag := c1 * (HP + nz(HP[1])) / 2 + c2 * nz(ag[1]) + c3 * nz(ag[2])
Sp := .991 * nz(Sp[1])
if math.abs(ag) > Sp
Sp := math.abs(ag)
Sp
if Sp != 0
X := ag / Sp
X
q1 = X * 60 + 50
out= ta.sma(q1, tr)
[out]
[k] = func(close, length1,tr)
OverboughtCond = k > OverBought
OversoldCond = k < OverSold
//plotshape(plot? OverboughtCond:na, style=shape.cross, location=location.abovebar, color=color.new(color.red, 50), size=size.tiny)
//plotshape(plot? OversoldCond:na, style=shape.cross, location=location.belowbar, color=color.new(color.lime, 50), size=size.tiny)
var label myLabel_Overbought = na
if OverboughtCond
// Delete the previous label if there is one
if not na(myLabel_Overbought)
label.delete(myLabel_Overbought[1])
// Create a new label
myLabel_Overbought := label.new(bar_index, high, 'Tepe',yloc=yloc.abovebar,style=label.style_circle, size=size.normal, color=color.rgb(255, 82, 82, 50), textcolor=color.white)
myLabel_Overbought
var label myLabel_Oversold = na
if OversoldCond
// Delete the previous label if there is one
if not na(myLabel_Oversold)
label.delete(myLabel_Oversold[1])
// Create a new label
myLabel_Oversold := label.new(bar_index, low, 'Dip',yloc=yloc.belowbar,style=label.style_circle, size=size.normal, color=color.rgb(0, 230, 119, 50), textcolor=color.white)
myLabel_Oversold
//
startsa = input.float(0, "Starting value")
incsa = input.float(0.01, "Increment")
maxsa = input.float(1, "Max Value")
widthsa = input.float(9.00, "Zone width")
atrs = ta.atr(100) * widthsa
sarone = ta.sar(startsa, incsa, maxsa)
sarzone = if close > sarone
sarone + atrs
else if close < sarone
sarone - atrs
sartwo = ta.sar(startsa/2, incsa/2, maxsa/2)
p1sa = plot(sarone, "BT", color = close > sarone ? #2962ff00 : #e91e6200, style=plot.style_circles)
p3sa = plot(sarzone, "TB", color = close > sarone ? #2962ff00 : #e91e6200, style=plot.style_circles)
fill(p1sa, p3sa, color = close > sarone ? color.new(#848486, 80) : color.new(#e91e62, 100))
//plot(sartwo, "Second SAR", color = close > sartwo ? color.new(#2962ff, 50) : color.new(#e91e63, 50), style=plot.style_linebr)
////Emas
q1 = ta.ema(ohlc4, 1)
q5 = ta.ema(ohlc4, 5)
q9 = ta.ema(ohlc4, 9)
q13 = ta.ema(ohlc4, 13)
q26 = ta.ema(ohlc4, 26)
q50 = ta.ema(ohlc4, 50)
q100 = ta.ema(ohlc4, 100)
q200 = ta.ema(ohlc4, 200)
qeq=(q1+q5+q9+q13+q26+q50+q100+q200)/8
plot(qeq,"AVG-EMA",color.yellow, linewidth=1)
-
bir çok kod birleşimine örnek.....
kodun içinde....plotların çoğu kapalı......
istediklerinizi açıp kullanabilirsiniz......
örnek olsun diye birkaçı açılmış hali.....
denemek isteyene kod....
PHP Code:
//@version=5
// Copyright (c) 2019-present, Franklin Moormann (cheatcountry)
// Reverse Moving Average Convergence Divergence [CC] script may be freely distributed under the MIT license.
indicator('*', max_bars_back=500, overlay=true)
////////////////////Ana Kalıp/////////////////////////
inp = input(title='Source', defval=close)
res = input.timeframe(title='Resolution', defval='')
rep = input(title='Allow Repainting?', defval=false)
//////////////////////////////////////////////////////
src1 = request.security(syminfo.tickerid, res, inp[rep ? 0 : barstate.isrealtime ? 1 : 0])[rep ? 0 : barstate.isrealtime ? 0 : 1]
fastLength1 = input.int(title='FastLength', defval=12, minval=1)
slowLength1 = input.int(title='SlowLength', defval=26, minval=1)
signalLength1 = input.int(title='SignalLength', defval=9, minval=1)
macdLevel1 = input.float(title='MacdLevel', defval=0, minval=0)
fastAlpha1 = 2.0 / (1 + fastLength1)
slowAlpha1 = 2.0 / (1 + slowLength1)
fastEma1 = ta.ema(src1, fastLength1)
slowEma1 = ta.ema(src1, slowLength1)
pMacdEq1 = fastAlpha1 - slowAlpha1 != 0 ? ((nz(fastEma1[1]) * fastAlpha1) - (nz(slowEma1[1]) * slowAlpha1)) / (fastAlpha1 - slowAlpha1) : 0
pMacdEqSig1 = ta.ema(pMacdEq1, signalLength1)
pMacdLevel1 = fastAlpha1 - slowAlpha1 != 0 ? (macdLevel1 - (nz(fastEma1[1]) * (1 - fastAlpha1)) + (nz(slowEma1[1]) * (1 - slowAlpha1))) / (fastAlpha1 - slowAlpha1) : 0
slo1 = src1 - pMacdEq1
sig1 = slo1 > 0 ? slo1 > nz(slo1[1]) ? 2 : 1 : slo1 < 0 ? slo1 < nz(slo1[1]) ? -2 : -1 : 0
rmacdColor = sig1 > 1 ? color.green : sig1 > 0 ? color.lime : sig1 < -1 ? color.maroon : sig1 < 0 ? color.red : color.white
plot(pMacdEq1, title='MACD',style=plot.style_cross, color=rmacdColor, linewidth=2)
plot(pMacdEqSig1, title='MacdEqSignal', color=color.rgb(255, 255, 255, 100), linewidth=1)
//plot(pMacdLevel1, title='MacdLevel', color=color.blue, linewidth=2)
memo1=(pMacdEq1+pMacdEqSig1+pMacdLevel1)/3
plot(memo1, title='Avarage', color=color.rgb(241, 225, 8, 100), linewidth=2)
////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
src3 = request.security(syminfo.tickerid, res, inp[rep ? 0 : barstate.isrealtime ? 1 : 0])[rep ? 0 : barstate.isrealtime ? 0 : 1]
length3 = input.int(title='Length', defval=12, minval=1)
rmsLength3 = input.int(title='RMSLength', defval=50, minval=1)
mom3 = src3 - nz(src3[length3])
hannLength3 = math.ceil(length3 / 1.4)
filt3 = 0.0
coef3 = 0.0
for i = 1 to hannLength3 by 1
cos3 = 1 - math.cos(2 * math.pi * i / (hannLength3 + 1))
filt3 += cos3 * nz(mom3[i - 1])
coef3 += cos3
coef3
hFilt3 = coef3 != 0 ? filt3 / coef3 : 0
filtMa3 = math.sum(math.pow(hFilt3, 2), rmsLength3) / rmsLength3
rms3 = filtMa3 > 0 ? math.sqrt(filtMa3) : 0
scaledFilt3 = rms3 != 0 ? hFilt3 / rms3 : 0
a13 = math.exp(-1.414 * math.pi * math.abs(scaledFilt3) / length3)
b13 = 2 * a13 * math.cos(1.414 * math.pi * math.abs(scaledFilt3) / length3)
c23 = b13
c33 = -a13 * a13
c13 = 1 - c23 - c33
dsss3 = 0.0
dsss3 := c13 * ((src3 + nz(src3[1])) / 2) + c23 * nz(dsss3[1]) + c33 * nz(dsss3[2])
slo3 = src3 - dsss3
sig3 = slo3 > 0 ? slo3 > nz(slo3[1]) ? 2 : 1 : slo3 < 0 ? slo3 < nz(slo3[1]) ? -2 : -1 : 0
dsssColor = sig3 > 1 ? color.green : sig3 > 0 ? color.lime : sig3 < -1 ? color.maroon : sig3 < 0 ? color.red : color.black
plot(dsss3, title='Filter', color=dsssColor, linewidth=2)
///////////////////////////////////////////////////////////
src4 = request.security(syminfo.tickerid, res, inp[rep ? 0 : barstate.isrealtime ? 1 : 0])[rep ? 0 : barstate.isrealtime ? 0 : 1]
length4 = input.int(title='Length', defval=27, minval=1)
a14 = math.exp(-1.414 * math.pi / length4)
b14 = 2 * a14 * math.cos(1.414 * math.pi / length4)
c24 = b14
c34 = -a14 * a14
c14 = 1 - c24 - c34
ssf4 = 0.0
ssf4 := bar_index < 3 ? src4 : 0.5 * c14 * (src4 + nz(src4[1])) + c24 * nz(ssf4[1]) + c34 * nz(ssf4[2])
e14 = 0.0
e14 := bar_index < 3 ? 0 : c14 * (src4 - ssf4) + c24 * nz(e14[1]) + c34 * nz(e14[2])
aef4 = ssf4 + e14
slo4 = src4 - nz(aef4[1])
sig4 = slo4 > 0 ? slo4 > nz(slo4[1]) ? 2 : 1 : slo4 < 0 ? slo4 < nz(slo4[1]) ? -2 : -1 : 0
aefColor = sig4 > 1 ? color.green : sig4 > 0 ? color.lime : sig4 < -1 ? color.maroon : sig4 < 0 ? color.red : color.black
//plot(aef4, title='Filter', color=aefColor, linewidth=2)
//////////////////////////////////////////////////////////////
src5 = request.security(syminfo.tickerid, res, inp[rep ? 0 : barstate.isrealtime ? 1 : 0])[rep ? 0 : barstate.isrealtime ? 0 : 1]
acc5 = input.float(title='Accelerator', defval=1.0, minval=1.0, step=0.01)
minLength5 = input.int(title='MinLength', defval=5, minval=1)
maxLength5 = input.int(title='MaxLength', defval=50, minval=1)
smoothLength5 = input.int(title='SmoothLength', defval=4, minval=1)
mult5 = input.float(title='Multiple', defval=2.0, minval=.01)
// We are checking current volatility to see how high it is and adjust accordingly.
// If volatility is very high then we use the minLength and vice versa
// Reason behind this is to hug price closely during high volatility but lag for low volatility
mean5 = ta.sma(src5, maxLength5)
stdDev5 = ta.stdev(src5, maxLength5)
a5 = mean5 - 1.75 * stdDev5
b5 = mean5 - 0.25 * stdDev5
c5 = mean5 + 0.25 * stdDev5
d5 = mean5 + 1.75 * stdDev5
length5 = 0.0
length5 := src5 >= b5 and src5 <= c5 ? nz(length5[1], maxLength5) + 1 : src5 < a5 or src5 > d5 ? nz(length5[1], maxLength5) - 1 : nz(length5[1], maxLength5)
length5 := math.max(math.min(length5, maxLength5), minLength5)
len5 = math.round(length5)
// We are providing a dynamic weight depending on the current momentum
// When momentum is at an extreme for overbought/oversold then we give more weight to the current price
mf5 = na(volume) or volume == 0 ? 100.0 - 100.0 / (1.0 + src5 / len5) : ta.mfi(src5, len5)
mfScaled5 = mf5 * 2 - 100
p5 = acc5 + math.abs(mfScaled5) / 25
sum5 = 0.0
weightSum5 = 0.0
for i = 0 to len5 - 1 by 1
weight5 = math.pow(len5 - i, p5)
sum5 += src5[i] * weight5
weightSum5 += weight5
weightSum5
uma5 = ta.wma(sum5 / weightSum5, smoothLength5)
stdev55 = ta.stdev(src5, len5)
upperBand5 = uma5 + stdev55 * mult5
lowerBand5 = uma5 - stdev55 * mult5
slo5 = src5 - uma5
sig5 = src5 > upperBand5 and nz(src5[1]) <= nz(upperBand5[1]) or src5 > lowerBand5 and nz(src5[1]) <= nz(lowerBand5[1]) ? 1 : src5 < lowerBand5 and nz(src5[1]) >= nz(lowerBand5[1]) or src5 < upperBand5 and nz(src5[1]) >= nz(upperBand5[1]) ? -1 : slo5 > 0 ? slo5 > nz(slo5[1]) ? 2 : 1 : slo5< 0 ? slo5 < nz(slo5[1]) ? -2 : -1 : 0
umaColor = sig5 > 1 ? color.green : sig5 > 0 ? color.lime : sig5 < -1 ? color.maroon : sig5 < 0 ? color.red : color.black
//plot(upperBand5, title='UpperBand', linewidth=2, color=umaColor)
//plot(uma5, title='MiddleBand', linewidth=1, color=color.new(color.white, 0))
//plot(lowerBand5, title='LowerBand', linewidth=2, color=umaColor)
/////////////////////////////////////////////////////////////////////////////////////
src6 = request.security(syminfo.tickerid, res, inp[rep ? 0 : barstate.isrealtime ? 1 : 0])[rep ? 0 : barstate.isrealtime ? 0 : 1]
acc6 = input.float(title='Accelerator', defval=1.0, minval=1.0, step=0.01)
minLength6 = input.int(title='MinLength', defval=5, minval=1)
maxLength6 = input.int(title='MaxLength', defval=50, minval=1)
smoothLength6 = input.int(title='SmoothLength', defval=4, minval=1)
// We are checking current volatility to see how high it is and adjust accordingly.
// If volatility is very high then we use the minLength and vice versa
// Reason behind this is to hug price closely during high volatility but lag for low volatility
mean6 = ta.sma(src6, maxLength6)
stdDev6 = ta.stdev(src6, maxLength6)
a6 = mean6 - 1.75 * stdDev6
b6 = mean6 - 0.25 * stdDev6
c6 = mean6 + 0.25 * stdDev6
d6 = mean6 + 1.75 * stdDev6
length6 = 0.0
length6 := src6 >= b6 and src6 <= c6 ? nz(length6[1], maxLength6) + 1 : src6 < a6 or src6 > d6 ? nz(length6[1], maxLength6) - 1 : nz(length6[1], maxLength6)
length6 := math.max(math.min(length6, maxLength6), minLength6)
len6 = math.round(length6)
// We are providing a dynamic weight depending on the current momentum
// When momentum is at an extreme for overbought/oversold then we give more weight to the current price
mf6 = na(volume) or volume == 0 ? 100.0 - 100.0 / (1.0 + src6 / len6) : ta.mfi(src6, len6)
mfScaled6 = mf6 * 2 - 100
p6 = acc6 + math.abs(mfScaled6) / 25
sum6 = 0.0
weightSum6 = 0.0
for i = 0 to len6 - 1 by 1
weight6 = math.pow(len6 - i, p6)
sum6 += src6[i] * weight6
weightSum6 += weight6
weightSum6
uma6 = ta.wma(sum6 / weightSum6, smoothLength6)
slo6 = src6 - uma6
sig6 = slo6 > 0 ? slo6 > nz(slo6[1]) ? 2 : 1 : slo6 < 0 ? slo6 < nz(slo6[1]) ? -2 : -1 : 0
umaColor6 = sig6 > 1 ? color.green : sig6 > 0 ? color.lime : sig6 < -1 ? color.maroon : sig6 < 0 ? color.red : color.black
//plot(uma6, title='UMA', linewidth=2, color=umaColor6)
//////////////////////////////////////////////////////////
src7 = request.security(syminfo.tickerid, res, inp[rep ? 0 : barstate.isrealtime ? 1 : 0])[rep ? 0 : barstate.isrealtime ? 0 : 1]
length7 = input.int(title='Length', defval=15, minval=1)
ma7 = ta.sma(src7, length7)
a7 = ta.linreg(src7, length7, 0)
m7 = a7 - nz(a7[1]) + ma7
ie27 = (m7 + a7) / 2
slo7 = src7 - ie27
sig7 = slo7 > 0 ? slo7 > nz(slo7[1]) ? 2 : 1 : slo7 < 0 ? slo7 < nz(slo7[1]) ? -2 : -1 : 0
ie2Color = sig7 > 1 ? color.green : sig7 > 0 ? color.lime : sig7 < -1 ? color.maroon : sig7 < 0 ? color.red : color.white
//plot(ie27, title='IE2', color=ie2Color, linewidth=2)
////////////////////////////////////////////////////////
src8 = request.security(syminfo.tickerid, res, inp[rep ? 0 : barstate.isrealtime ? 1 : 0])[rep ? 0 : barstate.isrealtime ? 0 : 1]
length8 = input(title='Length', defval=14)
sum8 = 0.0
weightSum8 = 0.0
for i = 0 to length8 - 1 by 1
weight8 = math.pow(length8 - i, 3)
sum8 += src8[i] * weight8
weightSum8 += weight8
weightSum8
cwma8 = sum8 / weightSum8
sig8 = src8 > cwma8 ? 1 : src8 < cwma8 ? -1 : 0
cwmaColor = sig8 > 0 ? color.green : sig8 < 0 ? color.red : color.black
//plot(cwma8, title='CWMA', linewidth=2, color=cwmaColor)
////////////////////////////////////////////////////////////
src9 = request.security(syminfo.tickerid, res, inp[rep ? 0 : barstate.isrealtime ? 1 : 0])[rep ? 0 : barstate.isrealtime ? 0 : 1]
length9 = input.int(title='Length', defval=15, minval=1)
pi9 = 2 * math.asin(1)
a9 = math.exp(-1.414 * pi9 / length9)
b9 = 2 * a9 * math.cos(1.414 * pi9 / length9)
c29 = b9
c39 = -a9 * a9
c19 = (1 - b9 + math.pow(a9, 2)) / 4
bf9 = 0.0
bf9 := bar_index < 3 ? src9 : c19 * (src9 + 2 * nz(src9[1]) + nz(src9[2])) + c29 * nz(bf9[1]) + c39 * nz(bf9[2])
sig9 = src9 > bf9 ? 1 : src9 < bf9 ? -1 : 0
bfColor9 = sig9 > 0 ? color.green : sig9 < 0 ? color.red : color.black
//plot(bf9, title='2PBF', color=bfColor9, linewidth=2)
///////////////////////////////////////////////////////
src10 = request.security(syminfo.tickerid, res, inp[rep ? 0 : barstate.isrealtime ? 1 : 0])[rep ? 0 : barstate.isrealtime ? 0 : 1]
length10 = input.int(title='Length', defval=10, minval=1)
pi10 = 2 * math.asin(1)
a10 = math.exp(-1.414 * pi10 / length10)
b10 = 2 * a10 * math.cos(1.414 * 1.25 * pi10 / length10)
c210 = b10
c310 = -a10 * a10
c110 = 1 - c210 - c310
bf10 = 0.0
bf10 := c110 * src10 + c210 * nz(bf10[1]) + c310 * nz(bf10[2])
sig10 = src10 > bf10 ? 1 : src10 < bf10 ? -1 : 0
bfColor10 = sig10 > 0 ? color.green : sig10 < 0 ? color.red : color.black
//plot(bf10, title='2PBF', color=bfColor10, linewidth=2)
///////////////////////////////////////////////////////
src11 = request.security(syminfo.tickerid, res, inp[rep ? 0 : barstate.isrealtime ? 1 : 0])[rep ? 0 : barstate.isrealtime ? 0 : 1]
length11 = input.int(title='Length', defval=15, minval=1)
pi11 = 2 * math.asin(1)
a111 = math.exp(-1.414 * pi11 / length11)
b111 = 2 * a111 * math.cos(1.414 * pi11 / length11)
coef211 = b111
coef311 = -a111 * a111
coef111 = 1 - coef211 - coef311
ssf11 = 0.0
ssf11 := bar_index < 3 ? src11 : coef111 * src11 + coef211 * nz(ssf11[1]) + coef311 * nz(ssf11[2])
sig11 = src11 > ssf11 ? 1 : src11 < ssf11 ? -1 : 0
ssfColor = sig11 > 0 ? color.green : sig11 < 0 ? color.red : color.black
//plot(ssf11, title='SSF', color=ssfColor, linewidth=2)
/////////////////////////////////////////////////////
src12 = request.security(syminfo.tickerid, res, inp[rep ? 0 : barstate.isrealtime ? 1 : 0])[rep ? 0 : barstate.isrealtime ? 0 : 1]
length12 = input.int(title='Length', defval=10, minval=1)
pi12 = 2 * math.asin(1)
a12 = math.exp(-1.414 * pi12 / length12)
b12 = 2 * a12 * math.cos(1.414 * pi12 / length12)
c212 = b12
c312 = -a12 * a12
c112 = 1 - c212 - c312
ssf12 = 0.0
ssf12 := c112 * ((src12 + nz(src12[1])) / 2) + c212 * nz(ssf12[1]) + c312 * nz(ssf12[2])
sig12 = src12 > ssf12 ? 1 : src12 < ssf12 ? -1 : 0
ssfColor12 = sig12 > 0 ? color.green : sig12 < 0 ? color.red : color.black
//plot(ssf12, title='SSF', color=ssfColor12, linewidth=2)
/////////////////////////////////////////////////////
src13 = request.security(syminfo.tickerid, res, inp[rep ? 0 : barstate.isrealtime ? 1 : 0])[rep ? 0 : barstate.isrealtime ? 0 : 1]
length13 = input.int(title='Length', defval=10, minval=1)
pi13 = 2 * math.asin(1)
a130 = math.exp(-pi13 / length13)
b130 = 2 * a130 * math.cos(1.738 * pi13 / length13)
c130 = a130 * a130
d213 = b130 + c130
d313 = -(c130 + b130 * c130)
d413 = c130 * c130
d113 = 1 - d213 - d313 - d413
bf13 = 0.0
bf13 := d113 * src13 + d213 * nz(bf13[1]) + d313 * nz(bf13[2]) + d413 * nz(bf13[3])
sig13 = src13 > bf13 ? 1 : src13 < bf13 ? -1 : 0
bfColor13 = sig13 > 0 ? color.green : sig13 < 0 ? color.red : color.black
//plot(bf13, title='3PBF', color=bfColor13, linewidth=2)
//////////////////////////////////////////////////////
src14 = request.security(syminfo.tickerid, res, inp[rep ? 0 : barstate.isrealtime ? 1 : 0])[rep ? 0 : barstate.isrealtime ? 0 : 1]
length14 = input.int(title='Length', defval=15, minval=1)
pi14 = 2 * math.asin(1)
a114 = math.exp(-pi14 / length14)
b114 = 2 * a114 * math.cos(1.738 * pi14 / length14)
c114 = a114 * a114
coef214 = b114 + c114
coef314 = -(c114 + b114 * c114)
coef414 = c114 * c114
coef114 = (1 - b114 + c114) * (1 - c114) / 8
bf14 = 0.0
bf14 := bar_index < 4 ? src14 : coef114 * (src14 + 3 * nz(src14[1]) + 3 * nz(src14[2]) + nz(src14[3])) + coef214 * nz(bf14[1]) + coef314 * nz(bf14[2]) + coef414 * nz(bf14[3])
sig14 = src14 > bf14 ? 1 : src14 < bf14 ? -1 : 0
bfColor14 = sig14 > 0 ? color.green : sig14 < 0 ? color.red : color.black
//plot(bf14, title='3PBF', color=bfColor14, linewidth=2)
///////////////////////////////////////
src15 = request.security(syminfo.tickerid, res, inp[rep ? 0 : barstate.isrealtime ? 1 : 0])[rep ? 0 : barstate.isrealtime ? 0 : 1]
length15 = input.int(title='Length', defval=15, minval=1)
pi15 = 2 * math.asin(1)
a115 = math.exp(-pi15 / length15)
b115 = 2 * a115 * math.cos(1.738 * pi15 / length15)
c115 = a115 * a115
coef215 = b115 + c115
coef315 = -(c115 + b115 * c115)
coef415 = c115 * c115
coef115 = 1 - coef215 - coef315 - coef415
ssf15 = 0.0
ssf15 := bar_index < 4 ? src15 : coef115 * src15 + coef215 * nz(ssf15[1]) + coef315 * nz(ssf15[2]) + coef415 * nz(ssf15[3])
sig15 = src15 > ssf15 ? 1 : src15 < ssf15 ? -1 : 0
ssfColor15 = sig15 > 0 ? color.green : sig15 < 0 ? color.red : color.black
//plot(ssf15, title='SSF', color=ssfColor15, linewidth=2)
////////////////////////////////////////////
src16 = request.security(syminfo.tickerid, res, inp[rep ? 0 : barstate.isrealtime ? 1 : 0])[rep ? 0 : barstate.isrealtime ? 0 : 1]
length16 = input.int(title='Length', defval=20, minval=1)
pi16 = 2 * math.asin(1)
twoPiPrd16 = 2 * pi16 / length16
alpha16 = (math.cos(twoPiPrd16) + math.sin(twoPiPrd16) - 1) / math.cos(twoPiPrd16)
dec16 = 0.0
dec16 := alpha16 / 2 * (src16 + nz(src16[1])) + (1 - alpha16) * nz(dec16[1])
sig16 = src16 > dec16 ? 1 : src16 < dec16 ? -1 : 0
decColor16 = sig16 > 0 ? color.green : sig16 < 0 ? color.red : color.black
//plot(dec16, title='DEC', color=decColor16, linewidth=2)
////////////////////////////////
length17 = input.int(title='Length', defval=15, minval=1)
src17 = request.security(syminfo.tickerid, res, inp[rep ? 0 : barstate.isrealtime ? 1 : 0])[rep ? 0 : barstate.isrealtime ? 0 : 1]
num17 = 0.0
coefSum17 = 0.0
for i = 0 to length17 - 1 by 1
distance17 = 0.0
for lb17 = 1 to length17 - 1 by 1
distance17 += math.pow(nz(src17[i]) - nz(src17[i + lb17]), 2)
distance17
num17 += distance17 * nz(src17[i])
coefSum17 += distance17
coefSum17
filt17 = coefSum17 != 0 ? num17 / coefSum17 : 0
sig17 = src17 > filt17 ? 1 : src17 < filt17 ? -1 : 0
filtColor17 = sig17 > 0 ? color.green : sig17 < 0 ? color.red : color.black
//plot(filt17, title='Filter', color=filtColor17, linewidth=2)
///////////////////////////////
src18 = request.security(syminfo.tickerid, res, inp[rep ? 0 : barstate.isrealtime ? 1 : 0])[rep ? 0 : barstate.isrealtime ? 0 : 1]
length18 = input.int(title="Length", defval=14, minval=1)
pedestal18 = input.float(title="Pedestal", defval=3, minval=0.01)
filt18 = 0.0, coef18 = 0.0
for i = 0 to length18 - 1
sine18 = math.sin(pedestal18 + (((math.pi - (2 * pedestal18)) * i) / (length18 - 1)))
filt18 := filt18 + (sine18 * nz(src18[i]))
coef18 := coef18 + sine18
filt18 := coef18 != 0 ? filt18 / coef18 : 0
slo18 = src18 - filt18
sig18 = slo18 > 0 ? slo18 > nz(slo18[1]) ? 2 : 1 : slo18 < 0 ? slo18 < nz(slo18[1]) ? -2 : -1 : 0
hmaColor18 = sig18 > 1 ? color.green : sig18 > 0 ? color.lime : sig18 < -1 ? color.maroon : sig18 < 0 ? color.red : color.white
//plot(filt18, title='Hma', color=hmaColor18, linewidth=2)
//////////////////////////////
src19 = request.security(syminfo.tickerid, res, inp[rep ? 0 : barstate.isrealtime ? 1 : 0])[rep ? 0 : barstate.isrealtime ? 0 : 1]
length19 = input.int(title="Length", defval=14, minval=1)
filt19 = 0.0, coef19 = 0.0
for i = 1 to length19 by 1
cosine19 = 1 - math.cos(2 * math.pi * i / (length19 + 1))
filt19 += cosine19 * nz(src19[i - 1])
coef19 += cosine19
filt19 := coef19 != 0 ? filt19 / coef19 : 0
slo19 = src19 - filt19
sig19 = slo19 > 0 ? slo19 > nz(slo19[1]) ? 2 : 1 : slo19 < 0 ? slo19 < nz(slo19[1]) ? -2 : -1 : 0
hmaColor19 = sig19 > 1 ? color.green : sig19 > 0 ? color.lime : sig19 < -1 ? color.maroon : sig19 < 0 ? color.red : color.white
//plot(filt19, title='Hma', color=hmaColor19, linewidth=2)
/////////////////////////////////////
src20 = request.security(syminfo.tickerid, res, inp[rep ? 0 : barstate.isrealtime ? 1 : 0])[rep ? 0 : barstate.isrealtime ? 0 : 1]
pi20 = 2 * math.asin(1)
period20 = 0.0
smooth20 = (4 * src20 + 3 * nz(src20[1]) + 2 * nz(src20[2]) + nz(src20[3])) / 10
detrender20 = (0.0962 * smooth20 + 0.5769 * nz(smooth20[2]) - 0.5769 * nz(smooth20[4]) - 0.0962 * nz(smooth20[6])) * (0.075 * nz(period20[1]) + 0.54)
q120 = (0.0962 * detrender20 + 0.5769 * nz(detrender20[2]) - 0.5769 * nz(detrender20[4]) - 0.0962 * nz(detrender20[6])) * (0.075 * nz(period20[1]) + 0.54)
i120 = nz(detrender20[3])
jI20 = (0.0962 * i120 + 0.5769 * nz(i120[2]) - 0.5769 * nz(i120[4]) - 0.0962 * nz(i120[6])) * (0.075 * nz(period20[1]) + 0.54)
jQ20 = (0.0962 * q120 + 0.5769 * nz(q120[2]) - 0.5769 * nz(q120[4]) - 0.0962 * nz(q120[6])) * (0.075 * nz(period20[1]) + 0.54)
i220 = i120 - jQ20
i220 := 0.2 * i220 + 0.8 * nz(i220[1])
q220 = q120 + jI20
q220 := 0.2 * q220 + 0.8 * nz(q220[1])
re20 = i220 * nz(i220[1]) + q220 * nz(q220[1])
re20 := 0.2 * re20 + 0.8 * nz(re20[1])
im20= i220 * nz(q220[1]) - q220 * nz(i220[1])
im20 := 0.2 * im20 + 0.8 * nz(im20[1])
period20 := im20 != 0 and re20 != 0 ? 2 * pi20 / math.atan(im20 / re20) : 0
period20 := math.min(math.max(period20, 0.67 * nz(period20[1])), 1.5 * nz(period20[1]))
period20 := math.min(math.max(period20, 6), 50)
period20 := 0.2 * period20 + 0.8 * nz(period20[1])
smoothPeriod20 = 0.0
smoothPeriod20 := 0.33 * period20 + 0.67 * nz(smoothPeriod20[1])
dcPeriod20 = math.ceil(smoothPeriod20 + 0.5)
iTrend20 = 0.0
for i = 0 to dcPeriod20 - 1 by 1
iTrend20 += nz(src20[i])
iTrend20
iTrend20 := dcPeriod20 > 0 ? iTrend20 / dcPeriod20 : iTrend20
trendline20 = (4 * iTrend20 + 3 * nz(iTrend20[1]) + 2 * nz(iTrend20[2]) + nz(iTrend20[3])) / 10
sig20 = smooth20 > trendline20 ? 1 : smooth20 < trendline20 ? -1 : 0
tlColor20 = sig20 > 0 ? color.green : sig20 < 0 ? color.red : color.black
//plot(trendline20, title='Trendline', color=tlColor20, linewidth=2)
///////////////////////////////////
src21 = request.security(syminfo.tickerid, res, inp[rep ? 0 : barstate.isrealtime ? 1 : 0])[rep ? 0 : barstate.isrealtime ? 0 : 1]
alpha21 = input.float(title='Alpha', defval=0.07, minval=0.01, step=0.01)
itrend21 = 0.0
itrend21 := bar_index < 7 ? (src21 + 2 * nz(src21[1]) + nz(src21[2])) / 4 : (alpha21 - math.pow(alpha21, 2) / 4) * src21 + 0.5 * math.pow(alpha21, 2) * nz(src21[1]) - (alpha21 - 0.75 * math.pow(alpha21, 2)) * nz(src21[2]) + 2 * (1 - alpha21) * nz(itrend21[1]) - math.pow(1 - alpha21, 2) * nz(itrend21[2])
trigger21 = 2 * itrend21 - nz(itrend21[2])
sig21 = trigger21 > itrend21 ? 1 : trigger21 < itrend21 ? -1 : 0
itColor21 = sig21 > 0 ? color.green : sig21 < 0 ? color.red : color.black
//plot(trigger21, title='Trigger', color=itColor21, linewidth=2)
//plot(itrend21, title='ITrend', color=color.new(color.black, 0), linewidth=1)
//////////////////////
src22 = request.security(syminfo.tickerid, res, inp[rep ? 0 : barstate.isrealtime ? 1 : 0])[rep ? 0 : barstate.isrealtime ? 0 : 1]
length22 = input.int(title='Length', defval=20, minval=1)
deltaSum22 = 0.0
for int i = 0 to length22 - 1 by 1
deltaSum22 += math.abs(nz(src22[i]) - nz(src22[i + 1]))
ef22 = deltaSum22 != 0 ? math.min(math.abs(src22 - nz(src22[length22 - 1])) / deltaSum22, 1) : 0
s22 = math.pow((0.6667 * ef22) + 0.0645, 2)
kama22 = 0.0
kama22 := (s22 * src22) + ((1 - s22) * nz(kama22[1]))
slo22 = src22 - kama22
sig22 = slo22 > 0 ? slo22 > nz(slo22[1]) ? 2 : 1 : slo22 < 0 ? slo22 < nz(slo22[1]) ? -2 : -1 : 0
kamaColor22 = sig22 > 1 ? color.green : sig22 > 0 ? color.lime : sig22 < -1 ? color.maroon : sig22 < 0 ? color.red : color.black
//plot(kama22, title='Filter', color=kamaColor22, linewidth=2)
////////////////////////
src23 = request.security(syminfo.tickerid, res, inp[rep ? 0 : barstate.isrealtime ? 1 : 0])[rep ? 0 : barstate.isrealtime ? 0 : 1]
gamma23 = input.float(title='Gamma', defval=0.8, minval=0.01, step=0.01)
l023 = 0.0
l023 := (1 - gamma23) * src23 + gamma23 * nz(l023[1])
l123 = 0.0
l123 := -gamma23 * l023 + nz(l023[1]) + gamma23 * nz(l123[1])
l223 = 0.0
l223 := -gamma23 * l123 + nz(l123[1]) + gamma23 * nz(l223[1])
l323 = 0.0
l323 := -gamma23 * l223 + nz(l223[1]) + gamma23 * nz(l323[1])
filt23 = (l023 + 2 * l123 + 2 * l223 + l323) / 6
fir23 = (src23 + 2 * nz(src23[1]) + 2 * nz(src23[2]) + nz(src23[3])) / 6
sig23 = fir23 > filt23 ? 1 : fir23 < filt23 ? -1 : 0
lfColor23 = sig23 > 0 ? color.green : sig23 < 0 ? color.red : color.black
//plot(filt23, title='FILT', color=lfColor23, linewidth=2)
//plot(fir23, title='FIR', color=color.new(color.black, 0), linewidth=1)
/////////////////////////////////
src24 = request.security(syminfo.tickerid, res, inp[rep ? 0 : barstate.isrealtime ? 1 : 0])[rep ? 0 : barstate.isrealtime ? 0 : 1]
threshold24 = input.float(title='Threshold', defval=0.002, minval=0.0001, step=0.001)
length24 = input.int(title='Length', defval=39, minval=1)
smth24 = (src24 + (2 * nz(src24[1])) + (2 * nz(src24[2])) + nz(src24[3])) / 6
len24 = length24
v324 = 0.2, v224 = 0.0, alpha24 = 0.0
while (v324 > threshold24 and len24 > 0)
alpha24 := 2.0 / (len24 + 1)
v124 = ta.median(smth24, len24)
v224 := (alpha24 * smth24) + ((1 - alpha24) * nz(v224[1]))
v324 := v124 != 0 ? math.abs(v124 - v224) / v124 : v324
len24 -= 2
len24 := len24 < 3 ? 3 : len24
alpha24 := 2.0 / (len24 + 1)
filter24 = 0.0
filter24 := (alpha24 * smth24) + ((1 - alpha24) * nz(filter24[1]))
slo24 = src24 - filter24
sig24 = slo24 > 0 ? slo24 > nz(slo24[1]) ? 2 : 1 : slo24 < 0 ? slo24 < nz(slo24[1]) ? -2 : -1 : 0
maafColor24 = sig24 > 1 ? color.green : sig24 > 0 ? color.lime : sig24 < -1 ? color.maroon : sig24 < 0 ? color.red : color.black
//plot(filter24, title='MAAF', linewidth=2, color=maafColor24)
///////////////////////////////
src25 = request.security(syminfo.tickerid, res, inp[rep ? 0 : barstate.isrealtime ? 1 : 0])[rep ? 0 : barstate.isrealtime ? 0 : 1]
fastLimit25 = input.float(title='FastLimit', defval=0.5, minval=0.01, step=0.01)
slowLimit25 = input.float(title='SlowLimit', defval=0.05, minval=0.01, step=0.01)
pi25 = 2 * math.asin(1)
period25 = 0.0
smooth25 = (4 * src25 + 3 * nz(src25[1]) + 2 * nz(src25[2]) + nz(src25[3])) / 10
detrender25 = (0.0962 * smooth25 + 0.5769 * nz(smooth25[2]) - 0.5769 * nz(smooth25[4]) - 0.0962 * nz(smooth25[6])) * (0.075 * nz(period25[1]) + 0.54)
q125 = (0.0962 * detrender25 + 0.5769 * nz(detrender25[2]) - 0.5769 * nz(detrender25[4]) - 0.0962 * nz(detrender25[6])) * (0.075 * nz(period25[1]) + 0.54)
i125 = nz(detrender25[3])
jI25 = (0.0962 * i125 + 0.5769 * nz(i125[2]) - 0.5769 * nz(i125[4]) - 0.0962 * nz(i125[6])) * (0.075 * nz(period25[1]) + 0.54)
jQ25 = (0.0962 * q125 + 0.5769 * nz(q125[2]) - 0.5769 * nz(q125[4]) - 0.0962 * nz(q125[6])) * (0.075 * nz(period25[1]) + 0.54)
i225 = i125 - jQ25
i225 := 0.2 * i225 + 0.8 * nz(i225[1])
q225 = q125 + jI25
q225 := 0.2 * q225 + 0.8 * nz(q225[1])
re25 = i225 * nz(i225[1]) + q225 * nz(q225[1])
re25 := 0.2 * re25 + 0.8 * nz(re25[1])
im25 = i225 * nz(q225[1]) - q225 * nz(i225[1])
im25 := 0.2 * im25 + 0.8 * nz(im25[1])
period25 := im25 != 0 and re25 != 0 ? 2 * pi25 / math.atan(im25 / re25) : 0
period25 := math.min(math.max(period25, 0.67 * nz(period25[1])), 1.5 * nz(period25[1]))
period25 := math.min(math.max(period25, 6), 50)
period25 := 0.2 * period25 + 0.8 * nz(period25[1])
smoothPeriod25 = 0.0
smoothPeriod25 := 0.33 * period25 + 0.67 * nz(smoothPeriod25[1])
phase25 = i125 != 0 ? math.atan(q125 / i125) * 180 / pi25 : 0
deltaPhase25 = nz(phase25[1]) - phase25
deltaPhase25 := deltaPhase25 < 1 ? 1 : deltaPhase25
alpha25 = fastLimit25 / deltaPhase25
alpha25 := alpha25 < slowLimit25 ? slowLimit25 : alpha25
mama25 = 0.0
mama25 := alpha25 * src25 + (1 - alpha25) * nz(mama25[1])
fama25 = 0.0
fama25 := 0.5 * alpha25 * mama25 + (1 - 0.5 * alpha25) * nz(fama25[1])
sig25 = mama25 > fama25 ? 1 : mama25 < fama25 ? -1 : 0
mamaColor25 = sig25 > 0 ? color.green : sig25 < 0 ? color.red : color.black
//plot(mama25, title='MAMA', color=mamaColor25, linewidth=2)
//plot(fama25, title='FAMA', color=color.new(color.black, 0), linewidth=1)
//////////////////////////////////////
length26 = input.int(title='Length', defval=15, minval=1)
momLength26 = input.int(title='MomentumLength', defval=5, minval=1)
src26 = request.security(syminfo.tickerid, res, inp[rep ? 0 : barstate.isrealtime ? 1 : 0])[rep ? 0 : barstate.isrealtime ? 0 : 1]
num26 = 0.0
coefSum26 = 0.0
for i = 0 to length26 - 1 by 1
coef26 = math.abs(nz(src26[i]) - nz(src26[i + momLength26]))
num26 += coef26 * nz(src26[i])
coefSum26 += coef26
coefSum26
filt26 = coefSum26 != 0 ? num26 / coefSum26 : 0
sig26 = src26 > filt26 ? 1 : src26 < filt26 ? -1 : 0
filtColor26 = sig26 > 0 ? color.green : sig26 < 0 ? color.red : color.black
//plot(filt26, title='Filter', color=filtColor26, linewidth=2)
//////////////////////////////////
src27 = request.security(syminfo.tickerid, res, inp[rep ? 0 : barstate.isrealtime ? 1 : 0])[rep ? 0 : barstate.isrealtime ? 0 : 1]
wma127 = (7 * src27 + 6 * nz(src27[1]) + 5 * nz(src27[2]) + 4 * nz(src27[3]) + 3 * nz(src27[4]) + 2 * nz(src27[5]) + nz(src27[6])) / 28
wma227 = (7 * wma127 + 6 * nz(wma127[1]) + 5 * nz(wma127[2]) + 4 * nz(wma127[3]) + 3 * nz(wma127[4]) + 2 * nz(wma127[5]) + nz(wma127[6])) / 28
predict27 = 2 * wma127 - wma227
trigger27 = (4 * predict27 + 3 * nz(predict27[1]) + 2 * nz(predict27[2]) + nz(predict27[3])) / 10
sig27 = predict27 > trigger27 ? 1 : predict27 < trigger27 ? -1 : 0
pmaColor27 = sig27 > 0 ? color.green : sig27 < 0 ? color.red : color.black
//plot(predict27, title='Predict', color=pmaColor27, linewidth=2)
//plot(trigger27, title='Trigger', color=color.new(color.black, 0), linewidth=1)
/////////////////////////////////////
src28 = request.security(syminfo.tickerid, res, inp[rep ? 0 : barstate.isrealtime ? 1 : 0])[rep ? 0 : barstate.isrealtime ? 0 : 1]
length28 = input.int(title="Length", defval=14, minval=1)
filt28 = 0.0, coef28 = 0.0, l228 = length28 / 2.0
for i = 1 to length28
c28 = i < l228 ? i : i > l228 ? length28 + 1 - i : l228
filt28 := filt28 + (c28 * nz(src28[i - 1]))
coef28 := coef28 + c28
filt28 := coef28 != 0 ? filt28 / coef28 : 0
slo28 = src28 - filt28
sig28 = slo28 > 0 ? slo28 > nz(slo28[1]) ? 2 : 1 : slo28 < 0 ? slo28 < nz(slo28[1]) ? -2 : -1 : 0
tmaColor28 = sig28 > 1 ? color.green : sig28 > 0 ? color.lime : sig28 < -1 ? color.maroon : sig28 < 0 ? color.red : color.white
//plot(filt28, title='Tma', color=tmaColor28, linewidth=2)
//////////////////////////////////
src29 = request.security(syminfo.tickerid, res, inp[rep ? 0 : barstate.isrealtime ? 1 : 0])[rep ? 0 : barstate.isrealtime ? 0 : 1]
shortLength29 = input.int(title='ShortLength', defval=9, minval=1)
longLength29 = input.int(title='LongLength', defval=30, minval=1)
shortAvg29 = ta.wma(src29, shortLength29)
shortMa29 = math.sum(math.pow(src29 - shortAvg29, 2), shortLength29) / shortLength29
shortRms29 = shortMa29 > 0 ? math.sqrt(shortMa29) : 0
longAvg29 = ta.wma(src29, longLength29)
longMa29 = math.sum(math.pow(src29 - longAvg29, 2), longLength29) / longLength29
longRms29 = longMa29 > 0 ? math.sqrt(longMa29) : 0
kk29 = longRms29 != 0 ? 0.2 * shortRms29 / longRms29 : 0
vidya29 = 0.0
vidya29 := kk29 * src29 + (1 - kk29) * nz(vidya29[1])
slo29 = src29 - vidya29
sig29 = slo29 > 0 ? slo29 > nz(slo29[1]) ? 2 : 1 : slo29 < 0 ? slo29 < nz(slo29[1]) ? -2 : -1 : 0
vidyaColor29 = sig29 > 1 ? color.green : sig29 > 0 ? color.lime : sig29 < -1 ? color.maroon : sig29 < 0 ? color.red : color.black
//plot(vidya29, title='Vidya', color=vidyaColor29, linewidth=2)
////////////////////////////////////////
src31 = request.security(syminfo.tickerid, res, inp[rep ? 0 : barstate.isrealtime ? 1 : 0])[rep ? 0 : barstate.isrealtime ? 0 : 1]
length31 = input(title='Length', defval=11)
offset31 = input(title='Offset', defval=4)
sum31 = 0.0
weightSum31 = 0.0
for i = 0 to length31 - 1 by 1
weight31 = length31 - i - offset31
sum31 += src31[i] * weight31
weightSum31 += weight31
weightSum31
epma31 = 1 / weightSum31 * sum31
sig31 = src31 > epma31 ? 1 : src31 < epma31 ? -1 : 0
epmaColor31 = sig31 > 0 ? color.green : sig31 < 0 ? color.red : color.black
//plot(epma31, title='EPMA', linewidth=2, color=epmaColor31)
////////////////////////////////
src32 = request.security(syminfo.tickerid, res, inp[rep ? 0 : barstate.isrealtime ? 1 : 0])[rep ? 0 : barstate.isrealtime ? 0 : 1]
length32 = input.int(title='Length', defval=14, minval=1)
jsa32 = (src32 + src32[length32]) / 2
sig32 = src32 > jsa32 ? 1 : src32 < jsa32 ? -1 : 0
jsaColor32 = sig32 > 0 ? color.green : sig32 < 0 ? color.red : color.black
//plot(jsa32, color=jsaColor32, linewidth=2)
/////////////////////////////
src33 = request.security(syminfo.tickerid, res, inp[rep ? 0 : barstate.isrealtime ? 1 : 0])[rep ? 0 : barstate.isrealtime ? 0 : 1]
fastLength33 = input.int(title = "FastLength", defval = 14, minval = 1)
slowLength33 = input.int(title = "SlowLength", defval = 30, minval = 1)
leavittProjection(src33, length33) =>
result33 = ta.linreg(src33, length33, -1)
fastLp33 = leavittProjection(src33, fastLength33)
slowLp33 = leavittProjection(src33, slowLength33)
slo33 = fastLp33 - slowLp33
sig33 = slo33 > 0 ? slo33 > nz(slo33[1]) ? 2 : 1 : slo33 < 0 ? slo33 < nz(slo33[1]) ? -2 : -1 : 0
lpColor33 = sig33 > 1 ? color.green : sig33 > 0 ? color.lime : sig33 < -1 ? color.maroon : sig33 < 0 ? color.red : color.white
//plot(fastLp33, title = 'FastLp', color = lpColor33, linewidth = 2)
//plot(slowLp33, title = 'SlowLp', color = chart.fg_color, linewidth = 1)
//////////////////////////////////
src34 = request.security(syminfo.tickerid, res, inp[rep ? 0 : barstate.isrealtime ? 1 : 0])[rep ? 0 : barstate.isrealtime ? 0 : 1]
length34 = input(title='Length', defval=5)
k34 = input.float(title='K Constant', step=0.1, defval=0.6)
mdi34 = 0.0
mdi34 := na(mdi34[1]) ? src34 : nz(mdi34[1]) + (src34 - nz(mdi34[1])) / math.max(k34 * length34 * math.pow(src34 / nz(mdi34[1]), 4), 1)
sig34 = src34 > mdi34 ? 1 : src34 < mdi34 ? -1 : 0
mdiColor34 = sig34 > 0 ? color.green : sig34 < 0 ? color.red : color.black
//plot(mdi34, title='MDI', linewidth=2, color=mdiColor34)
////////////////////////////////////////////
src35 = request.security(syminfo.tickerid, res, inp[rep ? 0 : barstate.isrealtime ? 1 : 0])[rep ? 0 : barstate.isrealtime ? 0 : 1]
length35 = input.int(title='Length', defval=10, minval=1)
fastLength35 = input.int(title='FastLength', defval=2, minval=1)
slowLength35 = input.int(title='SlowLength', defval=30, minval=1)
// first half uses the same formula as the kaufman adaptive moving average
diff35 = math.abs(src35 - nz(src35[1]))
signal35 = math.abs(src35 - nz(src35[length35]))
noise35 = math.sum(diff35, length35)
ratio35 = noise35 != 0 ? signal35 / noise35 : 0
// this is where it differs from the kaufman adaptive moving average
fastSc35 = 2 / (fastLength35 + 1)
slowSc35 = 2 / (slowLength35 + 1)
temp35 = ratio35 * fastSc35 + slowSc35
maaq35 = 0.0
prevMaaq35 = nz(maaq35[1], src35)
maaq35 := prevMaaq35 + math.pow(temp35, 2) * (src35 - prevMaaq35)
sig35 = src35 > maaq35 ? 1 : src35 < maaq35 ? -1 : 0
maaqColor35 = sig35 > 0 ? color.green : sig35 < 0 ? color.red : color.black
//plot(maaq35, title='MAAQ', linewidth=2, color=maaqColor35)
///////////////////////////////
src36 = request.security(syminfo.tickerid, res, inp[rep ? 0 : barstate.isrealtime ? 1 : 0])[rep ? 0 : barstate.isrealtime ? 0 : 1]
fac36 = input.float(title='Factor', defval=0.2, minval=0.01)
val236 = 2 / fac36 - 1
factor36 = 2 / (val236 + 1)
mwdx36 = 0.0
mwdx36 := factor36 * src36 + (1 - factor36) * nz(mwdx36[1], src36)
sig36 = src36 > mwdx36 ? 1 : src36 < mwdx36 ? -1 : 0
mwdxColor36 = sig36 > 0 ? color.green : sig36 < 0 ? color.red : color.black
//plot(mwdx36, title='MWDX', linewidth=2, color=mwdxColor36)
////////////////////////
src37 = request.security(syminfo.tickerid, res, inp[rep ? 0 : barstate.isrealtime ? 1 : 0])[rep ? 0 : barstate.isrealtime ? 0 : 1]
fastLength37 = input.int(title='FastLength', defval=10, minval=1)
slowLength37 = input.int(title='SlowLength', defval=50, minval=1)
mult37 = input.int(title='Multiple', defval=1, minval=1)
fastEma37 = ta.ema(src37, fastLength37)
slowEma37 = ta.ema(src37, slowLength37)
sqAvg37 = math.sum(math.pow(slowEma37 - fastEma37, 2), fastLength37) / fastLength37
dev37 = math.sqrt(sqAvg37) * mult37
upperBand37 = slowEma37 + dev37
lowerBand37 = slowEma37 - dev37
middleBand37 = fastEma37
sig37 = src37 > upperBand37 and nz(src37[1]) <= nz(upperBand37[1]) or src37 > lowerBand37 and nz(src37[1]) <= nz(lowerBand37[1]) ? 1 : src37 < lowerBand37 and nz(src37[1]) >= nz(lowerBand37[1]) or src37 < upperBand37 and nz(src37[1]) >= nz(upperBand37[1]) ? -1 : src37 > middleBand37 ? 1 : src37 < middleBand37 ? -1 : 0
mabColor37 = sig37 > 0 ? color.green : sig37 < 0 ? color.red : color.black
//plot(upperBand37, title='MabUp', color=mabColor37, linewidth=2)
//plot(middleBand37, title='MabMid', color=color.new(color.black, 0), linewidth=1)
//plot(lowerBand37, title='MabLow', color=mabColor37, linewidth=2)
//////////////////////////////////
src38 = request.security(syminfo.tickerid, res, inp[rep ? 0 : barstate.isrealtime ? 1 : 0])[rep ? 0 : barstate.isrealtime ? 0 : 1]
length38 = input(title='Length', defval=14)
sum38 = 0.0
weightSum38 = 0.0
owma38 = 0.0
for i = 0 to length38 - 1 by 1
corr38 = ta.correlation(src38, owma38, length38)
weight38 = math.pow(length38 - i, corr38)
sum38 += src38[i] * weight38
weightSum38 += weight38
weightSum38
owma38 := sum38/ weightSum38
sig38 = src38 > owma38 ? 1 : src38 < owma38 ? -1 : 0
owmaColor38 = sig38 > 0 ? color.green : sig38 < 0 ? color.red : color.black
//plot(owma38, title='OWMA', linewidth=2, color=owmaColor38)
/////////////////////////////////
src39 = request.security(syminfo.tickerid, res, inp[rep ? 0 : barstate.isrealtime ? 1 : 0])[rep ? 0 : barstate.isrealtime ? 0 : 1]
minLength39 = input.int(title='MinLength', defval=5, minval=1)
maxLength39 = input.int(title='MaxLength', defval=50, minval=1)
mean39 = ta.sma(src39, maxLength39)
stdDev39 = ta.stdev(src39, maxLength39)
a39 = mean39 - 1.75 * stdDev39
b39 = mean39 - 0.25 * stdDev39
c390 = mean39 + 0.25 * stdDev39
d39 = mean39 + 1.75 * stdDev39
length39 = 0.0
length39 := src39 >= b39 and src39 <= c390 ? nz(length39[1], maxLength39) + 1 : src39 < a39 or src39 > d39 ? nz(length39[1], maxLength39) - 1 : nz(length39[1], maxLength39)
length39 := math.max(math.min(length39, maxLength39), minLength39)
sc39 = 2 / (length39 + 1)
vlma39 = 0.0
vlma39 := src39 * sc39 + (1 - sc39) * nz(vlma39[1], src39)
sig39 = src39 > vlma39 ? 1 : src39 < vlma39 ? -1 : 0
vlmaColor39 = sig39 > 0 ? color.green : sig39 < 0 ? color.red : color.black
//plot(vlma39, title='VLMA', linewidth=2, color=vlmaColor39)
//////////////////////////////
src41 = request.security(syminfo.tickerid, res, inp[rep ? 0 : barstate.isrealtime ? 1 : 0])[rep ? 0 : barstate.isrealtime ? 0 : 1]
length41 = input(title='Length', defval=14)
p41 = input.float(title='Power', minval=0, defval=1.0)
sum41 = 0.0
weightSum41 = 0.0
for i = 0 to length41 - 1 by 1
weight41 = math.pow(length41 - i, p41)
sum41 += src41[i] * weight41
weightSum41 += weight41
weightSum41
vpwma41 = sum41 / weightSum41
sig41 = src41 > vpwma41 ? 1 : src41 < vpwma41 ? -1 : 0
vpwmaColor41 = sig41 > 0 ? color.green : sig41 < 0 ? color.red : color.black
//plot(vpwma41, title='VPWMA', linewidth=2, color=vpwmaColor41)
/////////////////////////////
src42 = request.security(syminfo.tickerid, res, inp[rep ? 0 : barstate.isrealtime ? 1 : 0])[rep ? 0 : barstate.isrealtime ? 0 : 1]
length42 = input(title='Length', defval=14)
sum42 = 0.0
weightSum42 = 0.0
for i = 0 to length42 - 1 by 1
weight42 = math.pow(length42 - i, 2)
sum42 += src42[i] * weight42
weightSum42 += weight42
weightSum42
swma42 = sum42 / weightSum42
sig42 = src42 > swma42 ? 1 : src42 < swma42 ? -1 : 0
swmaColor42 = sig42 > 0 ? color.green : sig42 < 0 ? color.red : color.black
//plot(swma42, title='SWMA', linewidth=2, color=swmaColor42)
//////////////////////////
src43 = request.security(syminfo.tickerid, res, inp[rep ? 0 : barstate.isrealtime ? 1 : 0])[rep ? 0 : barstate.isrealtime ? 0 : 1]
length43 = input(title='Length', defval=14)
sum43 = 0.0
weightSum43 = 0.0
for i = 0 to length43 - 1 by 1
weight43 = math.pow(length43 - i, 0.5)
sum43 += src43[i] * weight43
weightSum43 += weight43
weightSum43
srwma43 = sum43 / weightSum43
sig43 = src43 > srwma43 ? 1 : src43 < srwma43 ? -1 : 0
srwmaColor43 = sig43 > 0 ? color.green : sig43 < 0 ? color.red : color.black
//plot(srwma43, title='SRWMA', linewidth=2, color=srwmaColor43)
////////////////////////
src44 = request.security(syminfo.tickerid, res, inp[rep ? 0 : barstate.isrealtime ? 1 : 0])[rep ? 0 : barstate.isrealtime ? 0 : 1]
length44 = input.int(title='Length', defval=20, minval=1)
middleBandLength44 = input.int(title='MiddleBandLength', defval=21, minval=1)
bandsDeviation44 = input.float(title='BandsDeviation', defval=2.4, minval=0.1)
lowBandAdjust44 = input.float(title='LowBandAdjust', defval=0.9, minval=0.1)
atrPeriod44 = length44 * 2 - 1
atrBuf44 = ta.atr(atrPeriod44) * bandsDeviation44
ma44 = ta.ema(src44, length44)
upperBand44 = ma44 + ma44 * atrBuf44 / src44
middleBand44 = ta.ema(src44, middleBandLength44)
lowerBand44 = ma44- ma44 * atrBuf44 * lowBandAdjust44 / src44
sig44 = src44 > upperBand44 and nz(src44[1]) <= nz(upperBand44[1]) or src44 > lowerBand44 and nz(src44[1]) <= nz(lowerBand44[1]) or src44 > middleBand44 ? 1 : src44 < lowerBand44 and nz(src44[1]) >= nz(lowerBand44[1]) or src44 < upperBand44 and nz(src44[1]) >= nz(upperBand44[1]) or src44 < middleBand44 ? -1 : 0
svbColor44 = sig44 > 0 ? color.green : sig44 < 0 ? color.red : color.black
//plot(upperBand44, title='SVBUp', color=svbColor44, linewidth=2)
//plot(middleBand44, title='SVBMid', color=color.new(color.black, 0), linewidth=1)
//plot(lowerBand44, title='SVBLow', color=svbColor44, linewidth=2)
//////////////////////
src45 = request.security(syminfo.tickerid, res, inp[rep ? 0 : barstate.isrealtime ? 1 : 0])[rep ? 0 : barstate.isrealtime ? 0 : 1]
length45 = input.int(title='Length', defval=50, minval=2)
mult45 = input.float(title='Mult', defval=10.0, minval=0.01)
alpha45 = 2.0 / (length45 + 1)
mom45 = src45 - nz(src45[1])
up45 = mom45 > 0 ? mom45 : 0
dn45 = mom45 < 0 ? math.abs(mom45) : 0
upMa45 = ta.ema(up45, length45)
dnMa45 = ta.ema(dn45, length45)
rs45 = upMa45 + dnMa45 != 0 ? math.abs(upMa45 - dnMa45) / (upMa45 + dnMa45) : 0
rsEma45 = 0.0
rsEma45 := nz(rsEma45[1]) + (alpha45 * (1 + (rs45 * mult45)) * (src45 - nz(rsEma45[1])))
slo45 = src45 - rsEma45
sig45 = slo45 > 0 ? slo45 > nz(slo45[1]) ? 2 : 1 : slo45 < 0 ? slo45 < nz(slo45[1]) ? -2 : -1 : 0
rsemaColor45 = sig45 > 1 ? color.green : sig45 > 0 ? color.lime : sig45 < -1 ? color.maroon : sig45 < 0 ? color.red : color.black
//plot(rsEma45, title='RSEma', color=rsemaColor45, linewidth=2)
//////////////////////
volSym46 = input.symbol(title='Volatility Symbol', defval='VIX')
src46 = request.security(syminfo.tickerid, res, inp[rep ? 0 : barstate.isrealtime ? 1 : 0])[rep ? 0 : barstate.isrealtime ? 0 : 1]
volSrc46 = request.security(volSym46, res, inp[rep ? 0 : barstate.isrealtime ? 1 : 0])[rep ? 0 : barstate.isrealtime ? 0 : 1]
length46 = input.int(title='Length', defval=10, minval=1)
maLength46 = input.int(title='MaLength', defval=10, minval=1)
mult46 = input.float(title='Mult', defval=10.0, minval=.01)
alpha46 = 2.0 / (length46 + 1)
mom46 = src46 - nz(src46[1])
pv46 = mom46> 0 ? volSrc46 : 0
nv46 = mom46 < 0 ? volSrc46 : 0
pvMa46 = ta.ema(pv46, maLength46)
nvMa46 = ta.ema(nv46, maLength46)
rs46 = pvMa46 + nvMa46 != 0 ? math.abs(pvMa46 - nvMa46) / (pvMa46 + nvMa46) : 0
rsvaEma46 = 0.0
rsvaEma46 := nz(rsvaEma46[1]) + (alpha46 * (1 + (rs46 * mult46)) * (src46 - nz(rsvaEma46[1])))
slo46 = src46 - rsvaEma46
sig46 = slo46 > 0 ? slo46 > nz(slo46[1]) ? 2 : 1 : slo46 < 0 ? slo46 < nz(slo46[1]) ? -2 : -1 : 0
rsvaemaColor46 = sig46 > 1 ? color.green : sig46 > 0 ? color.lime : sig46 < -1 ? color.maroon : sig46 < 0 ? color.red : color.black
//plot(rsvaEma46, title='RSEma', color=rsvaemaColor46, linewidth=2)
/////////////////////////////////
float inp55 = input(title = 'Source', defval = close)
string res55 = input.timeframe(title = 'Resolution', defval = '')
bool rep55 = input(title = 'Allow Repainting?', defval = false)
float src47 = request.security(syminfo.tickerid, res55, inp55[rep55 ? 0 : barstate.isrealtime ? 1 : 0])[rep55 ? 0 : barstate.isrealtime ? 0 : 1]
int length47 = input.int(title = 'Length', defval = 40, minval = 2)
float mult47 = input.float(title = 'Mult', defval = 10.0, minval = 0.01)
float alpha47 = 2.0 / (length47 + 1)
float trL47 = ta.lowest(ta.tr, length47)
float trH47 = ta.highest(ta.tr, length47)
float trAdj47 = trH47 - trL47 != 0 ? (ta.tr - trL47) / (trH47 - trL47) : 0
float trAdjEma47 = 0.0
trAdjEma47 := nz(trAdjEma47[1]) + (alpha47 * (1 + (trAdj47 * mult47)) * (src47 - nz(trAdjEma47[1])))
float slo47 = src47 - trAdjEma47
int sig47 = slo47 > 0 ? slo47 > nz(slo47[1]) ? 2 : 1 : slo47 < 0 ? slo47 < nz(slo47[1]) ? -2 : -1 : 0
color tradjemaColor47 = sig47 > 1 ? color.green : sig47 > 0 ? color.lime : sig47 < -1 ? color.maroon : sig47 < 0 ? color.red : color.black
//plot(trAdjEma47, title = 'TrAdjEma', color = tradjemaColor47, linewidth = 2)
/////////////////////////////////
float src49 = request.security(syminfo.tickerid, res55, inp55[rep55 ? 0 : barstate.isrealtime ? 1 : 0])[rep55 ? 0 : barstate.isrealtime ? 0 : 1]
float tr49 = request.security(syminfo.tickerid, res55, ta.tr[rep55 ? 0 : barstate.isrealtime ? 1 : 0])[rep55 ? 0 : barstate.isrealtime ? 0 : 1]
int length49 = input.int(title = 'Length', defval = 30, minval = 2)
float hhC49 = ta.highest(src49, length49)
float llC49 = ta.lowest(src49, length49)
float result49 = hhC49 - llC49
float effort49 = math.sum(tr49, length49)
float alpha49 = effort49 != 0 ? result49 / effort49 : 0
float nama49 = 0.0
nama49 := (alpha49 * src49) + ((1 - alpha49) * nz(nama49[1]))
float slo49 = src49 - nama49
int sig49 = slo49 > 0 ? slo49 > nz(slo49[1]) ? 2 : 1 : slo49 < 0 ? slo49 < nz(slo49[1]) ? -2 : -1 : 0
color namaColor49 = sig49 > 1 ? color.green : sig49 > 0 ? color.lime : sig49 < -1 ? color.maroon : sig49 < 0 ? color.red : color.black
//plot(nama49, title = 'Nama', color = namaColor49, linewidth = 2)
//////////////////////////////////////
float src50 = request.security(syminfo.tickerid, res55, inp55[rep55 ? 0 : barstate.isrealtime ? 1 : 0])[rep55 ? 0 : barstate.isrealtime ? 0 : 1]
float tr50 = request.security(syminfo.tickerid, res55, ta.tr[rep55 ? 0 : barstate.isrealtime ? 1 : 0])[rep55 ? 0 : barstate.isrealtime ? 0 : 1]
int length50 = input.int(title = 'Length', defval = 30, minval = 2)
float result50 = math.abs(src50 - nz(src50[length50]))
float effort50 = math.sum(tr50, length50)
float alpha50 = effort50 != 0 ? result50 / effort50 : 0
float anama50 = 0.0
anama50 := (alpha50 * src50) + ((1 - alpha50) * nz(anama50[1]))
float slo50 = src50 - anama50
int sig50 = slo50 > 0 ? slo50 > nz(slo50[1]) ? 2 : 1 : slo50 < 0 ? slo50 < nz(slo50[1]) ? -2 : -1 : 0
color anamaColor50 = sig50 > 1 ? color.green : sig50 > 0 ? color.lime : sig50 < -1 ? color.maroon : sig50 < 0 ? color.red : color.black
//plot(anama50, title = 'Anama', color = anamaColor50, linewidth = 2)
/////////////////////////////////////////////////////////
float src51 = request.security(syminfo.ticker, res55, inp55[rep55 ? 0 : barstate.isrealtime ? 1 : 0])[rep55 ? 0 : barstate.isrealtime ? 0 : 1]
int fastLength51 = input.int(title = 'FastLength', defval = 6, minval = 1)
int slowLength51 = input.int(title = 'SlowLength', defval = 12, minval = 1)
int sampleLength51 = input.int(title = 'SampleLength', defval = 5, minval = 1)
hannFilter51(float sampleSrc51, int length51) =>
filt51 = 0.0, coef51 = 0.0
for i = 1 to length51
cosine51 = 1 - math.cos(2 * math.pi * i / (length51 + 1))
filt51 := filt51 + (cosine51 * nz(sampleSrc51[i - 1]))
coef51 := coef51 + cosine51
filt51 := coef51 != 0 ? filt51 / coef51 : 0
float sample51 = 0.0
sample51 := bar_index % sampleLength51 == 0 ? src51 : nz(sample51[1])
float fastAvg51 = hannFilter51(sample51, fastLength51)
float slowAvg51 = hannFilter51(sample51, slowLength51)
float slo51 = fastAvg51 - slowAvg51
int sig51 = slo51 > 0 ? slo51 > nz(slo51[1]) ? 2 : 1 : slo51 < 0 ? slo51 < nz(slo51[1]) ? -2 : -1 : 0
color udsmaColor51 = sig51 > 1 ? color.green : sig51 > 0 ? color.lime : sig51 < -1 ? color.maroon : sig51 < 0 ? color.red : color.black
//plot(fastAvg51, title = "FastAverage", color = udsmaColor51, linewidth = 2)
//plot(slowAvg51, title = "SlowAverage", color = chart.fg_color, linewidth = 1)
//////////////////////////////////
float src52 = request.security(syminfo.tickerid, res55, inp55[rep55 ? 0 : barstate.isrealtime ? 1 : 0])[rep55 ? 0 : barstate.isrealtime ? 0 : 1]
fastLength52 = input.int(title = "FastLength", defval = 14, minval = 1)
slowLength52 = input.int(title = "SlowLength", defval = 30, minval = 1)
leavittProjection52(float src52, int length52) =>
float result52 = ta.linreg(src52, length52, -1)
leavittConvolution52(float src52, int length52) =>
int sqrtLength52 = math.floor(nz(math.sqrt(length52)))
float result52 = ta.linreg(leavittProjection52(src52, length52), sqrtLength52, -1)
float fastConv52 = leavittConvolution52(src52, fastLength52)
float slowConv52 = leavittConvolution52(src52, slowLength52)
float slo52 = fastConv52 - slowConv52
int sig52 = slo52 > 0 ? slo52 > nz(slo52[1]) ? 2 : 1 : slo52 < 0 ? slo52 < nz(slo52[1]) ? -2 : -1 : 0
color lcColor52 = sig52 > 1 ? color.green : sig52 > 0 ? color.lime : sig52 < -1 ? color.maroon : sig52 < 0 ? color.red : color.white
//plot(fastConv52, title = 'FastConv', color = lcColor52, linewidth = 2)
//plot(slowConv52, title = 'SlowConv', color = chart.fg_color, linewidth = 1)
//////////////////////////////////////////////
////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
f_security(_symbol66, _res66, _src66, _repaint66) =>
request.security(_symbol66, _res66, _src66[_repaint66 ? 0 : barstate.isrealtime ? 1 : 0])[_repaint66 ? 0 : barstate.isrealtime ? 0 : 1]
res66 = input.timeframe(title='Resolution', defval='')
rep66 = input(title='Allow Repainting?', defval=false)
length53 = input.int(title='Length', defval=14, minval=1)
factor53 = input.int(title='Factor', defval=2, minval=1)
p53 = f_security(syminfo.tickerid, res66, hl2, rep66)
h53 = f_security(syminfo.tickerid, res66, high, rep66)
l53 = f_security(syminfo.tickerid, res66, low, rep66)
t53 = f_security(syminfo.tickerid, res66, ta.tr, rep66)
mpEma53 = ta.ema(p53, length53)
trEma53 = ta.ema(t53, length53)
stdDev53 = ta.stdev(trEma53, length53)
ad53 = p53 > nz(p53[1]) ? mpEma53 + trEma53 / 2 : p53 < nz(p53[1]) ? mpEma53 - trEma53 / 2 : mpEma53
adm53 = ta.ema(ad53, length53)
trndDn53 = 0.0
trndDn53 := ta.crossunder(adm53, mpEma53) ? h53[2] : p53 < nz(p53[1]) ? p53 + stdDev53 * factor53 : nz(trndDn53[1], h53[2])
trndUp53 = 0.0
trndUp53 := ta.crossover(adm53, mpEma53) ? l53[2] : p53 > nz(p53[1]) ? p53 - stdDev53 * factor53 : nz(trndUp53[1], l53[2])
trndr53 = 0.0
trndr53 := adm53 < mpEma53 ? trndDn53 : adm53 > mpEma53 ? trndUp53 : nz(trndr53[1], 0)
sig53 = p53 > trndr53 ? 1 : p53 < trndr53 ? -1 : 0
trndrColor53 = sig53 > 0 ? color.green : sig53 < 0 ? color.red : color.black
//plot(trndr53, color=trndrColor53, linewidth=2)
//plot(mpEma53, color=color.new(color.blue, 0), linewidth=2)
//plot(adm53, color=color.new(color.black, 0), linewidth=1)
/////////////////////////////////////////
c54 = f_security(syminfo.tickerid, res66, close, rep66)
v54 = f_security(syminfo.tickerid, res66, volume, rep66)
length54 = input.int(title='Length', defval=50, minval=2)
mult54 = input.float(title='Mult', defval=10.0, minval=0.01)
alpha54 = 2.0 / (length54 + 1)
mom54 = c54 - nz(c54[1])
pv54 = mom54 > 0 ? v54 : 0
nv54 = mom54 < 0 ? v54 : 0
pvMa54 = ta.ema(pv54, length54)
nvMa54 = ta.ema(nv54, length54)
vs54 = pvMa54 + nvMa54 != 0 ? math.abs(pvMa54 - nvMa54) / (pvMa54 + nvMa54) : 0
rsvaEma54 = 0.0
rsvaEma54 := nz(rsvaEma54[1]) + (alpha54 * (1 + (vs54 * mult54)) * (c54 - nz(rsvaEma54[1])))
slo54 = c54 - rsvaEma54
sig54 = slo54 > 0 ? slo54 > nz(slo54[1]) ? 2 : 1 : slo54 < 0 ? slo54 < nz(slo54[1]) ? -2 : -1 : 0
rsvaemaColor54 = sig54 > 1 ? color.green : sig54 > 0 ? color.lime : sig54 < -1 ? color.maroon : sig54 < 0 ? color.red : color.black
//plot(rsvaEma54, title='RSEma', color=rsvaemaColor54, linewidth=2)
////////////////////////////////////
length56 = input.int(title='Length', defval=25, minval=1)
h56 = f_security(syminfo.tickerid, res66, high, rep66)
l56 = f_security(syminfo.tickerid, res66, low, rep66)
c56 = f_security(syminfo.tickerid, res66, close, rep66)
hh56 = ta.highest(h56, length56)
ll56 = ta.lowest(l56, length56)
atr56 = ta.atr(length56)
mult56 = math.sqrt(length56)
dSup56 = hh56 - atr56 * mult56
dRes56 = ll56 + atr56 * mult56
dMid56 = (dSup56 + dRes56) / 2
sig56 = c56 > dMid56 ? 1 : c56 < dMid56 ? -1 : 0
dsrColor56 = sig56 > 0 ? color.green : sig56 < 0 ? color.red : color.black
//plot(dSup56, title='Support', color=color.new(color.red, 0), linewidth=2)
//plot(dMid56, title='Middle', color=dsrColor56, linewidth=1)
//plot(dRes56, title='Resistance', color=color.new(color.green, 0), linewidth=2)
///////////////////////////////
length57 = input.int(title='Length', defval=3, minval=1)
h57 = f_security(syminfo.tickerid, res66, high, rep66)
l57 = f_security(syminfo.tickerid, res66, low, rep66)
c57 = f_security(syminfo.tickerid, res66, close, rep66)
highMa57 = ta.sma(h57, length57)
lowMa57 = ta.sma(l57, length57)
ghla57 = 0.0
ghla57 := c57 > nz(highMa57[1]) ? lowMa57 : c57 < nz(lowMa57[1]) ? highMa57 : nz(ghla57[1])
sig57 = c57 > ghla57 ? 1 : c57 < ghla57 ? -1 : 0
ghlaColor57 = sig57 > 0 ? color.green : sig57 < 0 ? color.red : color.black
//plot(ghla57, title='GHLA', color=ghlaColor57, linewidth=2)
//////////////////////////////////
lbLength58 = input.int(title='LookBackLength', defval=21, minval=1)
p58 = f_security(syminfo.tickerid, res66, close, rep66)
h58 = f_security(syminfo.tickerid, res66, high, rep66)
l58 = f_security(syminfo.tickerid, res66, low, rep66)
ll58 = ta.lowest(lbLength58)
hh58 = ta.highest(lbLength58)
hCount58 = 0
lCount58 = 0
cbl58 = p58
for i = 0 to lbLength58 by 1
if l58[i] == ll58
for j58 = i + 1 to i + lbLength58 by 1
lCount58 += (h58[j58] > h58[i] ? 1 : 0)
if lCount58 == 2
cbl58 := h58[j58]
break
if h58[i] == hh58
for j58 = i + 1 to i + lbLength58 by 1
hCount58 += (l58[j58] < l58[i] ? 1 : 0)
if hCount58 == 2
cbl58 := l58[j58]
break
sig58 = p58 > cbl58 ? 1 : p58 < cbl58 ? -1 : 0
cblColor58 = sig58 > 0 ? color.green : sig58 < 0 ? color.red : color.black
//plot(cbl58, color=cblColor58, linewidth=2)
//////////////////////////////
inp59 = input(title='Source', defval=close)
h59 = f_security(syminfo.tickerid, res66, high, rep66)
l59 = f_security(syminfo.tickerid, res66, low, rep66)
c59 = f_security(syminfo.tickerid, res66, inp59, rep66)
length59 = input.int(title='Length', defval=14, minval=1)
mHigh59 = ta.linreg(h59, length59, 0) - ta.linreg(h59, length59, 1)
mLow59 = ta.linreg(l59, length59, 0) - ta.linreg(l59, length59, 1)
upperBand59 = h59, lowerBand59 = l59
for i = 0 to length59 - 1
currH59 = nz(h59[i])
prevH59 = nz(h59[i - 1])
currL59 = nz(l59[i])
prevL59 = nz(l59[i - 1])
vHigh59 = currH59 + (nz(mHigh59[i]) * i)
vLow59 = currL59 + (nz(mLow59[i]) * i)
upperBand59 := math.max(vHigh59, upperBand59)
lowerBand59 := math.min(vLow59, lowerBand59)
middleBand59 = (upperBand59 + 59) / 2
slo59 = c59 - middleBand59
sig59 = (c59 > upperBand59 and nz(c59[1]) <= nz(upperBand59[1])) or (c59 > lowerBand59 and nz(c59[1]) <= nz(lowerBand59[1]))
? 1 : (c59 < lowerBand59 and nz(c59[1]) >= nz(lowerBand59[1])) or (c59 < upperBand59 and nz(c59[1]) >= nz(upperBand59[1]))
? -1 : slo59 > 0 ? slo59 > nz(slo59[1]) ? 2 : 1 : slo59 < 0 ? slo59 < nz(slo59[1]) ? -2 : -1 : 0
pbColor59 = sig59 > 1 ? color.green : sig59 > 0 ? color.lime : sig59 < -1 ? color.maroon : sig59 < 0 ? color.red : color.black
//plot(upperBand59, title="UpperBand", linewidth=2, color=pbColor59)
//plot(middleBand59, title="MiddleBand", linewidth=1, color=color.white)
//plot(lowerBand59, title="LowerBand", linewidth=2, color=pbColor59)
///////////////////////////////////
length61 = input.int(title='Length', defval=25, minval=1)
h61 = f_security(syminfo.tickerid, res66, high, rep66)
l61 = f_security(syminfo.tickerid, res66, low, rep66)
c61 = f_security(syminfo.tickerid, res66, close, rep66)
hh61 = ta.highest(h61, length61)
ll61 = ta.lowest(l61, length61)
range_161 = hh61 - ll61
sup161 = ll61 - 0.25 * range_161
sup261 = ll61 - 0.5 * range_161
res161 = hh61 + 0.25 * range_161
res261 = hh61 + 0.5 * range_161
mid61 = (sup161 + sup261 + res161 + res261) / 4
sig61 = c61 > mid61 ? 1 : c61 < mid61 ? -1 : 0
psrColor61 = sig61 > 0 ? color.green : sig61 < 0 ? color.red : color.black
//plot(sup161, title='Support1', color=color.new(color.red, 0), linewidth=2)
//plot(sup261, title='Support2', color=color.new(color.red, 0), linewidth=2)
//plot(mid61, title='Middle', color=psrColor61, linewidth=1)
//plot(res161, title='Resistance1', color=color.new(color.green, 0), linewidth=2)
//plot(res261, title='Resistance2', color=color.new(color.green, 0), linewidth=2)
///////////////////////////////////////////////////////////
-
zaman kalıbı....
1dakkadan gün periyoduna seçtiğiniz veriyi.....
kendi periyoduna sabitleyip...
hepsinin ortalamasını 15dakkalık periyotla ilişkilendirip....
periyotların birbiri ile ilişkisini görme....
istemediğiniz periyotları iptal ederseniz.....
denemek isteyene örnek kodu...
PHP Code:
//@version=5
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © carefulCode53358
indicator('*', overlay=true)
//resolution
x1 = input.timeframe('1', title='Resolution')
x3 = input.timeframe('3', title='Resolution')
x5 = input.timeframe('5', title='Resolution')
x15 = input.timeframe('15', title='Resolution')
x30 = input.timeframe('30', title='Resolution')
x45 = input.timeframe('45', title='Resolution')
x60 = input.timeframe('60', title='Resolution')
x120 = input.timeframe('120', title='Resolution')
x180 = input.timeframe('180', title='Resolution')
x240 = input.timeframe('240', title='Resolution')
x720 = input.timeframe('D', title='Resolution')
//output functions
z = ta.sar(0, 0.01, 1)
// Security
y1 = request.security(syminfo.tickerid, x1, z)
y3 = request.security(syminfo.tickerid, x3, z)
y5 = request.security(syminfo.tickerid, x5, z)
y15 = request.security(syminfo.tickerid, x15, z)
y30 = request.security(syminfo.tickerid, x30, z)
y45 = request.security(syminfo.tickerid, x45, z)
y60 = request.security(syminfo.tickerid, x60, z)
y120 = request.security(syminfo.tickerid, x120, z)
y180 = request.security(syminfo.tickerid, x180, z)
y240 = request.security(syminfo.tickerid, x240, z)
y720 = request.security(syminfo.tickerid, x720, z)
//Plots
xz = input(true, title='Adaptive Coloring')
plot(y1, title='1', style=plot.style_circles, color=xz ? y1 > close ? color.red : color.lime : color.silver, linewidth=1)
plot(y3, title='3', style=plot.style_circles, color=xz ? y3 > close ? color.red : color.lime : color.silver, linewidth=1)
plot(y5, title='5', style=plot.style_circles, color=xz ? y5 > close ? color.red : color.lime : color.silver, linewidth=1)
plot(y15, title='15', style=plot.style_circles, color=xz ? y15 > close ? color.red : color.lime : color.silver, linewidth=1)
plot(y30, title='30', style=plot.style_circles, color=xz ? y30 > close ? color.red : color.lime : color.silver, linewidth=1)
plot(y45, title='45', style=plot.style_circles, color=xz ? y45 > close ? color.red : color.lime : color.silver, linewidth=1)
plot(y60, title='60', style=plot.style_circles, color=xz ? y60 > close ? color.red : color.lime : color.silver, linewidth=1)
plot(y120, title='120', style=plot.style_circles, color=xz ? y120 > close ? color.red : color.lime : color.silver, linewidth=1)
plot(y180, title='180', style=plot.style_circles, color=xz ? y180 > close ? color.red : color.lime : color.silver, linewidth=1)
plot(y240, title='240', style=plot.style_circles, color=xz ? y240 > close ? color.red : color.lime : color.silver, linewidth=1)
plot(y720, title='720', style=plot.style_circles, color=xz ? y720 > close ? color.red : color.lime : color.silver, linewidth=1)
//Signal
xyzq = (y1 + y3 + y5 + y15 + y30 + y45 + y60 + y120 + y180 + y240 + y720) / 11
plot(xyzq, title='Ortalama', style=plot.style_linebr, color=xz ? y15 > close ? color.red : color.lime : color.silver, linewidth=2)
not içinde veri olarak sar kullanılmıştır...siz dilediğinizle değiştirin....
-
zaman kalıbı ilişkilendirme....
bir sar hesaplaması ile trend döngüsü.....
iki sar hesaplaması ile iki sarı döngüleme....
üç sar ile trende minor yaklaşım...
ve
1 dakkadan yıla kadar olan periyotlara....veri okutma....
okutulan verinin....3 farklı döngüde.....
1dakkadan haftalığa ilişkilendiren.....
sistem tasarımı....
denemek isteyene kodu....
PHP Code:
//@version=5
indicator(".", overlay = true)
ehad = input(true, title='Renklendirme')
/////sistemim
//Trend Sar
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.02)
maximum1 = input(0.06)
[p1, AF1, EP1, isUpTrend1] = psar(start1, increment1, maximum1)
newEP1 = EP1 != EP1[1]
epNew1 = newEP1 ? EP1 : na
plot(p1, 'Continue-SAR', style=plot.style_stepline, color=isUpTrend1 ? color.rgb(25, 248, 5, 100) : color.rgb(243, 5, 5, 100), linewidth=1)
plot(EP1, 'Continue', style=plot.style_circles, color=isUpTrend1 ? color.rgb(25, 248, 5, 100) : color.rgb(243, 5, 5, 100), linewidth=2)
//plot(epNew1, 'Trend-Continue', style=plot.style_line, color=isUpTrend1 ? color.rgb(76, 175, 79, 00) : color.rgb(255, 82, 82, 00), linewidth=1)
//@version=5
lenxc = input(1)
lenxc50 = input(1)
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)))
////
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.2
maximumsx = 0.6
ssx = ta.sar(startsx, incrementsx, maximumsx)
s1sx = z(ssx, lenxc)
pcsx = close < s1sx ? color.rgb(255, 82, 82, 100) : color.rgb(76, 175, 79, 100)
plot(s1sx, title="Döngü:1-0",style=plot.style_cross, color=pcsx, linewidth=1)
startsx50 = 0
incrementsx50 = 0.1
maximumsx50 = 0.1
ssx50 = ta.sar(startsx50, incrementsx50, maximumsx50)
s1sx50 = z50(ssx50, lenxc50)
pcsx50 = close < s1sx50 ? color.rgb(255, 82, 82, 100) : color.rgb(76, 175, 79, 100)
plot(s1sx50, title="Döngü:0-1",style=plot.style_cross, color=pcsx50, linewidth=1)
//Signal
bcolor = ta.crossunder(close,s1sx) ? color.red : ta.crossover(close,s1sx50) ? color.green: close>s1sx50 ? color.green : close<s1sx ? color.red: color.rgb(216, 4, 253) // : color.black
barcolor(bcolor)
/////veri...
//Functions Sar for support and resistance
q3 = ta.sar(0.01, 0.01, 0.1)
q2 = ta.sar(0.01, 0.03, 0.3)
q1 = ta.sar(0.01, 0.05, 0.5)
//verileri okutma....
fatiha = q3
kadir = q2
velasr = q1
/////zaman kalıbı
//İnned dîne indâllâhil İslâm...Ali-İmran 19.ayet
bakara = input.timeframe('1', title='Periyot')
aliimran = input.timeframe('3', title='Periyot')
nisa = input.timeframe('5', title='Periyot')
maide = input.timeframe('15', title='Periyot')
enam = input.timeframe('30', title='Periyot')
araf = input.timeframe('45', title='Periyot')
enfal = input.timeframe('60', title='Periyot')
tevbe = input.timeframe('120', title='Periyot')
yunus = input.timeframe('180', title='Periyot')
hud = input.timeframe('240', title='Periyot')
yusuf = input.timeframe('D', title='Periyot')
rad = input.timeframe('W', title='Periyot')
ibrahim = input.timeframe('M', title='Periyot')
hicr = input.timeframe('3M', title='Periyot')
nahl = input.timeframe('12M', title='Periyot')
//output functions
// Security 1veriyi zamanda döndürme....
isra = request.security(syminfo.tickerid, bakara, fatiha)
kehf = request.security(syminfo.tickerid, aliimran, fatiha)
meryem = request.security(syminfo.tickerid, nisa, fatiha)
taha = request.security(syminfo.tickerid, maide, fatiha)
enbiya = request.security(syminfo.tickerid, enam, fatiha)
hac = request.security(syminfo.tickerid, araf, fatiha)
muminun = request.security(syminfo.tickerid, enfal, fatiha)
nur = request.security(syminfo.tickerid, tevbe, fatiha)
furkan = request.security(syminfo.tickerid, yunus, fatiha)
suara = request.security(syminfo.tickerid, hud, fatiha)
neml = request.security(syminfo.tickerid, yusuf, fatiha)
kasas = request.security(syminfo.tickerid, rad, fatiha)
ankebut = request.security(syminfo.tickerid, ibrahim, fatiha)
rum = request.security(syminfo.tickerid, hicr, fatiha)
lokman = request.security(syminfo.tickerid, nahl, fatiha)
//Signal...1veri sinyalleri hesapla ve çizdir
tegabun = (isra )
plot(tegabun, title='1-', style=plot.style_stepline, color=ehad ? isra > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
talak = (isra + kehf + meryem ) / 3
//plot(talak, title='1.Veri-5DakikayaDöngü', style=plot.style_stepline, color=ehad ? isra > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
tahrim = (isra + kehf + meryem + taha ) / 4
//plot(tahrim, title='1.Veri-15DakikayaDöngü', style=plot.style_stepline, color=ehad ? isra > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
mulk = (isra + kehf + meryem + taha + enbiya + hac + muminun ) / 7
plot(mulk, title='1-', style=plot.style_stepline, color=ehad ? isra > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
kalem = (isra + kehf + meryem + taha + enbiya + hac + muminun+nur+furkan+suara+neml ) / 11
plot(kalem, title='1-', style=plot.style_stepline, color=ehad ? isra > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
hakka = (isra + kehf + meryem + taha+enbiya+hac+muminun+nur+furkan+suara+neml+kasas ) / 12
plot(hakka, title='1-', style=plot.style_stepline, color=ehad ? isra > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
mearic = (isra + kehf + meryem + taha+enbiya+hac+muminun+nur+furkan+suara+neml+kasas+ankebut ) / 13
//plot(mearic, title='1.Veri-AyaDöngü', style=plot.style_stepline, color=ehad ? isra > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
nuh = (isra + kehf + meryem + taha+enbiya+hac+muminun+nur+furkan+suara+neml+kasas+ankebut+rum ) / 14
//plot(nuh, title='1.Veri-ÜçAyaDöngü', style=plot.style_stepline, color=ehad ? isra > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
cin = (isra + kehf + meryem + taha+enbiya+hac+muminun+nur+furkan+suara+neml+kasas+ankebut+rum +lokman ) / 15
//plot(cin, title='1.Veri-YılaDöngü', style=plot.style_stepline, color=ehad ? isra > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
// Security2.veriyi zamanda döndürme
secde = request.security(syminfo.tickerid, bakara, kadir)
ahzab = request.security(syminfo.tickerid, aliimran, kadir)
sebe = request.security(syminfo.tickerid, nisa, kadir)
fatir = request.security(syminfo.tickerid, maide, kadir)
yasin = request.security(syminfo.tickerid, enam, kadir)
saffat = request.security(syminfo.tickerid, araf, kadir)
sad = request.security(syminfo.tickerid, enfal, kadir)
zumer = request.security(syminfo.tickerid, tevbe, kadir)
mumin = request.security(syminfo.tickerid, yunus, kadir)
fussilet = request.security(syminfo.tickerid, hud, kadir)
sura = request.security(syminfo.tickerid, yusuf, kadir)
zuhruf = request.security(syminfo.tickerid, rad, kadir)
duhan = request.security(syminfo.tickerid, ibrahim, kadir)
casiye = request.security(syminfo.tickerid, hicr, kadir)
ahkaf = request.security(syminfo.tickerid, nahl, kadir)
///2veri
muzzemmil = (secde )
plot(muzzemmil, title='2-', style=plot.style_stepline, color=ehad ? secde > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
muddesir = (secde+ahzab+sebe ) / 3
//plot(muddesir, title='2.Veri-5DakikayaDöngü', style=plot.style_stepline, color=ehad ? isra > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
kiyamet = (secde+ahzab+sebe+fatir ) / 4
//plot(kiyamet, title='2.Veri-15DakikayaDöngü', style=plot.style_stepline, color=ehad ? isra > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
insan = (secde+ahzab+sebe+fatir+yasin+saffat+sad ) / 7
plot(insan, title='2-', style=plot.style_stepline, color=ehad ? isra > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
murselat = (secde+ahzab+sebe+fatir+yasin+saffat+sad+zumer+mumin+fussilet+sura ) / 11
plot(murselat, title='2-', style=plot.style_stepline, color=ehad ? isra > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
nebe = (secde+ahzab+sebe+fatir+yasin+saffat+sad+zumer+mumin+fussilet+sura+zuhruf ) / 12
plot(nebe, title='2-', style=plot.style_stepline, color=ehad ? isra > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
naziat = (secde+ahzab+sebe+fatir+yasin+saffat+sad+zumer+mumin+fussilet+sura+zuhruf+duhan ) / 13
//plot(naziat, title='2.Veri-AyaDöngü', style=plot.style_stepline, color=ehad ? isra > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
abese = (secde+ahzab+sebe+fatir+yasin+saffat+sad+zumer+mumin+fussilet+sura+zuhruf+duhan+casiye ) / 14
//plot(abese, title='2.Veri-ÜçAyaDöngü', style=plot.style_stepline, color=ehad ? isra > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
tekvir = (secde+ahzab+sebe+fatir+yasin+saffat+sad+zumer+mumin+fussilet+sura+zuhruf+duhan+casiye+ahkaf ) / 15
//plot(tekvir, title='2.Veri-YılaDöngü', style=plot.style_stepline, color=ehad ? isra > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
// Security3.veriyi zamanda döndürme...
fetih = request.security(syminfo.tickerid, bakara, velasr)
hucurat = request.security(syminfo.tickerid, aliimran, velasr)
kaf = request.security(syminfo.tickerid, nisa, velasr)
zariyat = request.security(syminfo.tickerid, maide, velasr)
tur = request.security(syminfo.tickerid, enam, velasr)
necm = request.security(syminfo.tickerid, araf, velasr)
kamer = request.security(syminfo.tickerid, enfal, velasr)
vakia = request.security(syminfo.tickerid, tevbe, velasr)
hadid = request.security(syminfo.tickerid, yunus, velasr)
mucadele = request.security(syminfo.tickerid, hud, velasr)
hasr = request.security(syminfo.tickerid, yusuf, velasr)
mumtehine = request.security(syminfo.tickerid, rad, velasr)
saf = request.security(syminfo.tickerid, ibrahim, velasr)
cuma = request.security(syminfo.tickerid, hicr, velasr)
munafik = request.security(syminfo.tickerid, nahl, velasr)
/////3.veri...
infitar = (fetih )
plot(infitar, title='3-', style=plot.style_stepline, color=ehad ? fetih > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
mutaffifin = (fetih+hucurat+kaf ) /3
//plot(mutaffifin, title='3.Veri-5DakikayaDöngü', style=plot.style_stepline, color=ehad ? fetih > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
insikak = (fetih+hucurat+kaf+zariyat ) /4
//plot(insikak, title='3.Veri-15DakikayaDöngü', style=plot.style_stepline, color=ehad ? fetih > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
buruc = (fetih+hucurat+kaf+zariyat+tur+necm+kamer ) /7
plot(buruc, title='3-', style=plot.style_stepline, color=ehad ? fetih > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
tarik = (fetih+hucurat+kaf+zariyat+tur+necm+kamer+vakia+hadid+mucadele+hasr ) /11
plot(tarik, title='3-', style=plot.style_stepline, color=ehad ? fetih > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
ala = (fetih+hucurat+kaf+zariyat+tur+necm+kamer+vakia+hadid+mucadele+hasr+mumtehine ) /12
plot(ala, title='3-', style=plot.style_stepline, color=ehad ? fetih > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
gasiye = (fetih+hucurat+kaf+zariyat+tur+necm+kamer+vakia+hadid+mucadele+hasr+mumtehine+saf ) /13
//plot(gasiye, title='3.Veri-AyaDöngü', style=plot.style_stepline, color=ehad ? fetih > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
fecr = (fetih+hucurat+kaf+zariyat+tur+necm+kamer+vakia+hadid+mucadele+hasr+mumtehine+saf+cuma) /14
//plot(fecr, title='3.Veri-ÜçayaDöngü', style=plot.style_stepline, color=ehad ? fetih > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
beled = (fetih+hucurat+kaf+zariyat+tur+necm+kamer+vakia+hadid+mucadele+hasr+mumtehine+saf+cuma+munafik ) /15
//plot(beled, title='3.Veri-YılaDöngü', style=plot.style_stepline, color=ehad ? fetih > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
/////////////////
plot(q3, title='UV-Sar', style=plot.style_circles, color=ehad ? isra > close ? color.rgb(2, 250, 238) : color.rgb(250, 225, 3) : color.silver, linewidth=1)
plot(q2, title='OV-Sar', style=plot.style_circles, color=ehad ? isra > close ? color.rgb(2, 250, 238) : color.rgb(250, 225, 3) : color.silver, linewidth=1)
plot(q1, title='KV-Sar', style=plot.style_circles, color=ehad ? isra > close ? color.rgb(2, 250, 238) : color.rgb(250, 225, 3) : color.silver, linewidth=1)
//Signal
-
döngüsellik kalıbı...
3 veriyi alma....(3 sar verisi kullanıldı)....
3 veriyi....1dakkadan yıla kadar hesaplatma....
bunların....1-5-15 dakkasını gösterme....
5-15-60 döngüsellik ilişkilendirme.....
ve 1dakkalık ile kıyaslanması....
denemek isteyene örnek kodu....
istediğiniz değişiklikleri yapabilirsiniz....
kendi döngüselliğinizi ayarlamış olursunuz.....
PHP Code:
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © carefulCode53358
//@version=5
indicator(".", overlay = true)
ehad = input(true, title='Renklendirme')
/////verisi kullanılacak sistemler...indikatörler.....
xc1=ta.sar(0,0.1, 0.1)
xc2=ta.sar(0,0.001, 0.1)
xc3=ta.sar(0,0.0001, 0.1)
//hesaplanan veriyi zaman döngüsüne aktarma.....
fatiha = xc1
kadir = xc2
velasr = xc3
/////tüm zaman döngülerinin tanımı.....
//İnned dîne indâllâhil İslâm...Ali-İmran 19.ayet
bakara = input.timeframe('1', title='Periyot')
aliimran = input.timeframe('3', title='Periyot')
nisa = input.timeframe('5', title='Periyot')
maide = input.timeframe('15', title='Periyot')
enam = input.timeframe('30', title='Periyot')
araf = input.timeframe('45', title='Periyot')
enfal = input.timeframe('60', title='Periyot')
tevbe = input.timeframe('120', title='Periyot')
yunus = input.timeframe('180', title='Periyot')
hud = input.timeframe('240', title='Periyot')
yusuf = input.timeframe('D', title='Periyot')
rad = input.timeframe('W', title='Periyot')
ibrahim = input.timeframe('M', title='Periyot')
hicr = input.timeframe('3M', title='Periyot')
nahl = input.timeframe('12M', title='Periyot')
// Security 1 veriyi zaman döngüsünde hesaplatma...
isra = request.security(syminfo.tickerid, bakara, fatiha)
kehf = request.security(syminfo.tickerid, aliimran, fatiha)
meryem = request.security(syminfo.tickerid, nisa, fatiha)
taha = request.security(syminfo.tickerid, maide, fatiha)
enbiya = request.security(syminfo.tickerid, enam, fatiha)
hac = request.security(syminfo.tickerid, araf, fatiha)
muminun = request.security(syminfo.tickerid, enfal, fatiha)
nur = request.security(syminfo.tickerid, tevbe, fatiha)
furkan = request.security(syminfo.tickerid, yunus, fatiha)
suara = request.security(syminfo.tickerid, hud, fatiha)
neml = request.security(syminfo.tickerid, yusuf, fatiha)
kasas = request.security(syminfo.tickerid, rad, fatiha)
ankebut = request.security(syminfo.tickerid, ibrahim, fatiha)
rum = request.security(syminfo.tickerid, hicr, fatiha)
lokman = request.security(syminfo.tickerid, nahl, fatiha)
//Signal...1veri zaman döngüsü sinyalleri hesapla ve çizdir
//tegabun = (isra )
//plot(tegabun, title='1anlık', style=plot.style_stepline, color=ehad ? isra > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
//talak = (isra + kehf + meryem ) / 3
//plot(talak, title='5', style=plot.style_stepline, color=ehad ? isra > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
//tahrim = (isra + kehf + meryem + taha ) / 4
//plot(tahrim, title='15', style=plot.style_stepline, color=ehad ? isra > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
//mulk = (isra + kehf + meryem + taha + enbiya + hac + muminun ) / 7
//plot(mulk, title='60', style=plot.style_stepline, color=ehad ? isra > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
//kalem = (isra + kehf + meryem + taha + enbiya + hac + muminun+nur+furkan+suara+neml ) / 11
//plot(kalem, title='Gün', style=plot.style_stepline, color=ehad ? isra > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
//hakka = (isra + kehf + meryem + taha+enbiya+hac+muminun+nur+furkan+suara+neml+kasas ) / 12
//plot(hakka, title='Hafta', style=plot.style_stepline, color=ehad ? isra > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
//mearic = (isra + kehf + meryem + taha+enbiya+hac+muminun+nur+furkan+suara+neml+kasas+ankebut ) / 13
//plot(mearic, title='Ay', style=plot.style_stepline, color=ehad ? isra > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
//nuh = (isra + kehf + meryem + taha+enbiya+hac+muminun+nur+furkan+suara+neml+kasas+ankebut+rum ) / 14
//plot(nuh, title='ÜçAy', style=plot.style_stepline, color=ehad ? isra > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
//cin = (isra + kehf + meryem + taha+enbiya+hac+muminun+nur+furkan+suara+neml+kasas+ankebut+rum +lokman ) / 15
//plot(cin, title='Yıl', style=plot.style_stepline, color=ehad ? isra > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
// 2.veriyi zamanda döndürme
secde = request.security(syminfo.tickerid, bakara, kadir)
ahzab = request.security(syminfo.tickerid, aliimran, kadir)
sebe = request.security(syminfo.tickerid, nisa, kadir)
fatir = request.security(syminfo.tickerid, maide, kadir)
yasin = request.security(syminfo.tickerid, enam, kadir)
saffat = request.security(syminfo.tickerid, araf, kadir)
sad = request.security(syminfo.tickerid, enfal, kadir)
zumer = request.security(syminfo.tickerid, tevbe, kadir)
mumin = request.security(syminfo.tickerid, yunus, kadir)
fussilet = request.security(syminfo.tickerid, hud, kadir)
sura = request.security(syminfo.tickerid, yusuf, kadir)
zuhruf = request.security(syminfo.tickerid, rad, kadir)
duhan = request.security(syminfo.tickerid, ibrahim, kadir)
casiye = request.security(syminfo.tickerid, hicr, kadir)
ahkaf = request.security(syminfo.tickerid, nahl, kadir)
///2veri
//muzzemmil = (secde )
//plot(muzzemmil, title='2-Anlık', style=plot.style_stepline, color=ehad ? secde > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
//muddesir = (secde+ahzab+sebe ) / 3
//plot(muddesir, title='2.Veri-5DakikayaDöngü', style=plot.style_stepline, color=ehad ? isra > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
//kiyamet = (secde+ahzab+sebe+fatir ) / 4
//plot(kiyamet, title='2.Veri-15DakikayaDöngü', style=plot.style_stepline, color=ehad ? isra > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
//insan = (secde+ahzab+sebe+fatir+yasin+saffat+sad ) / 7
//plot(insan, title='2-Saatlik', style=plot.style_stepline, color=ehad ? isra > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
//murselat = (secde+ahzab+sebe+fatir+yasin+saffat+sad+zumer+mumin+fussilet+sura ) / 11
//plot(murselat, title='2-Günlük', style=plot.style_stepline, color=ehad ? isra > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
//nebe = (secde+ahzab+sebe+fatir+yasin+saffat+sad+zumer+mumin+fussilet+sura+zuhruf ) / 12
//plot(nebe, title='2-Haftalık', style=plot.style_stepline, color=ehad ? isra > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
//naziat = (secde+ahzab+sebe+fatir+yasin+saffat+sad+zumer+mumin+fussilet+sura+zuhruf+duhan ) / 13
//plot(naziat, title='2-Aylık', style=plot.style_stepline, color=ehad ? isra > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
//abese = (secde+ahzab+sebe+fatir+yasin+saffat+sad+zumer+mumin+fussilet+sura+zuhruf+duhan+casiye ) / 14
//plot(abese, title='2.Veri-ÜçAyaDöngü', style=plot.style_stepline, color=ehad ? isra > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
//tekvir = (secde+ahzab+sebe+fatir+yasin+saffat+sad+zumer+mumin+fussilet+sura+zuhruf+duhan+casiye+ahkaf ) / 15
//plot(tekvir, title='2.Veri-YılaDöngü', style=plot.style_stepline, color=ehad ? isra > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
// Security3.veriyi zamanda döndürme...
fetih = request.security(syminfo.tickerid, bakara, velasr)
hucurat = request.security(syminfo.tickerid, aliimran, velasr)
kaf = request.security(syminfo.tickerid, nisa, velasr)
zariyat = request.security(syminfo.tickerid, maide, velasr)
tur = request.security(syminfo.tickerid, enam, velasr)
necm = request.security(syminfo.tickerid, araf, velasr)
kamer = request.security(syminfo.tickerid, enfal, velasr)
vakia = request.security(syminfo.tickerid, tevbe, velasr)
hadid = request.security(syminfo.tickerid, yunus, velasr)
mucadele = request.security(syminfo.tickerid, hud, velasr)
hasr = request.security(syminfo.tickerid, yusuf, velasr)
mumtehine = request.security(syminfo.tickerid, rad, velasr)
saf = request.security(syminfo.tickerid, ibrahim, velasr)
cuma = request.security(syminfo.tickerid, hicr, velasr)
munafik = request.security(syminfo.tickerid, nahl, velasr)
/////3.veri...bilgiler...
//infitar = (fetih )
//plot(infitar, title='3-Anlık', style=plot.style_stepline, color=ehad ? fetih > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
//mutaffifin = (fetih+hucurat+kaf ) /3
//plot(mutaffifin, title='3.Veri-5DakikayaDöngü', style=plot.style_stepline, color=ehad ? fetih > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
//insikak = (fetih+hucurat+kaf+zariyat ) /4
//plot(insikak, title='3.Veri-15DakikayaDöngü', style=plot.style_stepline, color=ehad ? fetih > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
//buruc = (fetih+hucurat+kaf+zariyat+tur+necm+kamer ) /7
//plot(buruc, title='3-Saatlik', style=plot.style_stepline, color=ehad ? fetih > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
//tarik = (fetih+hucurat+kaf+zariyat+tur+necm+kamer+vakia+hadid+mucadele+hasr ) /11
//plot(tarik, title='3-Günlük', style=plot.style_stepline, color=ehad ? fetih > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
//ala = (fetih+hucurat+kaf+zariyat+tur+necm+kamer+vakia+hadid+mucadele+hasr+mumtehine ) /12
//plot(ala, title='3-Haftalık', style=plot.style_stepline, color=ehad ? fetih > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
//gasiye = (fetih+hucurat+kaf+zariyat+tur+necm+kamer+vakia+hadid+mucadele+hasr+mumtehine+saf ) /13
//plot(gasiye, title='3-Aylık', style=plot.style_stepline, color=ehad ? fetih > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
//fecr = (fetih+hucurat+kaf+zariyat+tur+necm+kamer+vakia+hadid+mucadele+hasr+mumtehine+saf+cuma) /14
//plot(fecr, title='3.Veri-ÜçayaDöngü', style=plot.style_stepline, color=ehad ? fetih > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
//beled = (fetih+hucurat+kaf+zariyat+tur+necm+kamer+vakia+hadid+mucadele+hasr+mumtehine+saf+cuma+munafik ) /15
//plot(beled, title='3.Veri-YılaDöngü', style=plot.style_stepline, color=ehad ? fetih > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
/////////////////
sems = (isra+secde+fetih ) /3
plot(sems, title='1', style=plot.style_stepline, color=ehad ? sems > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
leyl = (kehf+ahzab+hucurat ) /3
//plot(leyl, title='3', style=plot.style_stepline, color=ehad ? leyl > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
duha = (meryem+sebe+kaf ) /3
plot(duha, title='5', style=plot.style_stepline, color=ehad ? duha > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
insirah = (taha+fatir+zariyat ) /3
plot(insirah, title='15', style=plot.style_stepline, color=ehad ? insirah > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
tin = (enbiya+yasin+tur ) /3
//plot(tin, title='30', style=plot.style_stepline, color=ehad ? tin > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
alak = (hac+saffat+necm ) /3
//plot(alak, title='45', style=plot.style_stepline, color=ehad ? alak > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
beyyine = (muminun+sad+kamer ) /3
//plot(beyyine, title='60', style=plot.style_stepline, color=ehad ? beyyine > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
zilzal = (nur+zumer+vakia ) /3
//plot(zilzal, title='120', style=plot.style_stepline, color=ehad ? zilzal > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
adiyat = (furkan+mumin+hadid ) /3
//plot(adiyat, title='180', style=plot.style_stepline, color=ehad ? adiyat > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
karia = (suara+fussilet+mucadele ) /3
//plot(karia, title='240', style=plot.style_stepline, color=ehad ? karia > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
tekasur = (neml+sura+hasr ) /3
//plot(tekasur, title='Gün', style=plot.style_stepline, color=ehad ? tekasur > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
humeze = (kasas+zuhruf+mumtehine ) /3
//plot(humeze, title='Hafta', style=plot.style_stepline, color=ehad ? humeze > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
fil = (ankebut+duhan+saf ) /3
//plot(fil, title='Ay', style=plot.style_stepline, color=ehad ? fil > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
//kureys = (rum+casiye+cuma ) /3
//plot(kureys, title='3Ay', style=plot.style_stepline, color=ehad ? kureys > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
//maun = (lokman+ahkaf+munafik ) /3
//plot(maun, title='12Ay', style=plot.style_stepline, color=ehad ? maun > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
kevser = (sems+leyl+duha ) /3
plot(kevser, title='5Döngü', style=plot.style_stepline, color=ehad ? kevser > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
kafirun = (sems+leyl+duha+insirah ) /4
plot(kafirun, title='15Döngü', style=plot.style_stepline, color=ehad ? kafirun > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
nasr = (sems+leyl+duha+insirah+tin+alak+beyyine ) /7
plot(nasr, title='60Döngü', style=plot.style_stepline, color=ehad ? nasr > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
tebbet = (sems+leyl+duha+insirah+tin+alak+beyyine+zilzal+adiyat+karia+tekasur ) /11
//plot(tebbet, title='GünDöngü', style=plot.style_stepline, color=ehad ? tebbet > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
//ihlas = (sems+leyl+duha+insirah+tin+alak+beyyine+zilzal+adiyat+karia+tekasur+humeze ) /12
//plot(ihlas, title='HaftaDöngü', style=plot.style_stepline, color=ehad ? ihlas > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
//felak = (sems+leyl+duha+insirah+tin+alak+beyyine+zilzal+adiyat+karia+tekasur+humeze+fil ) /13
//plot(felak, title='AyDöngü', style=plot.style_stepline, color=ehad ? felak > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
//nas = (sems+leyl+duha+insirah+tin+alak+beyyine+zilzal+adiyat+karia+tekasur+humeze+fil+kureys ) /14
//plot(nas, title='3AyDöngü', style=plot.style_stepline, color=ehad ? nas > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
//@version=5
fatiha1 = input.timeframe('1', title='Periyot')
ehad1 = input(true, title='Renklendirme')
/////anakalıp .....buraya dokunma....
//veri oluştur...
//veri oluştur...
//veri alma...
bakara1 = ta.sar(0, 0.01, 1)
//aliimran=(twapValue)
//nisa=(outa)
//maide=(smoothingLine2a)
// Security
kuran1 = request.security(syminfo.tickerid, fatiha1, bakara1)
//kuran2 = request.security(syminfo.tickerid, fatiha, aliimran)
//kuran3 = request.security(syminfo.tickerid, fatiha, nisa)
//kuran4 = request.security(syminfo.tickerid, fatiha, maide)
//Plots
//plot(kuran1, title='sar', style=plot.style_circles, color=ehad ? kuran1 > close ? color.red : color.lime : color.silver, linewidth=1)
//plot(kuran2, title='twap', style=plot.style_circles, color=ehad ? kuran2 > close ? color.red : color.lime : color.silver, linewidth=1)
//Signal
vallahualem=(kuran1)
plot(vallahualem, title='vallahualem', style=plot.style_stepline, color=ehad1 ? vallahualem > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.rgb(178, 181, 190, 100), linewidth=1)
//
//END
bcolor = ta.crossunder(close,vallahualem) ? color.red : ta.crossover(close,vallahualem) ? color.green: close>vallahualem ? color.green : close<vallahualem ? color.red: color.rgb(216, 4, 253) // : color.black
barcolor(bcolor)
//@version=5
//resolution
x1 = input.timeframe('1', title='Resolution')
//output functions
z = ta.sar(0, 0.1, 1)
// Security
y1 = request.security(syminfo.tickerid, x1, z)
//Plots
xz = input(true, title='Adaptive Coloring')
//Functions Sar for support and resistance
q3 = ta.sar(0.001, 0.01, 0.1)
q2 = ta.sar(0.001, 0.02, 0.2)
q1 = ta.sar(0.001, 0.03, 0.3)
plot(q3, title='UV-Sar', style=plot.style_circles, color=xz ? y1 > close ? color.rgb(229, 2, 250) : color.rgb(250, 225, 3) : color.silver, linewidth=1)
plot(q2, title='OV-Sar', style=plot.style_circles, color=xz ? y1 > close ? color.rgb(229, 2, 250) : color.rgb(250, 225, 3) : color.silver, linewidth=1)
plot(q1, title='KV-Sar', style=plot.style_circles, color=xz ? y1 > close ? color.rgb(229, 2, 250) : color.rgb(250, 225, 3) : color.silver, linewidth=1)
-
3 veriyi hesaplatıp....
anlık...saatlik...günlük....haftalık döngüselliğine...
denemek isteyene örnek kod.....
PHP Code:
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © carefulCode53358
//@version=5
indicator(".", overlay = true)
ehad = input(true, title='Renklendirme')
/////verisi kullanılacak sistemler...indikatörler.....
/////veri...
//Functions Sar for support and resistance
q3 = ta.sar(0.01, 0.01, 0.1)
q2 = ta.sar(0.01, 0.03, 0.3)
q1 = ta.sar(0.01, 0.05, 0.5)
//hesaplanan veriyi zaman döngüsüne aktarma.....
fatiha = q3
kadir = q2
velasr = q1
/////tüm zaman döngülerinin tanımı.....
//İnned dîne indâllâhil İslâm...Ali-İmran 19.ayet
bakara = input.timeframe('1', title='Periyot')
aliimran = input.timeframe('3', title='Periyot')
nisa = input.timeframe('5', title='Periyot')
maide = input.timeframe('15', title='Periyot')
enam = input.timeframe('30', title='Periyot')
araf = input.timeframe('45', title='Periyot')
enfal = input.timeframe('60', title='Periyot')
tevbe = input.timeframe('120', title='Periyot')
yunus = input.timeframe('180', title='Periyot')
hud = input.timeframe('240', title='Periyot')
yusuf = input.timeframe('D', title='Periyot')
rad = input.timeframe('W', title='Periyot')
ibrahim = input.timeframe('M', title='Periyot')
hicr = input.timeframe('3M', title='Periyot')
nahl = input.timeframe('12M', title='Periyot')
// Security 1 veriyi zaman döngüsünde hesaplatma...
isra = request.security(syminfo.tickerid, bakara, fatiha)
kehf = request.security(syminfo.tickerid, aliimran, fatiha)
meryem = request.security(syminfo.tickerid, nisa, fatiha)
taha = request.security(syminfo.tickerid, maide, fatiha)
enbiya = request.security(syminfo.tickerid, enam, fatiha)
hac = request.security(syminfo.tickerid, araf, fatiha)
muminun = request.security(syminfo.tickerid, enfal, fatiha)
nur = request.security(syminfo.tickerid, tevbe, fatiha)
furkan = request.security(syminfo.tickerid, yunus, fatiha)
suara = request.security(syminfo.tickerid, hud, fatiha)
neml = request.security(syminfo.tickerid, yusuf, fatiha)
kasas = request.security(syminfo.tickerid, rad, fatiha)
ankebut = request.security(syminfo.tickerid, ibrahim, fatiha)
rum = request.security(syminfo.tickerid, hicr, fatiha)
lokman = request.security(syminfo.tickerid, nahl, fatiha)
//Signal...1veri zaman döngüsü sinyalleri hesapla ve çizdir
tegabun = (isra )
plot(tegabun, title='1-Anlık', style=plot.style_stepline, color=ehad ? isra > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
talak = (isra + kehf + meryem ) / 3
//plot(talak, title='1.Veri-5DakikayaDöngü', style=plot.style_stepline, color=ehad ? isra > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
tahrim = (isra + kehf + meryem + taha ) / 4
//plot(tahrim, title='1.Veri-15DakikayaDöngü', style=plot.style_stepline, color=ehad ? isra > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
mulk = (isra + kehf + meryem + taha + enbiya + hac + muminun ) / 7
plot(mulk, title='1-Saatlik', style=plot.style_stepline, color=ehad ? isra > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
kalem = (isra + kehf + meryem + taha + enbiya + hac + muminun+nur+furkan+suara+neml ) / 11
plot(kalem, title='1-Günlük', style=plot.style_stepline, color=ehad ? isra > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
hakka = (isra + kehf + meryem + taha+enbiya+hac+muminun+nur+furkan+suara+neml+kasas ) / 12
plot(hakka, title='1-Haftalık', style=plot.style_stepline, color=ehad ? isra > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
mearic = (isra + kehf + meryem + taha+enbiya+hac+muminun+nur+furkan+suara+neml+kasas+ankebut ) / 13
//plot(mearic, title='1.Veri-AyaDöngü', style=plot.style_stepline, color=ehad ? isra > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
nuh = (isra + kehf + meryem + taha+enbiya+hac+muminun+nur+furkan+suara+neml+kasas+ankebut+rum ) / 14
//plot(nuh, title='1.Veri-ÜçAyaDöngü', style=plot.style_stepline, color=ehad ? isra > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
cin = (isra + kehf + meryem + taha+enbiya+hac+muminun+nur+furkan+suara+neml+kasas+ankebut+rum +lokman ) / 15
//plot(cin, title='1.Veri-YılaDöngü', style=plot.style_stepline, color=ehad ? isra > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
// 2.veriyi zamanda döndürme
secde = request.security(syminfo.tickerid, bakara, kadir)
ahzab = request.security(syminfo.tickerid, aliimran, kadir)
sebe = request.security(syminfo.tickerid, nisa, kadir)
fatir = request.security(syminfo.tickerid, maide, kadir)
yasin = request.security(syminfo.tickerid, enam, kadir)
saffat = request.security(syminfo.tickerid, araf, kadir)
sad = request.security(syminfo.tickerid, enfal, kadir)
zumer = request.security(syminfo.tickerid, tevbe, kadir)
mumin = request.security(syminfo.tickerid, yunus, kadir)
fussilet = request.security(syminfo.tickerid, hud, kadir)
sura = request.security(syminfo.tickerid, yusuf, kadir)
zuhruf = request.security(syminfo.tickerid, rad, kadir)
duhan = request.security(syminfo.tickerid, ibrahim, kadir)
casiye = request.security(syminfo.tickerid, hicr, kadir)
ahkaf = request.security(syminfo.tickerid, nahl, kadir)
///2veri
muzzemmil = (secde )
plot(muzzemmil, title='2-Anlık', style=plot.style_stepline, color=ehad ? secde > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
muddesir = (secde+ahzab+sebe ) / 3
//plot(muddesir, title='2.Veri-5DakikayaDöngü', style=plot.style_stepline, color=ehad ? isra > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
kiyamet = (secde+ahzab+sebe+fatir ) / 4
//plot(kiyamet, title='2.Veri-15DakikayaDöngü', style=plot.style_stepline, color=ehad ? isra > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
insan = (secde+ahzab+sebe+fatir+yasin+saffat+sad ) / 7
plot(insan, title='2-Saatlik', style=plot.style_stepline, color=ehad ? isra > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
murselat = (secde+ahzab+sebe+fatir+yasin+saffat+sad+zumer+mumin+fussilet+sura ) / 11
plot(murselat, title='2-Günlük', style=plot.style_stepline, color=ehad ? isra > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
nebe = (secde+ahzab+sebe+fatir+yasin+saffat+sad+zumer+mumin+fussilet+sura+zuhruf ) / 12
plot(nebe, title='2-Haftalık', style=plot.style_stepline, color=ehad ? isra > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
naziat = (secde+ahzab+sebe+fatir+yasin+saffat+sad+zumer+mumin+fussilet+sura+zuhruf+duhan ) / 13
//plot(naziat, title='2.Veri-AyaDöngü', style=plot.style_stepline, color=ehad ? isra > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
abese = (secde+ahzab+sebe+fatir+yasin+saffat+sad+zumer+mumin+fussilet+sura+zuhruf+duhan+casiye ) / 14
//plot(abese, title='2.Veri-ÜçAyaDöngü', style=plot.style_stepline, color=ehad ? isra > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
tekvir = (secde+ahzab+sebe+fatir+yasin+saffat+sad+zumer+mumin+fussilet+sura+zuhruf+duhan+casiye+ahkaf ) / 15
//plot(tekvir, title='2.Veri-YılaDöngü', style=plot.style_stepline, color=ehad ? isra > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
// Security3.veriyi zamanda döndürme...
fetih = request.security(syminfo.tickerid, bakara, velasr)
hucurat = request.security(syminfo.tickerid, aliimran, velasr)
kaf = request.security(syminfo.tickerid, nisa, velasr)
zariyat = request.security(syminfo.tickerid, maide, velasr)
tur = request.security(syminfo.tickerid, enam, velasr)
necm = request.security(syminfo.tickerid, araf, velasr)
kamer = request.security(syminfo.tickerid, enfal, velasr)
vakia = request.security(syminfo.tickerid, tevbe, velasr)
hadid = request.security(syminfo.tickerid, yunus, velasr)
mucadele = request.security(syminfo.tickerid, hud, velasr)
hasr = request.security(syminfo.tickerid, yusuf, velasr)
mumtehine = request.security(syminfo.tickerid, rad, velasr)
saf = request.security(syminfo.tickerid, ibrahim, velasr)
cuma = request.security(syminfo.tickerid, hicr, velasr)
munafik = request.security(syminfo.tickerid, nahl, velasr)
/////3.veri...bilgiler...
infitar = (fetih )
plot(infitar, title='3-Anlık', style=plot.style_stepline, color=ehad ? fetih > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
mutaffifin = (fetih+hucurat+kaf ) /3
//plot(mutaffifin, title='3.Veri-5DakikayaDöngü', style=plot.style_stepline, color=ehad ? fetih > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
insikak = (fetih+hucurat+kaf+zariyat ) /4
//plot(insikak, title='3.Veri-15DakikayaDöngü', style=plot.style_stepline, color=ehad ? fetih > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
buruc = (fetih+hucurat+kaf+zariyat+tur+necm+kamer ) /7
plot(buruc, title='3-Saatlik', style=plot.style_stepline, color=ehad ? fetih > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
tarik = (fetih+hucurat+kaf+zariyat+tur+necm+kamer+vakia+hadid+mucadele+hasr ) /11
plot(tarik, title='3-Günlük', style=plot.style_stepline, color=ehad ? fetih > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
ala = (fetih+hucurat+kaf+zariyat+tur+necm+kamer+vakia+hadid+mucadele+hasr+mumtehine ) /12
plot(ala, title='3-Haftalık', style=plot.style_stepline, color=ehad ? fetih > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
gasiye = (fetih+hucurat+kaf+zariyat+tur+necm+kamer+vakia+hadid+mucadele+hasr+mumtehine+saf ) /13
//plot(gasiye, title='3.Veri-AyaDöngü', style=plot.style_stepline, color=ehad ? fetih > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
fecr = (fetih+hucurat+kaf+zariyat+tur+necm+kamer+vakia+hadid+mucadele+hasr+mumtehine+saf+cuma) /14
//plot(fecr, title='3.Veri-ÜçayaDöngü', style=plot.style_stepline, color=ehad ? fetih > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
beled = (fetih+hucurat+kaf+zariyat+tur+necm+kamer+vakia+hadid+mucadele+hasr+mumtehine+saf+cuma+munafik ) /15
//plot(beled, title='3.Veri-YılaDöngü', style=plot.style_stepline, color=ehad ? fetih > close ? color.rgb(255, 82, 82, 100) : color.rgb(0, 230, 119, 100) : color.silver, linewidth=2)
-
istediğiniz kadar farklı veriyi alıp....
hepsini okutup...saatlik görme...
sabit zaman döngüsü...
not tek veri sar kullanıldı....
4 veri için kalıp hazır...isteyen kalıba eklemeye devam eder....
denemek isteyene kodu....
PHP Code:
//@version=5
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © carefulCode53358
//////anakalıp
indicator('60', overlay=true,timeframe="1", timeframe_gaps=true,max_boxes_count=500)
fatiha = input.timeframe('60', title='Periyot')
ehad = input(true, title='Renklendirme')
/////anakalıp .....buraya dokunma....
//veri oluştur...
//veri oluştur...
//veri alma...
bakara = ta.sar(0, 0.01, 1)
//aliimran=(twapValue)
//nisa=(outa)
//maide=(smoothingLine2a)
// Security
kuran1 = request.security(syminfo.tickerid, fatiha, bakara)
//kuran2 = request.security(syminfo.tickerid, fatiha, aliimran)
//kuran3 = request.security(syminfo.tickerid, fatiha, nisa)
//kuran4 = request.security(syminfo.tickerid, fatiha, maide)
//Plots
//plot(kuran1, title='sar', style=plot.style_circles, color=ehad ? kuran1 > close ? color.red : color.lime : color.silver, linewidth=1)
//plot(kuran2, title='twap', style=plot.style_circles, color=ehad ? kuran2 > close ? color.red : color.lime : color.silver, linewidth=1)
//Signal
vallahualem=(kuran1)
plot(vallahualem, title='vallahualem', style=plot.style_stepline, color=ehad ? vallahualem > close ? color.red : color.lime : color.silver, linewidth=1)
//
//END
bcolor = ta.crossunder(close,vallahualem) ? color.red : ta.crossover(close,vallahualem) ? color.green: close>vallahualem ? color.green : close<vallahualem ? color.red: color.rgb(216, 4, 253) // : color.black
barcolor(bcolor)
-
denemek isteyene örnek kod...
PHP Code:
//@version=5
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © carefulCode53358
//////anakalıp
indicator('60', overlay=true,timeframe="60", timeframe_gaps=true,max_boxes_count=500)
fatiha = input.timeframe('60', title='Periyot')
ehad = input(true, title='Renklendirme')
/////anakalıp .....buraya dokunma....
//veri oluştur...
length = input.int(5, minval=1)
ema1 = ta.ema(close, length)
ema2 = ta.ema(ema1, length)
ema3 = ta.ema(ema2, length)
out = 3 * (ema1 - ema2) + ema3
plot(out, "TEMA5", color=#2962FF)
length1 = input.int(20, minval=1)
ema11 = ta.ema(close, length1)
ema21 = ta.ema(ema11, length1)
ema31 = ta.ema(ema21, length1)
out1 = 3 * (ema11 - ema21) + ema31
plot(out1, "TEMA20", color=#ce0cf5)
length13 = input.int(50, minval=1)
ema113 = ta.ema(close, length13)
ema213 = ta.ema(ema113, length13)
ema313 = ta.ema(ema213, length13)
out13 = 3 * (ema113 - ema213) + ema313
plot(out13, "TEMA50", color=#f5f10c)
//veri oluştur...
//veri alma...
bakara = ta.sar(0, 0.01, 1)
aliimran=(out)
nisa=(out1)
maide=(out13)
// Security
kuran1 = request.security(syminfo.tickerid, fatiha, bakara)
kuran2 = request.security(syminfo.tickerid, fatiha, aliimran)
kuran3 = request.security(syminfo.tickerid, fatiha, nisa)
kuran4 = request.security(syminfo.tickerid, fatiha, maide)
//Plots
//plot(kuran1, title='sar', style=plot.style_circles, color=ehad ? kuran1 > close ? color.red : color.lime : color.silver, linewidth=1)
//plot(kuran2, title='twap', style=plot.style_circles, color=ehad ? kuran2 > close ? color.red : color.lime : color.silver, linewidth=1)
//Signal
vallahualem=(kuran2+kuran3+kuran4)/3
plot(vallahualem, title='vallahualem', style=plot.style_stepline, color=ehad ? vallahualem > close ? color.red : color.lime : color.silver, linewidth=1)
//
//END
bcolor = ta.crossunder(close,vallahualem) ? color.red : ta.crossover(close,vallahualem) ? color.green: close>vallahualem ? color.green : close<vallahualem ? color.red: color.rgb(216, 4, 253) // : color.black
barcolor(bcolor)