老师请帮我把这入场和出场改成后台的形式 谢谢!
//出场
if HOLDING>0 AND C<=enterprice-N1*MINDIFF then begin//多损
sell(1,1,MARKETR);
end;
if HOLDING>0 AND C>=enterprice+N2*MINDIFF then begin//多盈
sell(1,1,MARKETR);
end
if HOLDING<0 AND C>=enterprice+N1*MINDIFF then begin//空损
sellshort(1,1,MARKETR);
end
if HOLDING<0 AND C<=enterprice-N2*MINDIFF then begin //空盈
sellshort(1,1,MARKETR);
end
//入场
IF HOLDING=0 AND KD and exitbars>5 or exitbars=-1 THEN BEGIN
BUY(1,1,MARKETR);
END
IF HOLDING=0 AND KK and exitbars>5 or exitbars=-1 THEN BEGIN
BUYSHORT(1,1,MARKETR);
END
DQCC:HOLDING,COLORGRAY,LINETHICK0;
DQZC:ASSET,NOAXIS,COLORGRAY;
if tHOLDING>0 AND C<=tenterprice-N1*MINDIFF then begin//多损
tsell(1,1,Mkt);
end;
if HOLDING>0 AND C>=tenterprice+N2*MINDIFF then begin//多盈
tsell(1,1,Mkt);
end
if HOLDING<0 AND C>=tenterprice+N1*MINDIFF then begin//空损
tsellshort(1,1,Mkt);
end
if HOLDING<0 AND C<=tenterprice-N2*MINDIFF then begin //空盈
tsellshort(1,1,Mkt);
end
//入场
IF tHOLDING=0 AND KD and (texitbars>5 or texitbars=-1) THEN BEGIN
tBUY(1,1,Mkt);
END
IF tHOLDING=0 AND KK and (exitbars>5 or texitbars=-1) THEN BEGIN
tBUYSHORT(1,1,Mkt);
END