通达信macd+kdj叠加公式指标
{牛牛指标网提供:www.tdx001.com}
复制内容到剪贴板
- {MACD+KDJ}
- {参数 N 2 90 9 M1 2 30 3 M2 2 30 3}
- 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>0;
- CDB:=MACD>=REF(MACD,1) AND MACD>0;
- CDC:=MACD>REF(MACD,1) AND MACD<0;
- CDD:=MACD<=REF(MACD,1) AND MACD<0;
- STICKLINE(CDB,SH,MACDA,1,0),COLOR6841FF;
- STICKLINE(CDA,SH,MACDA,1,0),COLOR95FFFF;
- STICKLINE(CDC,SH,MACDA,1,0),COLORFFFFA0;
- STICKLINE(CDD,SH,MACDA,1,0),COLORFFCD00;
83633587.gif
|