以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  金字塔软件问题提交  (http://weistock.com/bbs/list.asp?boardid=2)
----  交易测评每次也都是25手买卖,为什么显示在图表上手术就不对了,变成6,7,8之类的了  (http://weistock.com/bbs/dispbbs.asp?boardid=2&id=77844)

--  作者: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;

 


--  作者:yanghui
--  发布时间:2015/4/21 16:05:02
--  
原来用shoushu表示,不行,直接改数字,还是不行
--  作者:pyd
--  发布时间:2015/4/21 16:16:27
--  

你测评时的资金量和图表上资金量不一致吧?

25手图上资金不足就是能开几手就开几手

测评资金设置如图1,图表资金如图2,你设置以后再测


图片点击可在新窗口打开查看此主题相关图片如下:1.png
图片点击可在新窗口打开查看

图片点击可在新窗口打开查看此主题相关图片如下:2.png
图片点击可在新窗口打开查看
[此贴子已经被作者于2015/4/21 16:16:43编辑过]

--  作者:yanghui
--  发布时间:2015/4/21 16:25:21
--  
谢谢