-- 作者:qq代人发帖
-- 发布时间:2015/4/21 15:58:57
-- 交易测评每次也都是25手买卖,为什么显示在图表上手术就不对了,变成6,7,8之类的了
在策略中写了这样的开仓语句 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

以前手数很小的时候,小于5手都是对的,现在手数一加大,其他什么都没变化,显示就不正常了
|
-- 作者:yanghui
-- 发布时间:2015/4/21 16:04:00
--
具体策略如下:
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;
|