以下是通达信压力支撑画线副图指标公式源码(无源码的请下载附件导入)
SHORT:=6;LONG:=13;MID:=5;
DIF:EMA(CLOSE,SHORT)-EMA(CLOSE,LONG);
DEA:EMA(DIF,MID);
MACD:(DIF-DEA)*2,COLORSTICK;
M1:=13;
M2:=13;
A1:=REF(DIF,M1)=HHV(DIF,2*M1+1);B1:=FILTER(A1,M1);C1:=BACKSET(B1,M1+1);D1:=FILTER(C1,M1);E1:=BACKSET(ISLASTBAR,BARSLAST(D1)+1);F1:=E1>REF(E1,1);
A2:=REF(DIF,M2)=LLV(DIF,2*M2+1);B2:=FILTER(A2,M2);C2:=BACKSET(B2,M2+1);D2:=FILTER(C2,M2);E2:=BACKSET(ISLASTBAR,BARSLAST(D2)+1);F2:=E2>REF(E2,1);
压力线:DRAWLINE(D1,DIF,F1,DIF,1),COLORGREEN;
支撑线:DRAWLINE(D2,DIF,F2,DIF,0),COLORRED;
G3:=FILTERX(支撑线>REF(支撑线,1) && DIF>支撑线 && REF(支撑线,1)=REF(DIF,1),2);
底抬高:DRAWLINE(D2,DIF,G3,支撑线,1),COLORYELLOW;
2154466329.jpg
|