RSV:=(CLOSE-LLV(LOW,8))/(HHV(HIGH,8)-LLV(LOW,8))*100;
(资料图)
FASTK:=SMA(RSV,2,1);
K:=SMA(FASTK,2,1);
D :=SMA(K,2,1);
SJT:=CROSS(K, D );
XJT:=CROSS( D ,K);
HGUI:EMA2(HIGH,32);
LGUI:EMA2(LOW,32);
B:=CROSS(CLOSE,EMA2(HIGH,30));
S:=CROSS(EMA2(LOW,30),CLOSE);
WB:=BARSLAST(B)+1;
WS:=BARSLAST(S)+1;
BB:=CROSS(SUM(B,WS),0.5);
SS:=CROSS(SUM(S,WB),0.5);
TR:=MAX(MAX((HIGH-LOW),ABS(REF(CLOSE,1)-HIGH)),ABS(REF(CLOSE,1)-LOW));//真实波幅
ATR:MA(TR,26); //求26个周期内真实波幅的简单移动平均
MA1:MA(C,4);//4/9/15/19 //5/9/15/19
MA2:MA(C,9);
MA3:MA(C,15);
MA4:MA(C,19);
T1:=O<=MA1;
T2:=O<=MA2;
T3:=O<=MA3;
T4:=O<=MA4;
W1:=O>=MA1;
W2:=O>=MA2;
W3:=O>=MA3;
W4:=O>=MA4;
SJX:=(ISUP&&C>MAX1(MA1,MA2,MA3,MA4)&&T1+T2+T3+T4>=3)||
(ISUP&&C>MAX1(MA1,MA2,MA3,MA4)&&T1+T2+T3+T4>=2&&L<=MIN1(MA1,MA2,MA3,MA4));
XJX:=(ISDOWN&&C<MIN1(MA1,MA2,MA3,MA4)&&W1+W2+W3+W4>=3)||
(ISDOWN&&C<MIN1(MA1,MA2,MA3,MA4)&&W1+W2+W3+W4>=2&&H>=MAX1(MA1,MA2,MA3,MA4));
SJXK:=SJX&&SJT||SJX&&BB;
XJXK:=XJX&&XJT||XJX&&SS;
C1:=VALUEWHEN(SJXK,C);
C2:=VALUEWHEN(XJXK,C);
C>C1&&SUM(XJT,BARSLAST(SJXK)+1)=0&&COUNTSIG(BPK,BARSLAST(SJXK)+1)=0,BPK;
C<C2&&SUM(SJT,BARSLAST(XJXK)+1)=0&&COUNTSIG(SPK,BARSLAST(XJXK)+1)=0,SPK;
SJC:=REF(L,BARSLAST(XJT))>=REF(H,BARSLAST(SJT))&&SUM(SJT,BARSLAST(XJT)+1)=0;
BKVOL>0&&SUM(XJT,BARSBK)>=2&&SUM(SJC,BARSBK)>=1&&C<REF(C,BARSLAST(XJT))&&L<HGUI&&SUM(SJT,BARSLAST(XJT)+1)=0
&&REF(C,BARSLAST(XJT))>BKPRICE&&C<REF(LLV(C,BARSLAST(XJT)+1),1),SPK;
XJC:=REF(H,BARSLAST(SJT))<=REF(L,BARSLAST(XJT))&&SUM(XJT,BARSLAST(SJT)+1)=0;
SKVOL>0&&SUM(SJT,BARSSK)>=2&&SUM(XJC,BARSSK)>=1&&C>REF(C,BARSLAST(SJT))&&H>LGUI&&SUM(XJT,BARSLAST(SJT)+1)=0
&&REF(C,BARSLAST(SJT))<SKPRICE&&C>REF(HHV(C,BARSLAST(SJT)+1),1),BPK;
BKVOL>0&&SUM(XJT,BARSBK)>=3&&C<REF(C,BARSLAST(XJT))&&L<HGUI&&SUM(SJT,BARSLAST(XJT)+1)=0&&REF(C,BARSLAST(XJT))>BKPRICE,SPK;
SKVOL>0&&SUM(SJT,BARSSK)>=3&&C>REF(C,BARSLAST(SJT))&&H>LGUI&&SUM(XJT,BARSLAST(SJT)+1)=0&&REF(C,BARSLAST(SJT))<SKPRICE,BPK;
BKVOL+SKVOL=0&&SUM(XJT,EXITSIG_PLACE(1))>=2&&SUM(SJC,EXITSIG_PLACE(1))>=1&&C<REF(C,BARSLAST(XJT))&&L<HGUI&&SUM(SJT,BARSLAST(XJT)+1)=0,SPK;
BKVOL+SKVOL=0&&SUM(SJT,EXITSIG_PLACE(1))>=2&&SUM(XJC,EXITSIG_PLACE(1))>=1&&C>REF(C,BARSLAST(SJT))&&H>LGUI&&SUM(XJT,BARSLAST(SJT)+1)=0,BPK;
//不好用BKVOL>0&&SUM(SJC,REF(SUMBARS(XJT,1),BARSBK+1))>=2&&C<REF(C,BARSLAST(XJT))&&L<HGUI&&SUM(SJT,BARSLAST(XJT)+1)=0,SPK;
//不好用SKVOL>0&&SUM(XJC,REF(SUMBARS(SJT,1),BARSSK+1))>=2&&C>REF(C,BARSLAST(SJT))&&H>LGUI&&SUM(XJT,BARSLAST(SJT)+1)=0,BPK;
ISNEARHOLIDAY&&CLOSEMINUTE<=2,CLOSEOUT;
BKVOL>0&&C<BKPRICE1-(0.5*8*ATR+13)*MINPRICE,CLOSEOUT;
SKVOL>0&&C>SKPRICE1+(0.5*8*ATR+13)*MINPRICE,CLOSEOUT;
//SETDEALPERCENT(N2,1000);
AUTOFILTER;