通达信主图叠加真是MACD指标源码

[复制链接]
查看30 | 回复0 | 2022-7-24 07:42:26 | 显示全部楼层 |阅读模式

叠加真是MACD指标源码

DIFZ:=EMA(C,12)-EMA(C,26);
DEAZ:=EMA(DIFZ,9);
MACDZ:=8*(DIFZ-DEAZ);
NN:=60;
A01:=REF(HIGH,NN)=HHV(HIGH,2*NN+1); B01:=FILTER(A01,NN);
C01:=BACKSET(B01,NN+1); D01:=FILTER(C01,NN);
A02:=REF(LOW,NN)=LLV(LOW,2*NN+1); B02:=FILTER(A02,NN);
C02:=BACKSET(B02,NN+1); D02:=FILTER(C02,NN);
E01:=(REF(LLV(LOW,2*NN),1)+REF(HHV(HIGH,2*NN),1))/2; E02:=(HIGH+LOW)/2;
H01:=(D01 AND NOT(D02 AND E01>=E02)) OR ISLASTBAR OR BARSCOUNT(CLOSE)=1;
L01:=(D02 AND NOT(D01 AND E01<E02));
X01:=REF(BARSLAST(H01),1)+1; F01:=BACKSET(H01 AND COUNT(L01,X01)>0,LLVBARS(IF(L01,LOW,10000),X01));
G01:=F01>REF(F01,1); I01:=BACKSET(G01,2); LD:=I01>REF(I01,1);
WW:=BACKSET(ISLASTBAR,BARSLAST(LD)+1);
QQ:=WW>REF(WW,1);
RCC:REF(L,BARSLAST(QQ));
DRAWBAND(MACDZ+RCC,RGB(70,20,20),RCC,RGB(100,100,100));
DRAWBAND(DIFZ*4+RCC,RGB(255,140,140),EMA(DIFZ*4+RCC,9),RGB(147,234,249));
STICKLINE((RCC+MACDZ)>RCC AND (RCC+MACDZ)<=REF(RCC+MACDZ,1),RCC,RCC+MACDZ,0,0),COLOR400080;
STICKLINE((RCC+MACDZ)>RCC AND (RCC+MACDZ)>REF(RCC+MACDZ,1),RCC,RCC+MACDZ,0,0),COLOR00FFFF;
STICKLINE((RCC+MACDZ)<=RCC AND (RCC+MACDZ)<=REF(RCC+MACDZ,1),RCC,RCC+MACDZ,0,0),COLOR008080;
STICKLINE((RCC+MACDZ)<=RCC AND (RCC+MACDZ)>REF(RCC+MACDZ,1),RCC,RCC+MACDZ,0,0),COLORC080FF;
MA1:MA(CLOSE,M1);
MA2:MA(CLOSE,M2);
MA3:MA(CLOSE,M3);
MA4:MA(CLOSE,M4);

1842233409.jpg

1842233409.jpg

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则