抄底买入!止盈卖出!
MTR:=EMA(MAX(MAX(HIGH-LOW,ABS(HIGH-REF(CLOSE,1))),ABS(REF(CLOSE,1)-LOW)),14);
HD :=HIGH-REF(HIGH,1);
LD :=REF(LOW,1)-LOW;
DMP:=EMA(IF(HD>0&&HD>LD,HD,0),14);
DMM:=EMA(IF(LD>0&&LD>HD,LD,0),14);
PDI:=DMP*100/MTR;
MDI:=DMM*100/MTR;
ADX:=EMA(ABS(MDI-PDI)/(MDI+PDI)*100,6);
ADXR:=EMA(ADX,6);
OK:=COUNT(EVERY(PDI<MIN(MDI,MIN(ADX,ADXR)),8),10)>0 AND CROSS(PDI,MAX(MDI,MAX(ADX,ADXR))) ;
TYP:=(HIGH+LOW+CLOSE)/3;
CCI:=MA((TYP-MA(TYP,14))/(0.015*AVEDEV(TYP,14))+400,5);
A9:=TROUGH(CCI,34,1);
BUY1:=A9>REF(A9,1) OR (OK AND PDI<45);
TT:=BARSLAST(BUY1);
止盈:=(REF(COUNT(C<REF(C,1)*0.97,TT-1)=0,1) AND C<REF(C,1)*0.97);
止损:=(C<REF(L,TT) AND REF(COUNT(C<REF(L,TT),TT-1)=0,1))AND REF(COUNT(止盈,TT-1)=0,1);
YY:=止盈 OR 止损 ;
BUY:=IF(REF(COUNT(YY,TT-1)=0,1) AND BUY1,0,BUY1);
DRAWTEXT(BUY,L*0.98,'买入');
DRAWICON(BUY,L*0.99,23);
DRAWTEXT(YY AND C>=REF(C,TT-1),H*1.01,'止盈');
DRAWTEXT(YY AND C<REF(C,TT-1),H*1.01,'止损');
DRAWICON(YY,H*1,12);
JJ:=(CLOSE+HIGH+LOW)/3;
A:=EMA(JJ,10);
B:=REF(A,1);
STICKLINE(A>B,A,B,5,0),COLORYELLOW;
STICKLINE(A<B,A,B,5,0),COLORBLUE;
M1:EMA(CLOSE,3);
M2:EMA(CLOSE,8);
M3:EMA(M2,13);
M4:EMA(M2,55);
VAR1:=EMA(M3,55);
M5:EMA(M4,81), COLORRED,LINETHICK2;
VAR2:=(REF(HIGH,1)+REF(LOW,1))/2;
VAR3:=MA(CLOSE,21)+2*STD(CLOSE,21);
DRAWICON(CROSS(VAR2,VAR3),HIGH*1.035,2);
DRAWTEXT(CROSS(VAR2,VAR3),HIGH*1.02,'卖出'), COLORGREEN;
VAR4:=REF(CLOSE,1);
VAR5:=SMA(MAX(CLOSE-VAR4,0),7,1)/SMA(ABS(CLOSE-VAR4),7,1)*100;
VAR6:=CROSS(79,VAR5);
VAR7:=FILTER(VAR6,4);
DRAWICON(VAR7,HIGH*1.035,2);
DRAWTEXT(VAR7,HIGH*1.02,'卖出'), COLORGREEN;
A7:=(2*C+H+L)/4;
VAR10:=LLV(LOW,34);
VAR11:=HHV(HIGH,34);
SK:=EMA((A7-VAR1)/(VAR2-VAR1)*100,7);
SD:=EMA(0.667*REF(SK,1)+0.333*SK,5);
DRAWTEXT(IF(COUNT(CLOSE<REF(CLOSE,1),8)/8>6/10 AND VOL>=1.5*MA(VOL,5) AND
COUNT(SK>=SD,3) AND REF(LOW,1)=LLV(LOW,120),1,0),LOW,'●买进') ,COLORRED;
DRAWTEXT(IF(COUNT(CLOSE<REF(CLOSE,1),13)/13>6/10 AND
COUNT(SK>SD,6) AND REF(LOW,5)=LLV(LOW,120) AND REF(CLOSE>=OPEN,4) AND
REF(CLOSE>OPEN,3) AND REF(CLOSE>OPEN,2) AND REF(OPEN>CLOSE,1) AND
OPEN>REF(CLOSE,1),1,0),LOW,'●买进'), COLORRED;
D:=MA(CLOSE,80)-MA(CLOSE,10)/3;
DRAWTEXT(IF(CLOSE<D AND VOL/240>MA(VOL,5)/240 AND CLOSE>REF(CLOSE,1)*1.08
AND CLOSE<MA(CLOSE,13)*1.3,1,0),LOW,'●抄底'),COLORRED;
648422791.jpg
|