先把系统自带的kdj公式抄过来,然后写下面的:
if holding<0 and count(cross(k,d),enterbars+1)=1 then begin
sellshort(1,0,market);
buy(holding=0,1,market);
end
请教老师;下面两句有什么不同?
sell(holding>0,holding,market);
sellshort(1,0,market);
谢谢
如果你的格式是:
if ........... then begin
if holding<0 and count(cross(k,d),enterbars+1)=1 then begin
sellshort(1,0,market);
buy(holding=0,1,market);
end
end
那么要做对应的修改为:
cc:count(cross(k,d),enterbars+1)=1;
if ........... then begin
if holding<0 and cc then begin
sellshort(1,0,market);
buy(holding=0,1,market);
end
end
我的模型是这样的格式;
if holding<0 and count(cross(k,d),enterbars+1)=1 then begin sellshort(1,0,market); buy(holding=0,1,market); end
|
就如我上面所说的,你那样的框架下的count有问题
我单独写给你的没有问题