红买绿卖,优化了一些。
RSV:= (CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
FASTK:=SMA(RSV,3,1);
A:SMA(FASTK,3,1);
A1:SMA(A,3,1);
A2:SMA(A,5,1),COLORBLUE;
ZA:=A
ZV:=A1
ZA0:=CROSS(A,A1);
ZV0:=CROSS(A1,A);
YA:80;
YV:20,COLORGREEN;
DIFF:=EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:=EMA(DIFF,10);
ZA1:=DIFF
ZV1:=DEA DIFF;
ZA11:=CROSS(DIFF,DEA);
ZV11:=CROSS(DEA,DIFF);
MA1:=MA(CLOSE,1);
MA2:=MA(CLOSE,2);
MA3:=MA(CLOSE,3);
MA5:=MA(CLOSE,5);
MA10:=MA(CLOSE,10);
MA20:=MA(CLOSE,20);
MA40:=MA(CLOSE,40);
MA60:=MA(CLOSE,60);
MA120:=MA(CLOSE,120);
MA250:=MA(CLOSE,250);
ZA2:=MA5 MA10;
ZV2:=MA10
ZA22:=CROSS(MA5,MA10);
ZV22:=CROSS(MA10,MA5);
AA1:=IF(ZA0 ZA1 ZA2,1,0);
AA2:=IF(ZA ZA11 ZA2,1,0);
AA3:=IF(ZA ZA1 ZA22,1,0);
VV1:=IF(ZV0 ZV1 ZV2,1,0);
VV2:=IF(ZV ZV11 ZV2,1,0);
VV3:=IF(ZV ZV1 ZV22,1,0);
AAA:=IF((AA1=1||AA2=1||AA3=1),1,0);
VVV:=IF((VV1=1||VV2=1||VV3=1),1,0);
多:=(MA20 MA40 AND MA20 MA60 AND MA40 MA60) AND AAA ,COLORRED;
空:=(MA20 MA40 AND MA20 MA60 AND MA40 MA60) AND VVV ,COLORGREEN;
平多:=VVV ;
再开多:=AAA ;
DRAWICON(多,H*1,10);
DRAWICON(空,L*18,11);
DRAWICON(平多,H*16,2);
DRAWICON(再开多,L*5,1);
DRAWTEXT(多,H*1,'买入'),COLORRED;
DRAWTEXT(空,L*18,'休息'),COLORGREEN;
DRAWTEXT(平多,L*16,'平多'),COLORGREEN;
DRAWTEXT(再开多,L*5,'再开多'),COLORRED;