커뮤니티

트레이딩뷰의 파인스크랩터를 트레이딩뷰로 변환 부탁드립니다.

프로필 이미지
하날랑
2024-09-21 22:30:29
847
글번호 183613
답변완료
코딩을 위한 노력을 해 보았으나 실격부족으로 어려워서 부탁을 드립니다. 다음의 트레이딩뷰의 코딩을 예스스탁 프로그램으로 맞게 변환을 부탁드립니다. 신호는 조건이 만족한 직전봉에 표기가 되고 있으니 조건 만족봉에 매수매도의 시그널이 되도록 부탁을 드립니다. //@version=5 indicator("ALMA ", overlay=true) //ALMA Smoothing src = input(close, title='Source', group = "ALMA Smoothing") smooth = input.int(1, title='Smoothing', minval=1, group = "ALMA Smoothing") length1 = input.int(25, title='Lookback', minval=1, group = "ALMA Smoothing") offset = 0.85 sigma1 = 7 pchange = ta.change(src, smooth) / src * 100 avpchange = ta.alma(pchange, length1, offset, sigma1) //RSI rsi = ta.rsi(close, 14) rsiL = rsi > rsi[1] rsiS = rsi < rsi[1] //Chande Momentum length11 = 9 src1 = close momm = ta.change(src1) f1(m) => m >= 0.0 ? m : 0.0 f2(m) => m >= 0.0 ? 0.0 : -m m1 = f1(momm) m2 = f2(momm) sm1 = math.sum(m1, length11) sm2 = math.sum(m2, length11) percent(nom, div) => 100 * nom / div chandeMO = percent(sm1-sm2, sm1+sm2) cL = chandeMO > chandeMO[1] cS = chandeMO < chandeMO[1] //GAMA credit to author: &#169; LeafAlgo https://www.tradingview.com/v/th7NZUPM/ length = input.int(14, minval=1, title="Length", group = "Gaussian Adaptive Moving Average") adaptive = input.bool(true, title="Adaptive Parameters", group = "Gaussian Adaptive Moving Average") volatilityPeriod = input.int(20, minval=1, title="Volatility Period", group = "Gaussian Adaptive Moving Average") // Calculate Gaussian Moving Average gma = 0.0 sumOfWeights = 0.0 sigma = adaptive ? ta.stdev(close, volatilityPeriod) : input.float(1.0, minval=0.1, title="Standard Deviation", group = "Gaussian Adaptive Moving Average") for i = 0 to length - 1 weight = math.exp(-math.pow(((i - (length - 1)) / (2 * sigma)), 2) / 2) value = ta.highest(avpchange, i + 1) + ta.lowest(avpchange, i + 1) gma := gma + (value * weight) sumOfWeights := sumOfWeights + weight gma := (gma / sumOfWeights) / 2 gma:= ta.ema(gma, 7) gmaColor = avpchange >= gma ? color.rgb(0, 161, 5) : color.rgb(215, 0, 0) // Color bars based on signals until the next signal occurs var int currentSignal = 0 currentSignal := avpchange >= gma ? 1 : -1//le_final ? -1 : currentSignal var color barColor = na if currentSignal == 1 barColor := color.rgb(0, 186, 6) else if currentSignal == -1 barColor := color.rgb(176, 0, 0) barcolor(barColor) plotcandle(open, high, low, close, "Bar Color", barColor, barColor, bordercolor = barColor) //Plotting ema = ta.ema(close, 7) plot(ema, color=gmaColor, linewidth=3, title="Gaussian Moving Average") plotshape(ta.crossover(avpchange,gma) and barstate.isconfirmed, "Buy Signal", text = "B", textcolor = color.white, style = shape.labelup, location = location.belowbar, color = color.rgb(0, 161, 5), offset = -1) plotshape(ta.crossunder(avpchange,gma) and barstate.isconfirmed, "Sell Signal", text = "S", textcolor = color.white, style = shape.labeldown, location = location.abovebar, color = color.rgb(215, 0, 0), offset = -1) bgcolor(ta.crossover(avpchange,gma) and barstate.isconfirmed and rsiL and cL ? color.rgb(0, 162, 5, 85): na, offset = -1) bgcolor(ta.crossunder(avpchange,gma) and barstate.isconfirmed and rsiS and cS ? color.rgb(207, 0, 0, 85): na, offset = -1) barcolor(gmaColor) alertcondition(ta.crossover(avpchange,gma) and barstate.isconfirmed, title="Buy Signal", message="Go Long! {{exchange}}:{{ticker}}") alertcondition(ta.crossunder(avpchange,gma) and barstate.isconfirmed, title="Sell Signal", message="Go Short! {{exchange}}:{{ticker}}")
시스템
답변 2
프로필 이미지

예스스탁 예스스탁 답변

2024-09-23 11:48:21

안녕하세요 예스스탁입니다. //ALMA Smoothing input : src(close); input : smooth(1); input : length1(25); var : offset(0.85),sigma1(7),pchange(0),avpchange(0); offset = 0.85; sigma1 = 7; pchange = (src-src[smooth]) / src * 100; var : i(0),mm(0),s(0),norm(0),sum(0),weight(0); var : r(0),rsiL(False),rsiS(False); var : length11(0),src1(0),momm(0); var : m1(0),m2(0),sm1(0),sm2(0),chandeMO(0),cL(False),cS(False); mm = offset * (length1 - 1); s = length1 / sigma1; norm = 0.0; sum = 0.0; for i = 0 to length1 - 1 { weight = exp(-1 * pow(i - mm, 2) / (2 * pow(s, 2))); norm = norm + weight; sum = sum + pchange[length1 - i - 1] * weight; } avpchange = sum / norm; //RSI r = rsi(14); rsiL = r > r[1]; rsiS = r < r[1]; //Chande Momentum length11 = 9; src1 = close; momm = src1-src1[1]; m1 = iff(momm >= 0.0 , momm , 0.0); m2 = iff(momm >= 0.0 , 0 , -momm); sm1 = AccumN(m1, length11); sm2 = AccumN(m2, length11); chandeMO = 100 * (sm1-sm2) / (sm1+sm2); cL = chandeMO > chandeMO[1]; cS = chandeMO < chandeMO[1]; //GAMA credit to author: &#169; LeafAlgo https://www.tradingview.com/v/th7NZUPM/ input : length(14); input : adaptive(true); input : volatilityPeriod(20); input : vv(1); var : gma(0),sumOfWeights(0),sigma(0),value(0),gmaColor(0),tx(0); // Calculate Gaussian Moving Average gma = 0.0; sumOfWeights = 0.0; sigma = iff(adaptive , std(close, volatilityPeriod) ,vv); for i = 0 to length - 1 { weight = exp(-pow(((i - (length - 1)) / (2 * sigma)), 2) / 2); value = highest(avpchange, i + 1) + lowest(avpchange, i + 1); gma = gma + (value * weight); sumOfWeights = sumOfWeights + weight; } gma = (gma / sumOfWeights)/2; gma = ema(gma, 7); gmaColor = iff(avpchange >= gma , rgb(0, 161, 5) , rgb(215, 0, 0)); var : currentSignal(0),barColor(Nan); currentSignal = iff(avpchange >= gma , 1 , -1); if currentSignal == 1 Then barColor = rgb(0, 186, 6); else if currentSignal == -1 Then barColor = rgb(176, 0, 0); if CrossUp(avpchange,gma) Then { Buy(); } if CrossDown(avpchange,gma) Then { Sell(); } 즐거운 하루되세요 > 하날랑 님이 쓴 글입니다. > 제목 : 트레이딩뷰의 파인스크랩터를 트레이딩뷰로 변환 부탁드립니다. > 코딩을 위한 노력을 해 보았으나 실격부족으로 어려워서 부탁을 드립니다. 다음의 트레이딩뷰의 코딩을 예스스탁 프로그램으로 맞게 변환을 부탁드립니다. 신호는 조건이 만족한 직전봉에 표기가 되고 있으니 조건 만족봉에 매수매도의 시그널이 되도록 부탁을 드립니다. //@version=5 indicator("ALMA ", overlay=true) //ALMA Smoothing src = input(close, title='Source', group = "ALMA Smoothing") smooth = input.int(1, title='Smoothing', minval=1, group = "ALMA Smoothing") length1 = input.int(25, title='Lookback', minval=1, group = "ALMA Smoothing") offset = 0.85 sigma1 = 7 pchange = ta.change(src, smooth) / src * 100 avpchange = ta.alma(pchange, length1, offset, sigma1) //RSI rsi = ta.rsi(close, 14) rsiL = rsi > rsi[1] rsiS = rsi < rsi[1] //Chande Momentum length11 = 9 src1 = close momm = ta.change(src1) f1(m) => m >= 0.0 ? m : 0.0 f2(m) => m >= 0.0 ? 0.0 : -m m1 = f1(momm) m2 = f2(momm) sm1 = math.sum(m1, length11) sm2 = math.sum(m2, length11) percent(nom, div) => 100 * nom / div chandeMO = percent(sm1-sm2, sm1+sm2) cL = chandeMO > chandeMO[1] cS = chandeMO < chandeMO[1] //GAMA credit to author: &#169; LeafAlgo https://www.tradingview.com/v/th7NZUPM/ length = input.int(14, minval=1, title="Length", group = "Gaussian Adaptive Moving Average") adaptive = input.bool(true, title="Adaptive Parameters", group = "Gaussian Adaptive Moving Average") volatilityPeriod = input.int(20, minval=1, title="Volatility Period", group = "Gaussian Adaptive Moving Average") // Calculate Gaussian Moving Average gma = 0.0 sumOfWeights = 0.0 sigma = adaptive ? ta.stdev(close, volatilityPeriod) : input.float(1.0, minval=0.1, title="Standard Deviation", group = "Gaussian Adaptive Moving Average") for i = 0 to length - 1 weight = math.exp(-math.pow(((i - (length - 1)) / (2 * sigma)), 2) / 2) value = ta.highest(avpchange, i + 1) + ta.lowest(avpchange, i + 1) gma := gma + (value * weight) sumOfWeights := sumOfWeights + weight gma := (gma / sumOfWeights) / 2 gma:= ta.ema(gma, 7) gmaColor = avpchange >= gma ? color.rgb(0, 161, 5) : color.rgb(215, 0, 0) // Color bars based on signals until the next signal occurs var int currentSignal = 0 currentSignal := avpchange >= gma ? 1 : -1//le_final ? -1 : currentSignal var color barColor = na if currentSignal == 1 barColor := color.rgb(0, 186, 6) else if currentSignal == -1 barColor := color.rgb(176, 0, 0) barcolor(barColor) plotcandle(open, high, low, close, "Bar Color", barColor, barColor, bordercolor = barColor) //Plotting ema = ta.ema(close, 7) plot(ema, color=gmaColor, linewidth=3, title="Gaussian Moving Average") plotshape(ta.crossover(avpchange,gma) and barstate.isconfirmed, "Buy Signal", text = "B", textcolor = color.white, style = shape.labelup, location = location.belowbar, color = color.rgb(0, 161, 5), offset = -1) plotshape(ta.crossunder(avpchange,gma) and barstate.isconfirmed, "Sell Signal", text = "S", textcolor = color.white, style = shape.labeldown, location = location.abovebar, color = color.rgb(215, 0, 0), offset = -1) bgcolor(ta.crossover(avpchange,gma) and barstate.isconfirmed and rsiL and cL ? color.rgb(0, 162, 5, 85): na, offset = -1) bgcolor(ta.crossunder(avpchange,gma) and barstate.isconfirmed and rsiS and cS ? color.rgb(207, 0, 0, 85): na, offset = -1) barcolor(gmaColor) alertcondition(ta.crossover(avpchange,gma) and barstate.isconfirmed, title="Buy Signal", message="Go Long! {{exchange}}:{{ticker}}") alertcondition(ta.crossunder(avpchange,gma) and barstate.isconfirmed, title="Sell Signal", message="Go Short! {{exchange}}:{{ticker}}")
프로필 이미지

하날랑

2024-09-23 14:45:34

> 예스스탁 님이 쓴 글입니다. > 제목 : Re : 트레이딩뷰의 파인스크랩터를 트레이딩뷰로 변환 부탁드립니다. > 안녕하세요 예스스탁입니다. //ALMA Smoothing input : src(close); input : smooth(1); input : length1(25); var : offset(0.85),sigma1(7),pchange(0),avpchange(0); offset = 0.85; sigma1 = 7; pchange = (src-src[smooth]) / src * 100; var : i(0),mm(0),s(0),norm(0),sum(0),weight(0); var : r(0),rsiL(False),rsiS(False); var : length11(0),src1(0),momm(0); var : m1(0),m2(0),sm1(0),sm2(0),chandeMO(0),cL(False),cS(False); mm = offset * (length1 - 1); s = length1 / sigma1; norm = 0.0; sum = 0.0; for i = 0 to length1 - 1 { weight = exp(-1 * pow(i - mm, 2) / (2 * pow(s, 2))); norm = norm + weight; sum = sum + pchange[length1 - i - 1] * weight; } avpchange = sum / norm; //RSI r = rsi(14); rsiL = r > r[1]; rsiS = r < r[1]; //Chande Momentum length11 = 9; src1 = close; momm = src1-src1[1]; m1 = iff(momm >= 0.0 , momm , 0.0); m2 = iff(momm >= 0.0 , 0 , -momm); sm1 = AccumN(m1, length11); sm2 = AccumN(m2, length11); chandeMO = 100 * (sm1-sm2) / (sm1+sm2); cL = chandeMO > chandeMO[1]; cS = chandeMO < chandeMO[1]; //GAMA credit to author: &#169; LeafAlgo https://www.tradingview.com/v/th7NZUPM/ input : length(14); input : adaptive(true); input : volatilityPeriod(20); input : vv(1); var : gma(0),sumOfWeights(0),sigma(0),value(0),gmaColor(0),tx(0); // Calculate Gaussian Moving Average gma = 0.0; sumOfWeights = 0.0; sigma = iff(adaptive , std(close, volatilityPeriod) ,vv); for i = 0 to length - 1 { weight = exp(-pow(((i - (length - 1)) / (2 * sigma)), 2) / 2); value = highest(avpchange, i + 1) + lowest(avpchange, i + 1); gma = gma + (value * weight); sumOfWeights = sumOfWeights + weight; } gma = (gma / sumOfWeights)/2; gma = ema(gma, 7); gmaColor = iff(avpchange >= gma , rgb(0, 161, 5) , rgb(215, 0, 0)); var : currentSignal(0),barColor(Nan); currentSignal = iff(avpchange >= gma , 1 , -1); if currentSignal == 1 Then barColor = rgb(0, 186, 6); else if currentSignal == -1 Then barColor = rgb(176, 0, 0); if CrossUp(avpchange,gma) Then { Buy(); } if CrossDown(avpchange,gma) Then { Sell(); } 즐거운 하루되세요 > 하날랑 님이 쓴 글입니다. > 제목 : 트레이딩뷰의 파인스크랩터를 트레이딩뷰로 변환 부탁드립니다. > 코딩을 위한 노력을 해 보았으나 실격부족으로 어려워서 부탁을 드립니다. 다음의 트레이딩뷰의 코딩을 예스스탁 프로그램으로 맞게 변환을 부탁드립니다. 신호는 조건이 만족한 직전봉에 표기가 되고 있으니 조건 만족봉에 매수매도의 시그널이 되도록 부탁을 드립니다. //@version=5 indicator("ALMA ", overlay=true) //ALMA Smoothing src = input(close, title='Source', group = "ALMA Smoothing") smooth = input.int(1, title='Smoothing', minval=1, group = "ALMA Smoothing") length1 = input.int(25, title='Lookback', minval=1, group = "ALMA Smoothing") offset = 0.85 sigma1 = 7 pchange = ta.change(src, smooth) / src * 100 avpchange = ta.alma(pchange, length1, offset, sigma1) //RSI rsi = ta.rsi(close, 14) rsiL = rsi > rsi[1] rsiS = rsi < rsi[1] //Chande Momentum length11 = 9 src1 = close momm = ta.change(src1) f1(m) => m >= 0.0 ? m : 0.0 f2(m) => m >= 0.0 ? 0.0 : -m m1 = f1(momm) m2 = f2(momm) sm1 = math.sum(m1, length11) sm2 = math.sum(m2, length11) percent(nom, div) => 100 * nom / div chandeMO = percent(sm1-sm2, sm1+sm2) cL = chandeMO > chandeMO[1] cS = chandeMO < chandeMO[1] //GAMA credit to author: &#169; LeafAlgo https://www.tradingview.com/v/th7NZUPM/ length = input.int(14, minval=1, title="Length", group = "Gaussian Adaptive Moving Average") adaptive = input.bool(true, title="Adaptive Parameters", group = "Gaussian Adaptive Moving Average") volatilityPeriod = input.int(20, minval=1, title="Volatility Period", group = "Gaussian Adaptive Moving Average") // Calculate Gaussian Moving Average gma = 0.0 sumOfWeights = 0.0 sigma = adaptive ? ta.stdev(close, volatilityPeriod) : input.float(1.0, minval=0.1, title="Standard Deviation", group = "Gaussian Adaptive Moving Average") for i = 0 to length - 1 weight = math.exp(-math.pow(((i - (length - 1)) / (2 * sigma)), 2) / 2) value = ta.highest(avpchange, i + 1) + ta.lowest(avpchange, i + 1) gma := gma + (value * weight) sumOfWeights := sumOfWeights + weight gma := (gma / sumOfWeights) / 2 gma:= ta.ema(gma, 7) gmaColor = avpchange >= gma ? color.rgb(0, 161, 5) : color.rgb(215, 0, 0) // Color bars based on signals until the next signal occurs var int currentSignal = 0 currentSignal := avpchange >= gma ? 1 : -1//le_final ? -1 : currentSignal var color barColor = na if currentSignal == 1 barColor := color.rgb(0, 186, 6) else if currentSignal == -1 barColor := color.rgb(176, 0, 0) barcolor(barColor) plotcandle(open, high, low, close, "Bar Color", barColor, barColor, bordercolor = barColor) //Plotting ema = ta.ema(close, 7) plot(ema, color=gmaColor, linewidth=3, title="Gaussian Moving Average") plotshape(ta.crossover(avpchange,gma) and barstate.isconfirmed, "Buy Signal", text = "B", textcolor = color.white, style = shape.labelup, location = location.belowbar, color = color.rgb(0, 161, 5), offset = -1) plotshape(ta.crossunder(avpchange,gma) and barstate.isconfirmed, "Sell Signal", text = "S", textcolor = color.white, style = shape.labeldown, location = location.abovebar, color = color.rgb(215, 0, 0), offset = -1) bgcolor(ta.crossover(avpchange,gma) and barstate.isconfirmed and rsiL and cL ? color.rgb(0, 162, 5, 85): na, offset = -1) bgcolor(ta.crossunder(avpchange,gma) and barstate.isconfirmed and rsiS and cS ? color.rgb(207, 0, 0, 85): na, offset = -1) barcolor(gmaColor) alertcondition(ta.crossover(avpchange,gma) and barstate.isconfirmed, title="Buy Signal", message="Go Long! {{exchange}}:{{ticker}}") alertcondition(ta.crossunder(avpchange,gma) and barstate.isconfirmed, title="Sell Signal", message="Go Short! {{exchange}}:{{ticker}}")