以下是通达信选股器中同时满足这两个条件的预警公式(无源码的请下载附件导入)
{全力买进}
A7:=C-REF(C,1);
A8:=100*EMA(EMA(A7,3),3)/EMA(EMA(ABS(A7),3),3);
SHORT:=3; LONG:=7;
RMA:=EMA(CLOSE,SHORT);
NMA:=EMA(CLOSE,LONG);
UP:=DRAWLINE(L=LLV(L,BARSLAST(CROSS(NMA,RMA))+1),LLV(L,BARSLAST
(CROSS(NMA,RMA))+1),H=HHV(H,BARSLAST(CROSS(RMA,NMA))+1),HHV
(H,BARSLAST(CROSS(RMA,NMA))+1),0);
DOWN:=DRAWLINE(H=HHV(H,BARSLAST(CROSS(RMA,NMA))+1),HHV
(H,BARSLAST(CROSS(RMA,NMA))+1),L=LLV(L,BARSLAST(CROSS(NMA,RMA))+1),
LLV(L,BARSLAST(CROSS(NMA,RMA))+1),1);
全力买进:=(LLV(A8,2)=LLV(A8,4) AND COUNT(A8<0,2) AND CROSS(A8,MA(A8,2)))
AND REF(DOWN,1)<REF(DOWN,2) AND UP>REF(DOWN,1)COLORGREEN,LINETHICK9;
买进等于0:STICKLINE((全力买进=0),0.3,0,3,0)COLORGREEN;
{主力资金}
VARQ1:=REF((LOW+OPEN+CLOSE+HIGH)/4,1);
VARQ2:=SMA(ABS(LOW-VARQ1),10,1)/SMA(MAX(LOW-VARQ1,0),10,1);
VARQ3:=EMA(VARQ2,10);
VARQ4:=LLV(LOW,30);
VARQ5:=EMA(IF(LOW<=VARQ4,VARQ3,0),3)*100;
XG:VARQ5<REF(VARQ5,1) AND REF(VARQ5,1)>REF(VARQ5,2)COLORRED,LINETHICK4;
725122151.png
|