VARIABLE:bkp=0;
length:=10;
hh:ref(hhv(h,30),1);
if holding=0 and h>hh and todaybar>30 then begin
buy(1,1,limitr,hh);
bkp:=h;
end
ttt:bkp;
//加仓
buy(holding>0 and holding<3 and h>bkp+length,1,limitr,if(range(bkp+length+mindiff,l,h),bkp+length+mindiff,o));
buy(holding>0 and holding<3 and h>bkp+length*2,1,limitr,if(range(bkp+length*2+mindiff,l,h),bkp+length*2+mindiff,o));
sell(TODAYBAR=ref(TODAYBAR,TODAYBAR)-1,holding,LIMITR,o);
这段代码为啥加仓操作出不来?????
你好~上面调试是我自己出了问题~麻烦你再试试下面这段代码
股指1分钟数据~
位什么头寸加不到4手~3手以上为什么参数再调高也加不了了?
input:p1(4,1,99,1);//最大头寸
VARIABLE:bkp=0;
length:=5;
hh:ref(hhv(h,30),1);
if holding=0 and h>hh and todaybar>30 then begin
buy(1,1,limitr,hh);
bkp:=h;
end
ttt:bkp;
//加仓
buy(todaybar>30 and holding>0 and holding<p1 and h>bkp+length*holding,1,limitr,if(range(bkp+length*holding+mindiff,l,h),bkp+length*holding+mindiff,o));
sell(TODAYBAR=ref(TODAYBAR,TODAYBAR),holding,LIMITR,o);
持仓:holding,nodraw;
是虚拟资金不足了吧。我本地还是可以达到4手持仓的。我资金设大了就行了。