예스스탁
예스스탁 답변
2022-09-29 10:52:05
안녕하세요
예스스탁입니다.
input : RSI_Period(14),SF(5),QQE(4.238),ThreshHold(10);
var : Wilders_Period(0),Rsiv(0),RsiMa(0),ATrRsi(0),MaAtrRsi(0),dar(0);
var : longband(0),shortband(0),trend(0),DeltaFastAtrRsi(0),RSIndex(0),newshortband(0),newlongband(0);
var : FastAtrRsiTL(0),hcolor(0);
var : QQExlong(0),QQExshort(0);
var : QQEzlong(0),QQEzshort(0);
var : QQEclong(0),QQEcshort(0);
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);
trend = iff(CrossUp(RSIndex, shortband[1]) or CrossDown(RSIndex, shortband[1]),1,iff(CrossUp(longband[1], RSIndex) or CrossDown(longband[1], RSIndex),-1,trend));
FastAtrRsiTL = iff(trend==1 , longband , shortband);
QQExlong = iff(FastAtrRsiTL< RSIndex , QQExlong+1 , 0);
QQExshort = iff(FastAtrRsiTL> RSIndex , QQExshort+1 , 0);
QQEzlong = iff(RSIndex>=50 , QQEzlong+1 , 0);
QQEzshort = iff(RSIndex<50 , QQEzshort+1 , 0);
QQEclong = iff(RSIndex>(50+ThreshHold) , QQEclong+1 , 0);
QQEcshort = iff(RSIndex<(50-ThreshHold) , QQEcshort+1 , 0);
hcolor = IFf((RsiMa-50)>ThreshHold , green ,IFf((RsiMa-50)<0-ThreshHold , red , orange));
plot1(FastAtrRsiTL-50,"1",blue);
plot2(RsiMa-50,"2",orange);
plot3(RsiMa-50,"3",hcolor);
PlotBaseLine1(0,"기준선1",black);
PlotBaseLine2(ThreshHold,"기준선2",green);
PlotBaseLine3(0-ThreshHold,"기준선3",red);
즐거운 하루되세요
> alltoone 님이 쓴 글입니다.
> 제목 : 문의 드립니다.
> 아래는 트레이딩 뷰 지표입니다. 이 지표를 전환할 수 있을까요?
항상 답변 감사드립니다.
study("QQE MT4 Glaz-modified by JustUncleL")
RSI_Period = input(14,title='RSI Length')
SF = input(5,title='RSI Smoothing')
QQE=input(4.238,title='Fast QQE Factor')
ThreshHold=input(10,title="Thresh-hold")
//
sQQEx = input(false,title="Show Smooth RSI, QQE Signal crosses")
sQQEz = input(false,title="Show Smooth RSI Zero crosses")
sQQEc = input(false,title="Show Smooth RSI Thresh Hold Channel Exits")
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
trend := cross(RSIndex, shortband[1])?1:cross(longband[1], RSIndex)?-1:nz(trend[1],1)
FastAtrRsiTL = trend==1? longband: shortband
//
// Find all the QQE Crosses
QQExlong = 0, QQExlong := nz(QQExlong[1])
QQExshort = 0, QQExshort := nz(QQExshort[1])
QQExlong := sQQEx and FastAtrRsiTL< RSIndex ? QQExlong+1 : 0
QQExshort := sQQEx and FastAtrRsiTL> RSIndex ? QQExshort+1 : 0
// Zero cross
QQEzlong = 0, QQEzlong := nz(QQEzlong[1])
QQEzshort = 0, QQEzshort := nz(QQEzshort[1])
QQEzlong := sQQEz and RSIndex>=50 ? QQEzlong+1 : 0
QQEzshort := sQQEz and RSIndex<50 ? QQEzshort+1 : 0
//
// Thresh Hold channel Crosses give the BUY/SELL alerts.
QQEclong = 0, QQEclong := nz(QQEclong[1])
QQEcshort = 0, QQEcshort := nz(QQEcshort[1])
QQEclong := sQQEc and RSIndex>(50+ThreshHold) ? QQEclong+1 : 0
QQEcshort := sQQEc and RSIndex<(50-ThreshHold) ? QQEcshort+1 : 0
// QQE exit from Thresh Hold Channel
plotshape(sQQEc and QQEclong==1 ? RsiMa-50:na , title="QQE XC Over Channel", style=shape.diamond, location=location.absolute, color=olive, transp=0, size=size.small, offset=0)
plotshape(sQQEc and QQEcshort==1 ? RsiMa-50:na , title="QQE XC Under Channel", style=shape.diamond, location=location.absolute, color=red, transp=0, size=size.small, offset=0)
// QQE crosses
plotshape(sQQEx and QQExlong==1 ? FastAtrRsiTL[1]-50:na , title="QQE XQ Cross Over", style=shape.circle, location=location.absolute, color=lime, transp=0, size=size.small,offset=-1)
plotshape(sQQEx and QQExshort==1 ? FastAtrRsiTL[1]-50 : na , title="QQE XQ Cross Under", style=shape.circle, location=location.absolute, color=blue, transp=0, size=size.small,offset=-1)
// Signal crosses zero line
plotshape(sQQEz and QQEzlong==1? RsiMa-50:na, title="QQE XZ Zero Cross Over", style=shape.square, location=location.absolute, color=aqua, transp=0, size=size.small,offset=0)
plotshape(sQQEz and QQEzshort==1? RsiMa-50:na, title="QQE XZ Zero Cross Under", style=shape.square, location=location.absolute, color=fuchsia, transp=0, size=size.small,offset=0)
hcolor = (RsiMa-50)>ThreshHold? green : (RsiMa-50)<0-ThreshHold ? red : orange
plot(FastAtrRsiTL-50,color=blue,transp=0,linewidth=2)
p1=plot(RsiMa-50,color=orange,transp=0,linewidth=2)
plot(RsiMa-50,color=hcolor,transp=50,style=columns)
hZero = hline(0,color=black,linestyle=dashed,linewidth=1)
hUpper= hline(ThreshHold,color=green,linestyle=dashed,linewidth=2)
hLower= hline(0-ThreshHold,color=red,linestyle=dashed,linewidth=2)
fill(hUpper,hLower,color=gray,transp=80)
//EOF