请帮我修改下这段编码好么?开仓采用走完k线,平仓采用固定轮回的策略,好像加个REF()可以做到么?
就以这个为例好了
ma5:ma(close,m);
if cross(c,ma5) and time>091500 and time<151300 and holding=0 then buy(1,1,limitr,c),IGNORECHECKPRICE;//改为走完k线下单
if cross(ma5,c) and time>091500 and time<151300 and holding=0 then buyshort(1,1,limitr,c),IGNORECHECKPRICE;//改为走完k线下单
if holding<0 and enterprice-l>=mindiff*n then sellshort(1,1,limitr,enterprice-mindiff*n),IGNORECHECKPRICE;//固定轮询下单
if holding>0 and enterprice-h<=mindiff*n then sell(1,1,limitr,enterprice+mindiff*n),IGNORECHECKPRICE ;//固定轮询下单