RSV:=(CLOSE-LLV(LOW,N))/(HHV(HIGH,N)-LLV(LOW,N))*100;
K:SMA(RSV,M1,1),COLORFFFFFF;
D:SMA(K,M2,1),COLOR00FFFF;
J:3*K-2*D,COLORFF1AA9;
DIFF:EMA(CLOSE,12)-EMA(CLOSE,26),COLORFFFFFF,LINETHICK0;
DEA:EMA(DIFF,9),LINETHICK0,COLOR00FFFF;
MACD:2*(DIFF-DEA),COLOR00DDDD,LINETHICK0;
KX:=BARSSINCE(CLOSE);
HK:=HHV(K,KX);
HD:=HHV(D,KX);
HJ:=HHV(J,KX);
LK:=LLV(K,KX);
LD:=LLV(D,KX);
LJ:=LLV(J,KX);
HKMAX:=MAX(HK,MAX(HD,HJ));
LKMIN:=MIN(LK,MIN(LD,LJ));
KDBL:=(HKMAX+LKMIN)/2;
KDC:=HKMAX-LKMIN;
MHF:=HHV(DIFF,KX);
MHD:=HHV(DEA,KX);
MHM:=HHV(MACD,KX);
MLF:=LLV(DIFF,KX);
MLD:=LLV(DEA,KX);
MLM:=LLV(MACD,KX);
HMAX:=MAX(MHF,MAX(MHD,MHM));
LMIN:=MIN(MLF,MIN(MLD,MLM));
FDBL:=(HMAX+LMIN)/100;
FDC:=HMAX-LMIN;
SH:=(0-FDBL)*(KDC/FDC)+KDBL;
DIFFA:(DIFF-FDBL)*(KDC/FDC)+KDBL,COLOR00AA00,LINETHICK2;
DEAA:(DEA-FDBL)*(KDC/FDC)+KDBL,COLORCCBBBB,LINETHICK2;
MACDA:=(MACD-FDBL)*(KDC/FDC)+KDBL;
CDA:=MACD REF(MACD,1) AND MACD
CDB:=MACD =REF(MACD,1) AND MACD
CDC:=MACD REF(MACD,1) AND MACD
CDD:=MACD =REF(MACD,1) AND MACD
STICKLINE(CDB,SH,MACDA,1,0),COLOR6841FF;
STICKLINE(CDA,SH,MACDA,1,0),COLOR95FFFF;
STICKLINE(CDC,SH,MACDA,1,0),COLORFFFFA0;