예스스탁
예스스탁 답변
2024-09-02 13:58:37
안녕하세요
예스스탁입니다.
올려주신 내용은 변환이 가능하지 않습니다.
수식 내에 해당 수식 배포자가 직접 만든 사용자함수들이 사용되어 있고
해당 함수 내용을 알수 없습니다.
즐거운 하루되세요
> 다올 님이 쓴 글입니다.
> 제목 : 적용가능하도록 부탁드립니다.
> **트레이팅뷰의 지표입니다. 적용가능하도록 부탁 드립니다.
indicator("Triple Confirmation Kernel Regression Oscillator Overlay [QuantraAI]", "KRO Overlay [QuantraAI]", true, format.price, timeframe = "", timeframe_gaps = false)
import QuantraAI/QuantraMAs/2 as DynamicMA
import QuantraSystems/DynamicFunctions/1 as DynamicFunc
var string KRS = "??? ??????? - Settings", var string KRU = "??? ??????? - UI"
source = input.source(close, "Source", group = KRS)
bandwidth = input.int (45, "Bandwidth", 1, group = KRS, tooltip = "Length of the Kernel Regression calculation")
width = input.float (2, "Width", step = 0.2, group = KRS, tooltip = "Smoothes the Signal")
sdLook = input.int (150, "Standard Deviation Lookback", group = KRS, tooltip = "Length of the SD bands lookback period")
sdMult = input.float (3, "Standard Deviation Extreme for OB/OS Border", step = 0.5, group = KRS, tooltip = "Defines the outer border of the SD bands. ₩nThe inner border begins at 50% of the SD Multiplier")
ColMode = input.string("Modern", "Color Palette Choice", inline = "QQ1", group = KRU, options = ["Classic", "Modern", "Robust", "Accented", "Monochrome"])
man = input.bool (false, "Custom Palette", inline = "QQ1", group = KRU)
manUpC = input.color (#00ff00, "Custom Up", inline = "man", group = KRU)
manDnC = input.color (#ff0000, "Custom Down", inline = "man", group = KRU)
sig = input.bool (false, "Show Trend Signals", group = KRU)
BCol = input.bool (true, "Enable Bar Coloring", group = KRU)
devS = input.bool (true, "Enable Deviation Band Shading", group = KRU)
OBOS = input.bool (true, "Enable Overbought/Oversold Shading", group = KRU)
TR = input.int (85, "Shading Transparency", 0, 100, group = KRU)
// Color assignment based on the
[UpC, DnC] = switch ColMode
"Classic" => [#00E676, #880E4F]
"Modern" => [#5ffae0, #c22ed0]
"Robust" => [#ffbb00, #770737]
"Accented" => [#9618f7, #ff0078]
"Monochrome" => [#dee2e6, #495057]
// Override with custom colors if manual
[UpCol, DnCol] = switch man
false => [UpC, DnC ]
true => [manUpC, manDnC]
// Achieves a non-deciaml tick size
rescale(src) => src * (1 / syminfo.mintick)
descale(src) => src / (1 / syminfo.mintick)
// Rescale the Input Source
source := rescale(source)
Wave = descale(DynamicFunc.waveCalculation (source, bandwidth, width ))
// Triple Confirmations
Ep = descale(DynamicFunc.kernelRegression(source, bandwidth, 'Epanechnikov' ))
Lo = descale(DynamicFunc.kernelRegression(source, bandwidth, 'Logistic' ))
Wa = descale(DynamicFunc.kernelRegression(source, bandwidth, 'Wave' ))
// Average
AV = math.avg(Ep, Lo, Wa) + close
Mid = DynamicMA.SMA(AV, sdLook)
arrUp = Wave > Wave[1] and not (Wave[1] > Wave[2])
arrDn = Wave < Wave[1] and not (Wave[1] < Wave[2])
// Standard Deviation Bands
[_, u1, l1] = DynamicFunc.stdv_bands(AV, sdLook, sdMult/2)
[_, u2, l2] = DynamicFunc.stdv_bands(AV, sdLook, sdMult)
// Define shared display settings
var all = sig ? display.all : display.none
// Main Plots
pu1 = plot (u1, "1.???? +", color.new(DnCol, 70) )
pl1 = plot (l1, "1.???? -", color.new(UpCol, 70) )
pu2 = plot (u2, "2.???? +", color.new(DnCol, 70) )
pl2 = plot (l2, "2.???? -", color.new(UpCol, 70) )
mid = plot (Mid, "Mid", color.gray, 2 )
HL2 = plot (hl2, "", color (na) )
wave = plot (Wave, "???????????? ????????", BCol ? color (na) : Wave > Wave[1] ? UpCol : DnCol, 3 ),
fill (pu1, pu2, u2, u1, devS ? color.new(DnCol, 60) : na, color.new(chart.bg_color, 55) ),
fill (pl1, pl2, l2, l1, devS ? color.new(UpCol, 60) : na, color.new(chart.bg_color, 55) ),
fill (wave, HL2, Wave, hl2, BCol ? color.new(Wave > Wave[1] ? UpCol : DnCol, 50) : na, color.new(chart.bg_color, 75) ),
plotshape(arrUp, "Trend", shape.arrowup, location.belowbar, UpCol, 0, "Up", UpCol, size = size.auto, display = all ),
plotshape(arrDn, "Trend", shape.arrowdown, location.abovebar, DnCol, 0, "Down", DnCol, size = size.auto, display = all ),
bgcolor (OBOS ? (AV > u2 ? color.new(DnCol, TR) : AV < l2 ? color.new(UpCol, TR) : na) : na),
barcolor (BCol ? Wave > Wave[1]? UpCol : DnCol: na)