M1:=8;
M2:=25;
M3:=12;
M4:=50;
AEXP1:EXPMA(CLOSE,M1)COLORBLUE,LINETHICK1;
AEXP2:EXPMA(CLOSE,M2)COLORGREEN,LINETHICK2;
AEXP3:=EXPMA(C,M3)COLORLIGREEN,DOTLINE;
AEXP4:=EXPMA(C,M4)COLORWHITE,DOTLINE;
IF(AEXP1>(REFV(AEXP1,1)),AEXP1,DRAWNULL),COLORRED,LINETHICK1;
IF(AEXP2>(REFV(AEXP2,1)),AEXP2,DRAWNULL),COLORMAGENTA,LINETHICK2;
IF(AEXP3>(REFV(AEXP3,1)),AEXP3,DRAWNULL),COLORYELLOW,DOTLINE;
IF(AEXP4>(REFV(AEXP4,1)),AEXP4,DRAWNULL),COLORLIRED,DOTLINE;
卖:=CROSS(AEXP1,AEXP2);
买:=CROSS(AEXP2,AEXP1);
DRAWTEXT(卖,AEXP1*0.995,'持股'),COLORRED;
DRAWTEXT(买,AEXP2*1.03,'持币'),COLORWHITE;
“持股”的选股公式如下:
源码
M1:=8;
M2:=25;
AEXP1:=EXPMA(CLOSE,M1)COLORBLUE;
AEXP2:=EXPMA(CLOSE,M2)COLORGREEN;
选股:CROSS(AEXP1,AEXP2);