-- 图表策略信号显示混乱,附源码
//开多条件
隔夜收盘开多:=KD01>0;
a2:=(KD02+KD03)>0;//开盘开多
//开空条件
隔夜收盘开空:=KK01>0;
b2:=(KK02+KK03)>0;//开盘开空
variable:flag=0;// 全局变量,买开仓时赋值为1
//交易系统1
开多: if todaybar=1 then buy(a2 and HOLDING=0,ss,limitr,open+MINDIFF);
开空: if todaybar=1 then buyshort(b2 and HOLDING=0,ss,limitr,open-MINDIFF);
//日内收盘平仓1
if time>=closetime(4)-5*100 then begin
平多:sell(1,ss,market);
平空:sellshort(1,ss,market);
end
//交易系统2
if KD01>0 and timetot0(dynainfo(207))<(timetot0(closetime(0))-60) and holding=0 then
begin
buy(1,ss,thisclose);
flag:=1;
end
if holding>0 and flag=0 then sell(1,ss,market);//次日开盘平多
if time=opentime(2) then flag:=0;//flag赋值为0
if KK01>0 and timetot0(dynainfo(207))<(timetot0(closetime(0))-60) and holding=0 then
begin
buyshort(1,ss,thisclose);
flag:=1;
end
if holding>0 and flag=0 then sellshort(1,ss,market);//次日开盘平空
if time=opentime(2) then flag:=0;//flag赋值为0
帮忙看看。哪里出问题?