编了个模型,多空都有,为什么只显示多头信号,没显示空头信号呀
RSV:=(CLOSE-LLV(LOW,N))/(HHV(HIGH,N)-LLV(LOW,N))*100;
K:=SMA(RSV,P1,1);
D:=SMA(K,P2,1);
J:=3*K-2*D;
long:ma(c,55);
if o>long and ref(c,10)<long and CROSS(D,K) then begin
buy(holding=0,1,market);
end;
if cross(k,d) then begin
sell(1,0,market);
end;
if o<long and ref(c,10)>long AND CROSS(K,D) then begin
buyshort(holding=1,1,market);
end;
if cross(d,k) then begin
sellshort(1,0,market);
end;
RSV:=(CLOSE-LLV(LOW,N))/(HHV(HIGH,N)-LLV(LOW,N))*100;
K:=SMA(RSV,P1,1);
D:=SMA(K,P2,1);
J:=3*K-2*D;
long:ma(c,55);
if o>long and ref(c,10)<long and CROSS(D,K) then begin
buy(holding=0,1,market);
end;
if cross(k,d) then begin
sell(1,0,market);
end;
if o<long and ref(c,10)>long AND CROSS(K,D) then begin
buyshort(holding=1,1,market);
end;
if cross(d,k) then begin
sellshort(1,0,market);
end;
红色部分改成holding=0