在策略中写了这样的开仓语句
if 开仓时间 then
BEGIN
if (HOLDING=0 and NOT(EXITBARS=0)) then BUYSHORT(condmin,25,limitr,lower1-1);
if (HOLDING=0 and NOT(EXITBARS=0)) then BUY(condmax,25,limitr,UPPER1+1);
END;
交易测评每次也都是25手买卖,为什么显示在图表上手术就不对了,变成6,7,8之类的了
此主题相关图片如下:qq图片22222.jpg
此主题相关图片如下:额鹅鹅鹅.jpg
具体策略如下:
INPUT:shoushu(25,1,100,1);
开仓时间:=BETWEEN(time0,32400,54600);//3点10分判断是否平仓
交易时间:=BETWEEN(time0,32400,54900);//3点15分结束开仓
平仓时间:=BETWEEN(time0,54601,54900);//3点10
MID:=MA(o,44);
UPPER:= MID+2.5*std(c,44);
LOWER:= MID-2.5*std(c,44);
lower1:ma(lower,9),1;
upper1:ma(upper,9),1;
condmax:=o<upper1 and cross(h,UPPER1);
condmin:=o>lower1 and cross(LOWER1,l);
kkpro:=(enterprice-ref(llv(l,enterbars),1))/enterprice*100;
kdpro:=(ref(hhv(h,enterbars),1)-enterprice)/enterprice*100;
kkapro:=(enterprice-h)/enterprice*100;
kdapro:=(l-enterprice)/enterprice*100;
tt:=0.8*std(O,25);
ttt:=if(tt>ZHI,ZHI,tt);
stl:=if(ttt<6,6,ttt);
//交易系统
IF BETWEEN(HOLDING,-200,200) THEN
begin
if 交易时间 then begin
///////////平空////////////////////开空
if (HOLDING<0 AND KKPRO<can) then
BEGIN
IF (O-enterprice)>STL THEN SELLSHORT(1,holding,limitr,O+1);
if enterbars>27 and kkapro<0.4 then SELLSHORT(1,holding,thisclose);
END;
if (HOLDING<0 and KKPRO>=can) then SELLSHORT(1,holding,limitr,O+1);
//////////////////////////////////平多开多
if (HOLDING>0 AND KDPRO<can) then
BEGIN
IF (enterprice-O)>STL THEN SELL(1,holding,limitr,o-1);
if enterbars>27 and kdapro<0.4 then SELL(1,holding,thisclose);
END;
if (HOLDING>0 AND KDPRO>=can) then SELL(1,holding,limitr,O-1);
if 开仓时间 then
BEGIN
if (HOLDING=0 and NOT(EXITBARS=0)) then BUYSHORT(condmin,25,limitr,lower1-1);
if (HOLDING=0 and NOT(EXITBARS=0)) then BUY(condmax,25,limitr,UPPER1+1);
END;
end;
/////////////////////////////////////////收盘平仓
if 平仓时间 then
begin
if (HOLDING>0 and enterbars>1) then SELL(1,holding,thisclose);
if (HOLDING<0 and enterbars>1) then SELLSHORT(1,holding,thisclose);
end;
end;
你测评时的资金量和图表上资金量不一致吧?
25手图上资金不足就是能开几手就开几手
测评资金设置如图1,图表资金如图2,你设置以后再测
此主题相关图片如下:1.png
此主题相关图片如下:2.png