书写如下:if A then begin
if B then
buy(1,1,market);
if C then begin
sell(1,holding,market);
buyshort(1,1,market);
end
end
其中B和C是两种相反条件,共用A条件,这样不知道为啥B条件下的开多信号无法产生?
但是,可以产生C条件下的开空信号,但是,B条件下的开多信号就没了。。。
请教版主,谢谢!
应有空头持仓造成的。可以输出holding 确认下
if A then begin
if B then begin
sellshort(1,holding,market);
buy(1,1,market);
end
if C then begin
sell(1,holding,market);
buyshort(1,1,market);
end
end
if A then begin
if B then begin
sellshort(holding<0,holding,market);
buy(holding=0,1,market);
end
if C then begin
sell(holding>0,holding,market);
buyshort(holding=0,1,market);
end
end
没有开多信号就是条件不满足,把条件输出看下