커뮤니티

부탁드립니다

프로필 이미지
이대표
2020-03-16 22:59:26
429
글번호 136937
답변완료
지표전환 부탁드립니다 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)
지표
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2020-03-17 15:12:35

안녕하세요 예스스탁입니다. input : RSI_Period(6),SF(5),QQE(3),ThreshHold(3); var : src(0),Wilders_Period(0),RSIv(0),RsiMa(0),AtrRSI(0),MaAtrRsi(0),dar(0); var : longband(0),shortband(0),trend(0); var : DeltaFastAtrRsi(0),RSIndex(0),newshortband(0),newlongband(0),cross_1(false),FastAtrRsiTL(0); input : length(50),mult(0.35); var : basis(0),dev(0),upper(0),lower(0),color_bar(0); var : QQEzlong(0),QQEzshort(0),Zero(0); src = close; Wilders_Period = RSI_Period * 2 - 1; Rsiv = rsi(RSI_Period); RsiMa = ema(Rsiv, 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 = iff(RSIndex[1] > longband[1] and RSIndex > longband[1],max(longband[1], newlongband),newlongband); shortband = iff(RSIndex[1] < shortband[1] and RSIndex < shortband[1],min(shortband[1], newshortband),newshortband); cross_1 = crossup(longband[1], RSIndex) or CrossDown(longband[1], RSIndex); trend = iff(crossup(RSIndex, shortband[1]) or CrossDown(RSIndex, shortband[1]), 1 ,iff(cross_1, -1 ,trend[1])); FastAtrRsiTL = iff(trend == 1 , longband , shortband); //////////////////// basis = ma(FastAtrRsiTL - 50, length); dev = mult * std(FastAtrRsiTL - 50, length); upper = basis + dev; lower = basis - dev; color_bar = iff(RsiMa - 50 > upper ,red,iff(RsiMa - 50 < lower,blue,gray)); // // Zero cross QQEzlong = 0; QQEzlong = QQEzlong[1]; QQEzshort = 0; QQEzshort = QQEzshort[1]; QQEzlong = iff(RSIndex >= 50 , QQEzlong + 1 , 0); QQEzshort = iff(RSIndex < 50 , QQEzshort + 1 , 0); // PlotBaseLine1(0,"0",white); input : RSI_Period2(6),SF2(5),QQE2(1.61),ThreshHold2(3); var : src2(0),Wilders_Period2(0),Rsi2(0),RsiMa2(0),AtrRsi2(0),MaAtrRsi2(0); var : dar2(0),longband2(0),shortband2(0),trend2(0),DeltaFastAtrRsi2(0); var : RSIndex2(0),newshortband2(0),newlongband2(0); var : cross_2(false),FastAtrRsi2TL(0); src2 = close; Wilders_Period2 = RSI_Period2 * 2 - 1; Rsi2 = rsi(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 = iff(RSIndex2[1] > longband2[1] and RSIndex2 > longband2[1] ,max(longband2[1], newlongband2) , newlongband2); shortband2 = iff(RSIndex2[1] < shortband2[1] and RSIndex2 < shortband2[1] ,min(shortband2[1], newshortband2) , newshortband2); cross_2 = crossup(longband2[1], RSIndex2) or CrossDown(longband2[1], RSIndex2); trend2 = iff(crossup(RSIndex2, shortband2[1]) or CrossDown(RSIndex2, shortband2[1]) , 1 , iff(cross_2 , -1 , trend2[1])); FastAtrRsi2TL = iff(trend2 == 1 , longband2 , shortband2); var : QQE2zlong(0),QQE2zshort(0),hcolor2(0); var : Greenbar1(false),Greenbar2(false),Redbar1(false),Redbar2(false); QQE2zlong = 0; QQE2zlong = QQE2zlong[1]; QQE2zshort = 0; QQE2zshort = QQE2zshort[1]; QQE2zlong = iff(RSIndex2 >= 50 , QQE2zlong + 1 , 0); QQE2zshort = iff(RSIndex2 < 50 , QQE2zshort + 1 , 0); hcolor2 = iff(RsiMa2 - 50 > ThreshHold2 ,red,iff(RsiMa2 - 50 < 0 - ThreshHold2 ,blue,GRAY)); plot1(FastAtrRsi2TL - 50,"QQE Line"); plot2(RsiMa2 - 50,"Histo2",hcolor2); Greenbar1 = RsiMa2 - 50 > ThreshHold2; Greenbar2 = RsiMa - 50 > upper; Redbar1 = RsiMa2 - 50 < 0 - ThreshHold2; Redbar2 = RsiMa - 50 < lower; plot3(iff(Greenbar1 and Greenbar2 == 1 , RsiMa2 - 50 , nan),"QQE Up"); plot4(iff(Redbar1 and Redbar2 == 1 , RsiMa2 - 50 ,nan),"QQE Down"); 즐거운 하루되세요 > 이대표 님이 쓴 글입니다. > 제목 : 부탁드립니다 > 지표전환 부탁드립니다 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)