RUNMODE:0;
input:SHORTPERIOD(5,5,60,5);
VARIABLE:myholding:=0;
ds55:=STKINDI(\'\',\'dc55.ds55\',0,2);
开多条件1:=cross(雷,资);
开多条件2:=cross(投,资);
开多条件2.1:=投>资 and 雷>投;
开多条件2.2:=雷>=REF(雷,SHORTPERIOD);
开多条件3:=cross(雷,投);
平多条件:=雷<=REF(雷,SHORTPERIOD);
//msgout(1,\'14550\'+NUMTOSTR(hh,0));
开空条件1:=cross(资,雷);
开空条件2:=cross(资,投);
开空条件2.1:=投<资 and 雷<投;
开空条件2.2:=雷<=REF(雷,SHORTPERIOD);
开空条件3:=cross(投,雷);
平空条件:=雷>=REF(雷,SHORTPERIOD);
if holding=0 then BEGIN
if 投<资 and 开多条件1 THEN begin
开多:BUY(1,10%,limitr,ds55);
end
if 开多条件2.1 and 开多条件2.2 then begin
开多3:buy(1,20%,limitr,ds55);
end
end
if holding>0 then begin
if 开多条件2 then begin
开多2:buy(1,10%,limitr,ds55);
end
myholding:=holding;
end
//多头平仓
if holding>0 then begin
if 平多条件 then begin
平多:sell(1,holding,limitr,ds55);
end
end
//建立空头模块
if holding=0 then BEGIN
if 投>资 and 开空条件1 THEN begin
开空:BUYshort(1,10%,limitr,ds55);
end
if 开空条件2.1 and 开空条件2.2 then begin
开空3:buyshort(1,20%,limitr,ds55);
end
end
//intpart(myholding/2)
if holding<0 then begin
if 开空条件2 then begin
开空2:buyshort(1,10%,limitr,ds55);
end
myholding:=holding;
end
//空头平仓
if holding<0 then begin
if 平空条件 then begin
平空:sellshort(1,holding,limitr,ds55);
end
end
持仓:holding,noaxis,LINETHICK0;
资金:ASSET,noaxis,LINETHICK2,COLORCYAN;
收益:asset/1000000,NOAXIS,LINETHICK0;
我这样子改了,发现原先的开平仓信号都没有了,自己调试不出来,请帮忙下谢谢,请帮忙指出下哪里逻辑写错了吗?