input:N(9,1,100,10),P1(3,2,50,5),P2(3,2,50,5),P3(5,1,20,2); 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;
kddo:=cross(K,D); kdko:=cross(D,K) and D>=60;
kaiduo:=cross(K,D); kaikon:=cross(D,K);
if holding=0 and cross(K,D) then buy(1,1,mkt);
if holding=0 and kaikon then buyshort(c>o,1,lmt,c);
if holding>0 then begin if c<ENTERPRICE-20*MINDIFF then sell(1,1,mkt); if kdko then sell(1,1,mkt); if time>145800 then sell(1,1,mkt); end
if holding<0 then begin if c>ENTERPRICE+20*MINDIFF then sellshort(1,1,mkt); if kddo then sellshort(1,1,mkt); if if time>145800 then sellshort(1,1,mkt); end
|