一、通达信PDI趋势指标公式
N:=14;
M:=9;
T:=120;
AN1:=20;
MTR:=SUM(MAX(MAX(HIGH-LOW,ABS(HIGH-REF(CLOSE,1))),ABS(REF(CLOSE,1)-LOW)),N);
HD :=HIGH-REF(HIGH,1);
LD :=REF(LOW,1)-LOW;
DMP:=SUM(IF(HD>0&&HD>LD,HD,0),N);
DMM:=SUM(IF(LD>0&&LD>HD,LD,0),N);
PDI: DMP*100/MTR;
MDI: DMM*100/MTR;
ADX: MA(ABS(MDI-PDI)/(MDI+PDI)*100,M) NODRAW ;
ADXR:(ADX+REF(ADX,M))/2 NODRAW;
X轴:20.00,COLORRED,LINETHICK2;
AA1:=REF(PDI,AN1)=LLV(PDI,2*AN1+1);
QY1:=BACKSET(AA1,AN1+1);
ACC1:=FILTER(QY1,AN1) AND PDI=LLV(PDI,AN1+1);
JQS:=CROSS(BACKSET(BARSTATUS=2,SUMBARS(ACC1,1)),0.5);
YQS:=CROSS(BACKSET(BARSTATUS=2,SUMBARS(ACC1,2)),0.5);
CYQS:=CROSS(BACKSET(BARSTATUS=2,SUMBARS(ACC1,3)),0.5);
TJ1:=CROSS(PDI,20) NODRAW;
TJ2:=BACKSET(TJ1,BARSLAST(CROSS(PDI,20))+1);
TJ3:=FILTER(TJ2,BARSLAST(CROSS(PDI,20)));
TJ4:=CROSS(BACKSET(BARSTATUS=2,SUMBARS(TJ3,2)),0.5);
上穿距今:BARSLAST(CROSS(PDI,20)) NODRAW;
近趋势线:DRAWLINE(JQS,PDI,TJ4,20,1),COLORYELLOW,LINETHICK2;
远趋势线:DRAWLINE(YQS,PDI,TJ4,20,1),COLORMAGENTA,LINETHICK2;
超远趋势线:DRAWLINE(CYQS,PDI,TJ4,20,1),COLORRED,LINETHICK2;
二、通达信底部捞钱选股指标公式
RSV:=(((CLOSE - LLV(LOW,9)) / (HHV(HIGH,9) - LLV(LOW,9))) * 100);
KV:=SMA(RSV,3,1);
DV:=SMA(KV,3,1);
JV:=3*KV-2*DV;
VAR1:=(((CLOSE - MA(CLOSE,6)) / MA(CLOSE,6)) * 100);
VAR2:=(((CLOSE - MA(CLOSE,12)) / MA(CLOSE,12)) * 100);
VAR3:=(((CLOSE - MA(CLOSE,24)) / MA(CLOSE,24)) * 100);
VAR4:=(((VAR1 + (2 * VAR2)) + (3 * VAR3)) / 6);
VAR5:=MA(VAR4,3);
DB:=IF(VAR5,20,0);
HDY:=EMA(100*(C-LLV(LOW,34))/(HHV(H,34)-LLV(LOW,34)),3);
FX:=HDY<=10;
XG:CROSS(JV,KV) AND (DB >= 20) AND FX,LINETHICK1;