请问这个程序在逻辑上有没有问题,为何没有回测信号出来?
我已经检查N遍了,还是老样子,求大神帮忙看看,是否程序问题,谢谢!
if close <=L1 and 均线下穿 then begin
if 条件1 then begin
if holding<0 then
sellshort(1,holding,market);
else buy(1,1,market);
end
else if 条件2 then begin
if holding>0 then
sell(1,holding,market);
else buyshort(1,1,market);
end
end
//
if close>=L1 and 均线上穿 then begin
if 条件1 then begin
if holding<0 then
sellshort(1,holding,market);
else buy(1,1,market);
end
else
if 条件2 then begin
if holding>0 then
sell(1,holding,market);
else buyshort(1,1,market);
end
end
回测时声明一个临时变量,用来在图表上输出开平仓条件,先确认这个开平仓条件,回测时到底触发没。