ZY:=3;
止盈3%
MA55:MA(C,55);
NJC:=SUMBARS(CROSS(C,MA55),1);
NSC:=SUMBARS(CROSSDOWN
(C,MA55),1);
DRAWTEXT(NJC=1,H,'多'),COLORRED;
DRAWTEXT(NSC=1,L,'空'),COLORYELLOW,VALIGN0;
SP1:IF(NJC <NSC,VALUEWHEN(NJC=1,C)*(1 +3*0.01),NULL);//多盈利30%
BP1:LF(NSC> NSC,VALUEWHEN(NSC=1,C)*(1 -3*0.01),NULL);//空盈利30%
SP_ CON:CROSS(C>SP1,0.5)
&&COUNT(CROSS(C> SP1,0.5),NJC)=1;
BP_ CON:CROSS(C <BP1,0.5)
&&COUNT(CROSS(C<BP1,0.5),NSC)=1;
DRAWTEXT(SP_ CON,H,'平多'),COLORMAGENTA;
DRAWTEXT(BP_ CON,L,'平空'),COLORGREEN,VALIGNO;
DRAWTEXT(SP_ CON,H,'平多'),COLORMAGENTA;
DRAWTEXT(BP_ CON,L,'平空'),COLORGREEN,VALIGN0;
AUTOFILTER;
(来源:文华财经)