请教老师:
将交易函数MARKETR改为NEXTOPEN后,大部分的交易信号都是在一根Bar上显示开平信号,求助这个该如何解决?
谢谢!!
IF (KD3 OR KD4 OR KD5 OR KD6) AND KD2 THEN BEGIN
SELLSHORT(1,0,NEXTOPEN);
BUY(HOLDING=0,CW%,NEXTOPEN);
END
IF (KK3 OR KK4 OR KK5 OR KK6 ) AND KK2 THEN BEGIN
SELL(1,0,NEXTOPEN);
BUYSHORT(HOLDING=0,CW%,NEXTOPEN);
END
zg:=hhv(h,enterbars+1);
CS:=LLV(L,ENTERBARS+1);
IF (ZG-AVGENTERPRICE)/AVGENTERPRICE>=ZY*0.2 AND C<AVGENTERPRICE THEN BEGIN
SELL(1,0,NEXTOPEN);
END
IF (AVGENTERPRICE-CS)/CS>=ZY*0.2 AND C>AVGENTERPRICE THEN BEGIN
SELLSHORT(1,0,NEXTOPEN);
END
if (zg-avgenterprice)/avgenterprice>=ZY*0.4 and (C-avgenterprice)<=(zg-avgenterprice)*0.5 then begin
sell(1,0,NEXTOPEN);
END
if (avgenterprice-CS)/CS>=ZY*0.4 and (avgenterprice-C)<=(avgenterprice-CS)*0.5 then begin
sellshort(1,0,NEXTOPEN);
End
if (zg-avgenterprice)/avgenterprice>=ZY*0.6 and (C-avgenterprice)<=(zg-avgenterprice)*0.6 then begin
sell(1,0,NEXTOPEN);
END
if (avgenterprice-CS)/CS>=ZY*0.6 and (avgenterprice-C)<=(avgenterprice-CS)*0.6 then begin
sellshort(1,0,NEXTOPEN);
End
if (zg-avgenterprice)/avgenterprice>=ZY*0.8 and (C-avgenterprice)<=(zg-avgenterprice)*0.7 then begin
sell(1,0,NEXTOPEN);
END
if (avgenterprice-CS)/CS>=ZY*0.8 and (avgenterprice-C)<=(avgenterprice-CS)*0.7 then begin
sellshort(1,0,NEXTOPEN);
End
if (zg-avgenterprice)/avgenterprice>=ZY and (C-avgenterprice)<=(zg-avgenterprice)*0.8 then begin
sell(1,0,NEXTOPEN);
END
if (avgenterprice-CS)/CS>=ZY and (avgenterprice-C)<=(avgenterprice-CS)*0.8 then begin
sellshort(1,0,NEXTOPEN);
End
多单止损:=sell(avgenterprice-c>c*ZS and holding>0 ,0,NEXTOPEN);
空单止损:=sellshort(c-avgenterprice>c*ZS and holding<0 ,0 ,NEXTOPEN);
使用MARKETR,策略可以正常的止盈止损,但是更改为NEXTOPEN,策略根本就没有止盈止损的机会,同时显示开平仓信号,如何正常交易呢?