通达信MACD变形指标公式
2020/3/29 19:05:18
MAV:=(2*C+H+L)/4;
VAR1:=LLV(LOW,21);
VAR2:=HHV(HIGH,21);
SK:=EMA((MAV-VAR1)/(VAR2-VAR1)*200-100,8);
SD:=EMA(0.667*REF(SK,1)+0.333*SK,1);
SJ:=3*SK-2*SD;
SJ1:=(SJ<-60)*5-105;
SJ2:=IF(SJ1,0,5)-105;
SJ3:=(SJ<+60)*5+100;
SJ4:=105-IF(SJ3,0,5);
RSV:=(CLOSE-LLV(LOW,5))/(HHV(HIGH,5)-LLV(LOW,5))*200-100;
K:=SMA(RSV,3,1);
D:=SMA(K,2,1);
J1:=3*K-2*D;
J2:=MA(J1,2);
DIF0:=(EMA(CLOSE,12)-EMA(CLOSE,26))*100;
HHD:=HHV(DIF0,99);LLD:=LLV(DIF0,99);MMD:=(HHD-LLD)/2;
MMD0:=CONST(ISLASTBAR*MMD);
DIF1:=DIF0/MMD0*100;
DEA1:=EMA(DIF1,9);
MACD1:=(DIF1-DEA1)*2;
HHI:=HHV(DIF1,99);LLI:=LLV(DIF1,99);
HHM:=HHV(MACD1,99);LLM:=LLV(MACD1,99);
{www.tou18.cn 投股票网_最新股票指标公式}
HH:=CONST(ISLASTBAR*MAX(+105,MAX(HHI,HHM)));
LL:=CONST(ISLASTBAR*MIN(-105,MIN(LLI,LLM)));
DRAWBAND( HH,RGB(20,20,70), SK,RGB(00,00,00));
DRAWBAND( LL,RGB(00,00,00), SK,RGB(70,20,20));
{DRAWBAND( SD,RGB(70,40,40), SK,RGB(40,40,60));}
DRAWBAND(SJ1,RGB(90,40,40),SJ2,RGB(00,00,00));
DRAWBAND(SJ4,RGB(40,40,99),SJ3,RGB(00,00,00));
DRAWBAND( J1,RGB(00,150,00), J2,RGB(00,00,250));
STICKLINE(CROSS(SK,SD),LL,LL+5,0,0),COLORLIGRAY;
STICKLINE(CROSS(SD,SK),HH,HH-5,0,0),COLORLIGRAY;
DIF:DIF1;
DEA:DEA1;
MACD:MACD1,COLORSTICK;
投 股票网 www.to u18.cn
股市公式下载推荐