//麻烦帮忙看看,多单的止损没有触发,空单止损都能触发,这个是怎么回事?
M1:EMA(CLOSE,5);
M3:EMA(CLOSE,10);
cc:=cross(m1,m3);
kk:=cross(m3,m1);
//开多单条件,5日穿10日线开仓
long:=cc;
IF long THEN
begin
sellshort(holding<0,0,limitr,c);
buy(holding=0,1,limitr,c);
END;
//多单止盈条件,比开仓价格多15点以上就平仓
PD2:=(C-AVGENTERPRICE)>=15;
SELLSHORT(PD2,holding,THISCLOSE);
//开空单条件,10日穿5日线开仓
short:=kk;
if short THEN
begin
sell(holding>0,0,limitr,c);
buyshort(holding=0,1,limitr,c);
END ;
//空单止损,比开仓价少15点以上平仓
pk2:=(c-AVGENTERPRICE)<=-15;
SELLSHORT(PK2,holding,THISCLOSE);
//多单止盈条件,比开仓价格多15点以上就平仓
PD2:=(C-AVGENTERPRICE)>=15;
SELL
SHORT(PD2,holding,THISCLOSE);
你这里写错了,你这是平空的语句,得是平多的才行。