https://tr.tradingview.com/v/pwk0oi8y/
kod günlükte 7 bar aylıkta 5 bar hesaplıyor....
belirlediğiniz tarihler arası stratejinizi test edebilirsiniz....
https://www.tradingview.com/x/NiweBdl0/
Printable View
https://tr.tradingview.com/v/pwk0oi8y/
kod günlükte 7 bar aylıkta 5 bar hesaplıyor....
belirlediğiniz tarihler arası stratejinizi test edebilirsiniz....
https://www.tradingview.com/x/NiweBdl0/
https://tr.tradingview.com/v/yiUkUlfU/
sinyalli...3-5-7 ortalama ile tasarlanmış....
https://www.tradingview.com/x/QN7uXuZU/
aynı yazarın 7-25-99 ortalamalarla yazdığı strateji..... kodu...
https://tr.tradingview.com/v/sPAROdDQ/
https://www.tradingview.com/x/j3KFgGV9/ örnek bu...
ikisinin beraber görünümü ise...
https://www.tradingview.com/x/fkKNKYnr/
tecrübelerime göre...
stratejilerde dikkat edilecek bir husus ise....
stratejinin uygulanacağı zaman......
insan....
geçmişe çok giderse....gitmeye meyillidir..... stratejinin yüksek kazandırdığını zanneder....
pandemi sonrası..... herşey kendini katladı....
strateji gelirleride katladı....
yakın zamana gelin....
başlatın 2023 ün başından....
tekrar bakın strateji sonucunu....
hülasa, geçmişi başarılı gözüken stratejinin....yakın zamanı öyle olmayabilir....
https://tr.tradingview.com/v/dTn0p5mz/
mtfli supertrend kodu.... 3 farklı zaman seçerek....
sinyal görebiliyorsunuz.....
https://www.tradingview.com/x/q362gQEM/
https://tr.tradingview.com/v/gI1unZGv/
9 hareketli ortalama uzunluğunu...
14 hareketli ortalama hesaplama çeşidiyle .....
kombinasyon yapabileceğiniz kod.....
https://www.tradingview.com/x/SbRXer35/
https://www.tradingview.com/x/KVFc81su/
https://www.tradingview.com/x/TH3CZyCJ/
https://tr.tradingview.com/v/zsDLpeBT/
trend arama kodu diyelim....
hem grafik altına ....
hem de grafik üstüne taşınmış örnek....
https://www.tradingview.com/x/ORCOF8Qv/
kodda biraz oynandı.....PHP Code:
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © BobRivera990
//@version=4
study(title = "Trend Type Indicator by BobRivera990", overlay = false)
//==========================================================================[Inputs]==========================================================================
useAtr = input(true, title = "Use ATR to detect Sideways Movements") // Use Average True Range (ATR) to detect Sideways Movements
atrLen = input(14, minval = 1, title = "ATR Length") // length of the Average True Range (ATR) used to detect Sideways Movements
atrMaType = input("EMA", options = ["SMA", "EMA"],
title = "ATR Moving Average Type") // Type of the moving average of the ATR used to detect Sideways Movements
atrMaLen = input(27, minval = 1, title = "ATR MA Length") // length of the moving average of the ATR used to detect Sideways Movements
useAdx = input(true, title = "Use ADX to detect Sideways Movements") // Use Average Directional Index (ADX) to detect Sideways Movements
adxLen = input(14, minval = 1, maxval = 50, title = "ADX Smoothing") // length of the Average Directional Index (ADX) used to detect Sideways Movements
diLen = input(14, minval = 1, title = "DI Length") // length of the Plus and Minus Directional Indicators (+DI & -DI) used to determine the direction of the trend
adxLim = input(25, minval = 1, title = "ADX Limit") // A level of ADX used as the boundary between Trend Market and Sideways Market
smooth = input(3, minval = 1, maxval = 5, title = "Smoothing Factor") // Factor used for smoothing the oscillator
lag = input(8, minval = 0, maxval = 15, title = "Lag") // lag used to match indicator and chart
//============================================================================================================================================================
//===================================================================[Initial Calculations]===================================================================
atr = atr(atrLen) // Calculate the Average True Range (ATR)
atrMa = atrMaType == "EMA" ? ema(atr, atrMaLen) : sma(atr, atrMaLen) // Calculate the moving average of the ATR
up = change(high) // Calculate parameter related to ADX, +DI and -DI
down = -change(low) // Calculate parameter related to ADX, +DI and -DI
plusDM = na(up) ? na : (up > down and up > 0 ? up : 0) // Calculate parameter related to ADX, +DI and -DI
minusDM = na(down) ? na : (down > up and down > 0 ? down : 0) // Calculate parameter related to ADX, +DI and -DI
trur = rma(tr, diLen) // Calculate parameter related to ADX, +DI and -DI
plus = fixnan(100 * rma(plusDM, diLen) / trur) // Calculate Plus Directional Indicator (+DI)
minus = fixnan(100 * rma(minusDM, diLen) / trur) // Calculate Minus Directional Indicator (-DI)
sum = plus + minus // Calculate parameter related to ADX
adx = 100 * rma(abs(plus - minus) / (sum == 0 ? 1 : sum), adxLen) // Calculate Average Directional Index (ADX)
//============================================================================================================================================================
//========================================================================[Conditions]========================================================================
cndNa = na(atr) or na(adx) or na(plus) or na(minus) or na(atrMaLen) // Conditions for lack of sufficient data for calculations
cndSidwayss1 = useAtr and atr <= atrMa // Sideways Movement condition (based on ATR)
cndSidwayss2 = useAdx and adx <= adxLim // Sideways Movement condition (based on ADX)
cndSidways = cndSidwayss1 or cndSidwayss2 // General Sideways Movement condition
cndUp = plus > minus // uptrend condition
cndDown = minus >= plus // downtrend condition
trendType = cndNa ? na : cndSidways ? 0 : cndUp ? 2 : -2 // Determine the type of trend
smoothType = na(trendType) ? na : round(sma(trendType, smooth) / 2) * 2 // Calculate the smoothed trend type oscillator
//============================================================================================================================================================
//=========================================================================[Drawing]==========================================================================
colGreen30 = color.new(color.green, 30) // Define the color used in the drawings
colGreen90 = color.new(color.green, 90) // Define the color used in the drawings
colGray = color.new(color.gray, 20) // Define the color used in the drawings
colWhite90 = color.new(color.white, 90) // Define the color used in the drawings
colRed30 = color.new(color.red, 30) // Define the color used in the drawings
colRed90 = color.new(color.red, 90) // Define the color used in the drawings
band3 = plot(+3, title = "3", color=color.black,transp=100) // Draw the upper limit of the uptrend area
band2 = plot(+1, title = "2", color=color.black,transp=100) // Draw the boundary between Sideways and Uptrend areas
band1 = plot(-1, title = "1", color=color.black,transp=100) // Draw the boundary between Sideways and Downtrend areas
band0 = plot(-3, title = "0", color=color.black,transp=100) // Draw the lower limit of the downtrend area
fill(band2, band3, title = "Uptrend area", color = colGreen90) // Highlight the Uptrend area
fill(band1, band2, title = "Sideways area", color = colWhite90) // Highlight the Sideways area
fill(band0, band1, title = "Downtrend area", color = colRed90) // Highlight the Downtrend area
var label lblUp = na
label.delete(lblUp)
lblUp := label.new(x = time, y = 2, text = "Pozitif Trend",
color = color.new(color.green, 100), textcolor = color.black,
style = label.style_label_left, xloc = xloc.bar_time,
yloc = yloc.price, size=size.normal, textalign = text.align_left) // Show Uptrend area label
var label lblSideways = na
label.delete(lblSideways)
lblSideways := label.new(x = time, y = 0, text = "No Trend",
color = color.new(color.green, 100), textcolor = color.black,
style = label.style_label_left, xloc = xloc.bar_time,
yloc = yloc.price, size = size.normal, textalign = text.align_left) // Show Sideways area label
var label lblDown = na
label.delete(lblDown)
lblDown := label.new(x = time, y = -2, text = "Negatif Trend",
color = color.new(color.green, 100), textcolor = color.black,
style = label.style_label_left, xloc = xloc.bar_time,
yloc = yloc.price, size = size.normal, textalign = text.align_left) // Show Downtrend area label
var label lblCurrentType = na
label.delete(lblCurrentType)
lblCurrentType := label.new(x = time, y = smoothType,
color = color.new(color.blue, 30), style = label.style_label_right,
xloc = xloc.bar_time, yloc = yloc.price, size = size.small) // Show the latest status label
trendCol = smoothType == 2 ? colGreen30 : smoothType == 0 ? colGray : colRed30 // Determine the color of the oscillator in different conditions
plot(smoothType, title = "Tr", color = trendCol,
linewidth = 3, offset = -lag, style = plot.style_stepline) // Draw the trend type oscillator
false ayarlı olduğu için....
grafiğin altında yeni bir bölüm olarak çıkar.....
grafiğin üstüne taşıyın bırakın....
ayarlarını istediğiniz gibi değiştirin....
testini yapın....
belirlediği alanlar....trend noktaları gibi düşünün....
label zaten...trendin pozitif-negatif veya olmadığını belirtiyor....
alanı da destek-direnç gibi kullanabilirsiniz...
https://tr.tradingview.com/v/i2CYIGL5/
normalde böyle.....https://www.tradingview.com/x/AiscTB3T/
grafiğin üstüne taşınınca böyle.....https://www.tradingview.com/x/EPtNgFv6/
stilden sadeleşince böyle....https://www.tradingview.com/x/IzKiyFGS/
10 pivot son 5 çek yapılırsa böyle....https://www.tradingview.com/x/cZWpLFVn/
önceki kod ile beraber görünüm böyle......https://www.tradingview.com/x/OmGCXmaT/
hem trend alanı belirlendi....hem de pivot rsi ilişkilendirmesi ile trend çizilmiş gibi oldu....
skalayı da sola ayarlamak...daha güzel gösteriyo gibi....
https://www.tradingview.com/x/kinN7xpx/