buyshort(holding=0 and ref(c,1)>junx and c<=junx and time>t and time<tt,jj,limitr,c);
反复开仓的交易记录在下面:
buyshort(type(3)<>1 and ref(c,1)>junx and c<=junx and time>t and time<tt,jj,limitr,c);
改这样试试
3是开空
得到当前位置之前上N次信号类型
输出:0、无信号1、开多2、平多3、开空;4、平空
buyshort(holding=0 and ref(c,1)>junx and c<=junx and time>t and time<tt,jj,limitr,c);
holding=0,为什么没起作用
你可以用cond:holdling=0 然后buyshort(cond,,)查下 你当前为止上cond是为1还是为0 是不是条件不对造成的
在代码中,只出现了1次buyshort:
buy(holding=0 and ref(c,1)<junx and c>=junx and time>t and time<tt,jj,LIMITr,c);
sell(holding>0 and (c-ENTERPRICE>=a*zy or ENTERPRICE-c>=a*zs or time>=tt),holding,LIMITr,c);
buyshort(holding=0 and type(1)<>3 and ref(c,1)>junx and c<=junx and time>t and time<tt,jj,limitr,c);
sellshort(holding<0 and (ENTERPRICE-c>=a*zy or c-ENTERPRICE>=a*zs or time>=tt),holding,limitr,c);