DMI(7)+价量线
{ 量价线任何一次上穿黑马线都是买入时机
n=7,m=7,n2=12,n3=24}
TR := SUM(MAX(MAX(HIGH-LOW,ABS(HIGH-REF(CLOSE,1))),ABS(LOW-REF(CLOSE,1))),N);
HD := HIGH-REF(HIGH,1);
LD := REF(LOW,1)-LOW;
DMP:= SUM(IF(HD>0 AND HD>LD,HD,0),N);
DMM:= SUM(IF(LD>0 AND LD>HD,LD,0),N);
PDI: DMP*100/TR,colorwhite;
MDI: DMM*100/TR,coloryellow;
ADX: MA(ABS(MDI-PDI)/(MDI+PDI)*100,M),colorff00ff;
ADXRADX+REF(ADX,M))/2,color00ff00;
DD:50;
DRAWTEXT(CROSS(MDI,DD),80,'[底部]'),Color0000FF;
抄底1:COUNT(PDI<MDI,3)=3 AND REF(ADX>50,1) AND REF(ADX,1)>=REF(ADX,2) AND
ADX<REF(ADX,1);
逃顶1:=COUNT(PDI>MDI,3)=3 AND REF(ADX>50,1) AND REF(ADX,1)>=REF(ADX,2) AND
ADX<REF(ADX,1);
DRAWTEXT(抄底1,PDI,'抄底');
DRAWTEXT(逃顶1,ADX,'逃顶');
STICKLINE(抄底1,0,20,1,0),LINETHICK3,COLORyellow;
LC := REF(CLOSE,1);
RSI2:=SMA(MAX(CLOSE-LC,0),N2,1)/SMA(ABS(CLOSE-LC),N2,1)*100,COLORFFFFFF,LINETHICK1;
RSI3:=SMA(MAX(CLOSE-LC,0),N3,1)/SMA(ABS(CLOSE-LC),N3,1)*100,COLORFFFFFF,LINETHICK1;
A:20;
VAR1:=RSI2<RSI3;
STICKLINE(COUNT(VAR1,10)=9 AND CROSS(RSI2,RSI3) ,20,50,1,0),LINETHICK3,COLORRED;
|