INPUT:SS(1,1,99999,1);
HH1:=IF(H<REF(H,2)&&REF(H,1)<REF(H,2),REF(H,1),0);
LL1:=IF(L>REF(L,2)&&REF(L,1)>REF(L,2),REF(L,1),0);
HH2:=VALUEWHEN(HH1>0,HH1);
LL2:=VALUEWHEN(LL1>0,LL1);
K1:=IF(CLOSE>HH2,-3,IF(CLOSE<LL2,1,0));
K2:=VALUEWHEN(K1<>0,K1);
G:=IF(K2=1,HH2,LL2);
G1:=VALUEWHEN(ISLASTBAR,G);
W1:=K2;
W2:=OPEN-CLOSE;
HT:=IF(OPEN>CLOSE,OPEN,CLOSE);
LT:=IF(OPEN<CLOSE,OPEN,CLOSE);
//DRAWLINE(W1=1&&REF(W1,1)=1,G,W1=1&&REF(W1,1)=1,REF(G,1),COLORRED);
//DRAWLINE(W1=-3&&REF(W1,1)=-3,G,W1=-3&&REF(W1,1)=-3,REF(G,1),COLORBLUE);
//DRAWSL(K2=1,G,0,1,0,COLORRED);
DRAWSL(K2=-3,G,0,1,0,COLORBLUE);
kK:=K2=1 and ref(K2=-3,1);
kD:=k2=-3 and ref(k2=1,1);
IF KD AND HOLDING<=0 THEN
BEGIN
SELLSHORT(HOLDING<0,0,LIMITR,CLOSE);
BUY(HOLDING=0,SS,LIMITR,CLOSE);
END
IF KK AND HOLDING>=0 THEN
BEGIN
SELL(HOLDING>0,0,LIMITR,CLOSE);
BUYSHORT(HOLDING=0,SS,LIMITR,CLOSE);
END
帮忙把这改为能选股和预警,谢谢
|