답변완료
잘 부탁드립니다
//@version=4
study(title="Equilibriums", shorttitle="Equilibrium", overlay=true)
//----------[ First Step: create inputs for equilibrium line periods
tenkanPeriods = input(9, minval=1, title="Tenkan-Sen Length")
zandakaPeriods1 = input(17, minval=1, title="Zandaka Period 1")
kijunPeriods = input(26, minval=1, title="Kijun-Sen Length")
zandakaPeriods2 = input(33, minval=1, title="Zandaka Period 2")
zandakaPeriods3 = input(42, minval=1, title="Zandaka Period 3")
zandakaPeriods4 = input(52, minval=1, title="Zandaka Period 4")
zandakaPeriods5 = input(65, minval=1, title="Zandaka Period 5")
zandakaPeriods6 = input(76, minval=1, title="Zandaka Period 6")
//----------[ Second Step: define the formula for calculating the equilibrium
donchian(len) => avg(lowest(len), highest(len))
//----------[ Third Step: Link the inputs to the previously created formula
tenkanSen = donchian(tenkanPeriods)
zandakaSen1 = donchian(zandakaPeriods1)
kijunSen = donchian(kijunPeriods)
zandakaSen2 = donchian(zandakaPeriods2)
zandakaSen3 = donchian(zandakaPeriods3)
zandakaSen4 = donchian(zandakaPeriods4)
zandakaSen5 = donchian(zandakaPeriods5)
zandakaSen6 = donchian(zandakaPeriods6)
//----------[ Last Step: Create the code for plotting (this step is of vital importance as no one likes ugly or unclear indicators)
plot(zandakaSen6, linewidth=8, color=color.rgb(255,150,000,60), title="Zandaka-Sen 6")
plot(zandakaSen5, linewidth=7, color=color.rgb(255,255,000,60), title="Zandaka-Sen 5")
plot(zandakaSen4, linewidth=6, color=color.rgb(000,036,249,60), title="Zandaka-Sen 4")
plot(zandakaSen3, linewidth=5, color=color.rgb(139,000,247,40), title="Zandaka-Sen 3")
plot(zandakaSen2, linewidth=4, color=color.rgb(226,159,226,00), title="Zandaka-Sen 2")
plot(kijunSen, linewidth=3, color=color.rgb(227,000,034,20), title="Kijun-Sen")
plot(zandakaSen1, linewidth=1, color=color.rgb(038,186,030,40), title="Zandaka-Sen 1")
plot(tenkanSen, linewidth=3, color=color.rgb(000,152,116,00), title="Tenkan-Sen")
2023-06-21
1391
글번호 169948
지표
답변완료
잘 부탁드립니다
indicator(title="Trend Indicator", shorttitle="Trend Analyzer", overlay=true, max_bars_back=(2000))
//@version=5
// Created by @erossini.tr
// Inputs
string ccolortp = "Color candle based on volumetric pressure compared to non-volumetric averages, confluence of fast and slow period"
mode = input.string(defval = "Ichimoku", title = "Indicator", options = ["Ichimoku", "Channel and Bands", "None"])
bandinput = input.bool(defval = false, title = "Enable extentions zone")
ccolorinput = input.bool(defval = true, title = "Enable candle color", tooltip = ccolortp)
string ichi = "Ichimoku"
string bands = "Bands and Channel"
flmode = input.string(defval = "Classic mode", title = "Fast lines mode", options = ["Volume averages", "Classic mode"], group = ichi)
ssamode = input.string(defval = "Auto", title = "SSA line mode", options = ["Volume average", "Classic mode", "Mixed", "Auto"], group = ichi)
ssbmode = input.string(defval = "VWMA", title = "SSB line mode", options = ["VWMA", "Classic"], group = ichi)
// Ichimoku
conversionPeriods = input(11, title = "Fast Line", group = ichi)
basePeriods = input(26, title = "Slow Line", group = ichi)
lnt = input(89, title = "SSB Line", group = ichi)
conv2 = ta.vwma(close, conversionPeriods)
base2 = ta.vwma(close, basePeriods)
conversionLine = math.avg(ta.lowest(conversionPeriods), ta.highest(conversionPeriods))
baseLine = math.avg(ta.lowest(basePeriods), ta.highest(basePeriods))
leadLine1 = math.avg(conversionLine, baseLine)
leadLine12 = math.avg(conv2, base2)
leadLine13 = math.avg(conv2, base2, conversionLine, baseLine)
leadLine2 = ta.vwma(close, lnt)
leadline21 = math.avg(ta.lowest(lnt), ta.highest(lnt))
// Trama
ama = 0.00
lengthTR = input(34, title = "Trama Backline Lenght", group = ichi)
hh = math.max(math.sign(ta.change(ta.highest(lengthTR))),0)
ll = math.max(math.sign(ta.change(ta.lowest(lengthTR))*-1),0)
tc = math.pow(ta.sma(hh or ll ? 1 : 0,lengthTR),2)
ama := nz(ama[1]+tc*(close-ama[1]),close)
// Bands and channel
source = hlc3
mode3 = input.string(defval = "Channel", title = "Mode", options = ["Channel", "Bands"], group = bands)
period = input(title = "Period", defval = 34, group = bands)
multi = input(title = "Multiplier", defval = 3.14, group = bands)
smooth = input(defval = 1, title = "Smoothing value", group = bands)
sma = ta.vwma(source, period)
// Keltner Channel
f_kc(src, length, mult, useTrueRange) =>
float basis = sma
float span = (useTrueRange) ? ta.tr : (high - low)
float rangeEma = ta.ema(span, length)
[basis, basis + rangeEma * mult, basis - rangeEma * mult]
[kcmiddle, kcupper, kclower] = f_kc(source, period, multi, true)
// Bollinger Bands
f_bb(src, length, mult) =>
float basis2 = sma
float dev = multi * ta.stdev(source, period)
[basis2, basis2 + dev, basis2 - dev]
[bbmiddle, bbupper, bblower] = f_bb(close, 5, 4)
// Plot
plotmiddle = if mode3 == "Channel"
(ta.sma(kcmiddle, smooth))
else if mode3 == "Bands"
(ta.sma(bbmiddle, smooth))
plotupper = if mode3 == "Channel"
(ta.sma(kcupper, smooth))
else if mode3 == "Bands"
(ta.sma(bbupper, smooth))
plotlower = if mode3 == "Channel"
(ta.sma(kclower, smooth))
else if mode3 == "Bands"
(ta.sma(bblower, smooth))
// Candle color
Lenghtfast = 11
Lenghtslow = 89
colorup = #2962ff
colordown = #e91e63
a1 = ta.sma(hlc3, Lenghtfast*2)
a2 = ta.vwma(hlc3, Lenghtfast)
a3 = ta.sma(hlc3, Lenghtslow*2)
a4 = ta.vwma(hlc3, Lenghtslow)
c3 = if a1 > a2 and a3 > a4 and ccolorinput == true
(colordown)
else if a1 < a2 and a3 < a4 and ccolorinput == true
(colorup)
barcolor(c3)
// Extension zones
[middle2, upper2, lower2] = ta.kc(close, 200, 12, false)
[middle3, upper3, lower3] = ta.kc(close, 200, 23, false)
g1 = if bandinput == true
upper2
g2 = if bandinput == true
upper3
g3 = if bandinput == true
lower2
g4 = if bandinput == true
lower3
h1 = plot(g1, color = color.new(color.gray, 100), editable = false)
h2 = plot(g2, color = color.new(color.gray, 100), editable = false)
h3 = plot(g3, color = color.new(color.gray, 100), editable = false)
h4 = plot(g4, color = color.new(color.gray, 100), editable = false)
fill(h3, h4, color = color.new(#2962ff, 85), title = "Lower zone")
fill(h1, h2, color = color.new(#e91e63, 85), title = "Upper zone")
// Plot
displacement = input(26, title = "Forward displacement", group = ichi)
backdisp = input(30, title = "Backwards displacement", group = ichi)
p9 = if ssbmode == "VWMA"
p9 = leadLine2
else if ssbmode == "Classic"
p9 = leadline21
x1 = if flmode == "Volume averages"
x1 = conv2
else if flmode == "Classic mode"
x1 = conversionLine
x2 = if flmode == "Volume averages"
x2 = base2
else if flmode == "Classic mode"
x2 = baseLine
u1 = if ssamode == "Volume average"
u1 = leadLine12
else if ssamode == "Classic mode"
u1 = leadLine1
else if ssamode == "Mixed"
u1 = leadLine13
else if ssamode == "Auto"
u1 = math.avg(x1, x2)
kjuncol = conversionLine > baseLine ? #2962ff : conversionLine < baseLine ? #e91e63 : color.gray
q1 = if mode == "Ichimoku"
x1
q2 = if mode == "Ichimoku"
x2
q3 = if mode == "Ichimoku"
u1
q4 = if mode == "Ichimoku"
p9
q5 = if mode == "Ichimoku"
ama
q6 = if mode == "Channel and Bands"
plotmiddle
q7 = if mode == "Channel and Bands"
plotupper
q8 = if mode == "Channel and Bands"
plotlower
plot(q1, color=color.gray, title="Conversion Line")
plot(q2, color=kjuncol, linewidth=2, title="Base Line")
p8 = plot(q3, offset = displacement, color=#2962ffb4, title="SSA")
p3 = plot(q4, offset = displacement, color=#e91e62b2, title="SSB")
fill(p8, p3,color.rgb(134, 134, 134, 77), title = "Kumo Cloud")
plot(q5, color = color.rgb(149, 0, 179, 10), offset = -backdisp, title = "Backline", style = plot.style_circles)
plot(q6, color = color.gray, title = "Middle line")
p10 = plot(q8, color = #2962ff, title = "Lower line")
p20 = plot(q7, color = #e91e63, title = "Upper line")
fill(p10, p20, color = color.new(color.gray, 90), title = "Channel Background")
2023-06-21
1238
글번호 169942
지표
답변완료
잘 부탁드립니다
//@version=4
//By Glaz, Modified
//
study("QQE MOD")
RSI_Period = input(6, title='RSI Length')
SF = input(5, title='RSI Smoothing')
QQE = input(3, title='Fast QQE Factor')
ThreshHold = input(3, title="Thresh-hold")
//
src = input(close, title="RSI Source")
//
//
Wilders_Period = RSI_Period * 2 - 1
Rsi = rsi(src, RSI_Period)
RsiMa = ema(Rsi, SF)
AtrRsi = abs(RsiMa[1] - RsiMa)
MaAtrRsi = ema(AtrRsi, Wilders_Period)
dar = ema(MaAtrRsi, Wilders_Period) * QQE
longband = 0.0
shortband = 0.0
trend = 0
DeltaFastAtrRsi = dar
RSIndex = RsiMa
newshortband = RSIndex + DeltaFastAtrRsi
newlongband = RSIndex - DeltaFastAtrRsi
longband := RSIndex[1] > longband[1] and RSIndex > longband[1] ?
max(longband[1], newlongband) : newlongband
shortband := RSIndex[1] < shortband[1] and RSIndex < shortband[1] ?
min(shortband[1], newshortband) : newshortband
cross_1 = cross(longband[1], RSIndex)
trend := cross(RSIndex, shortband[1]) ? 1 : cross_1 ? -1 : nz(trend[1], 1)
FastAtrRsiTL = trend == 1 ? longband : shortband
////////////////////
length = input(50, minval=1, title="Bollinger Length")
mult = input(0.35, minval=0.001, maxval=5, step=0.1, title="BB Multiplier")
basis = sma(FastAtrRsiTL - 50, length)
dev = mult * stdev(FastAtrRsiTL - 50, length)
upper = basis + dev
lower = basis - dev
color_bar = RsiMa - 50 > upper ? #00c3ff : RsiMa - 50 < lower ? #ff0062 : color.gray
//
// Zero cross
QQEzlong = 0
QQEzlong := nz(QQEzlong[1])
QQEzshort = 0
QQEzshort := nz(QQEzshort[1])
QQEzlong := RSIndex >= 50 ? QQEzlong + 1 : 0
QQEzshort := RSIndex < 50 ? QQEzshort + 1 : 0
//
Zero = hline(0, color=color.white, linestyle=hline.style_dotted, linewidth=1)
////////////////////////////////////////////////////////////////
RSI_Period2 = input(6, title='RSI Length')
SF2 = input(5, title='RSI Smoothing')
QQE2 = input(1.61, title='Fast QQE2 Factor')
ThreshHold2 = input(3, title="Thresh-hold")
src2 = input(close, title="RSI Source")
//
//
Wilders_Period2 = RSI_Period2 * 2 - 1
Rsi2 = rsi(src2, RSI_Period2)
RsiMa2 = ema(Rsi2, SF2)
AtrRsi2 = abs(RsiMa2[1] - RsiMa2)
MaAtrRsi2 = ema(AtrRsi2, Wilders_Period2)
dar2 = ema(MaAtrRsi2, Wilders_Period2) * QQE2
longband2 = 0.0
shortband2 = 0.0
trend2 = 0
DeltaFastAtrRsi2 = dar2
RSIndex2 = RsiMa2
newshortband2 = RSIndex2 + DeltaFastAtrRsi2
newlongband2 = RSIndex2 - DeltaFastAtrRsi2
longband2 := RSIndex2[1] > longband2[1] and RSIndex2 > longband2[1] ?
max(longband2[1], newlongband2) : newlongband2
shortband2 := RSIndex2[1] < shortband2[1] and RSIndex2 < shortband2[1] ?
min(shortband2[1], newshortband2) : newshortband2
cross_2 = cross(longband2[1], RSIndex2)
trend2 := cross(RSIndex2, shortband2[1]) ? 1 : cross_2 ? -1 : nz(trend2[1], 1)
FastAtrRsi2TL = trend2 == 1 ? longband2 : shortband2
//
// Zero cross
QQE2zlong = 0
QQE2zlong := nz(QQE2zlong[1])
QQE2zshort = 0
QQE2zshort := nz(QQE2zshort[1])
QQE2zlong := RSIndex2 >= 50 ? QQE2zlong + 1 : 0
QQE2zshort := RSIndex2 < 50 ? QQE2zshort + 1 : 0
//
hcolor2 = RsiMa2 - 50 > ThreshHold2 ? color.silver :
RsiMa2 - 50 < 0 - ThreshHold2 ? color.silver : na
plot(FastAtrRsi2TL - 50, title='QQE Line', color=color.white, transp=0, linewidth=2)
plot(RsiMa2 - 50, color=hcolor2, transp=50, title='Histo2', style=plot.style_columns)
Greenbar1 = RsiMa2 - 50 > ThreshHold2
Greenbar2 = RsiMa - 50 > upper
Redbar1 = RsiMa2 - 50 < 0 - ThreshHold2
Redbar2 = RsiMa - 50 < lower
plot(Greenbar1 and Greenbar2 == 1 ? RsiMa2 - 50 : na, title="QQE Up", style=plot.style_columns, color=#00c3ff, transp=0)
plot(Redbar1 and Redbar2 == 1 ? RsiMa2 - 50 : na, title="QQE Down", style=plot.style_columns, color=#ff0062, transp=0)
2023-06-21
1683
글번호 169941
지표