N:=5;//N:=4; A1:=REF(HIGH,N)=HHV(HIGH,3*N+1); B1:=FILTER(A1,N); C1:=BACKSET(B1,N+1); D1:=FILTER(C1,N);//{高點} A2:=REF(LOW,N)=LLV(LOW,3*N+1); B2:=FILTER(A2,N); C2:=BACKSET(B2,N+1); D2:=FILTER(C2,N);//{低點} E1:=(REF(LLV(LOW,2*N),1)+REF(HHV(HIGH,2*N),1))/2; E2:=(HIGH+LOW)/2; H1:=(D1 AND NOT((D2 AND E1>=E2))) OR ISLASTBAR OR BARSCOUNT(CLOSE)=1; L1:=(D2 AND NOT((D1 AND E1<E2))),NODRAW; H2:=D1 AND NOT((D2 AND E1>=E2)); X1:=REF(BARSLAST(H1),1)+1; F1:=BACKSET(H1 AND COUNT(L1,X1)>0,LLVBARS(LOW,X1)+1);//LLVBARS(IF(L1,LOW,N000),X1)+1,NODRAW; G1:=F1>REF(F1,1);//DRAWTEXT(X1,L,'X1'); I1:=BACKSET(G1,1);//DRAWTEXT(F1,H,'F1'); LD:=I1>REF(I1,1);//{過濾后低點} L2:=LD OR ISLASTBAR OR BARSCOUNT(CLOSE)=1; X2:=REF(BARSLAST(L2),1)+1; F2:=BACKSET(L2 AND COUNT(H2,X2)>0,HHVBARS(H,X2)+1); G2:=F2>REF(F2,1);//DRAWTEXT(HD,H*1.01,'HD'); I2:=BACKSET(G2,1);//DRAWTEXT(LD,L*0.99,'LD'); HD:=I2>REF(I2,1);//{過濾后高點} DD1:=VALUEWHEN(LD,L); GD1:=VALUEWHEN(HD,H); CZ1:= ABS(GD1-REF(DD1,1));//高到低點差價; CZ2:= ABS(DD1-REF(GD1,1));//低到高點差價; CJ1:=50<ABS(GD1-REF(DD1,1));//高到低點差超限; CJ2:=50<ABS(DD1-REF(GD1,1));//低到高低點差超限; DRAWLINE1(LD,L,HD,H,0),LINETHICK1,COLORYELLOW;//黃色折線 DRAWLINE1(HD,H,LD,L,0),LINETHICK1,COLORBLUE;//藍(lán)色折線 //DRAWNUMBER(CJ2&&LD,L,CZ2,0,COLORYELLOW),ALIGN1,FONTSIZE20,VALIGN0; //DRAWNUMBER(CJ1&&HD,H,CZ1,0,COLORYELLOW),ALIGN1,FONTSIZE20,VALIGN2; AA:=EMA(C,5) > EMA(C,20); BB:=EMA(C,5) < EMA(C,20); CC:= EMA(C,5) > EMA(C,10); CC1:=EMA(C,5) < EMA(C,10); DD:=CLOSE<OPEN; BBB:=BACKSET(ISLASTBAR,SUMBARS(HD||LD,3)); AAA:=BACKSET(ISLASTBAR,SUMBARS(HD||LD,1)); //DRAWWAVERULER(HD&&BBB,H,LD&&BBB,L,HD&&BBB,H,0,COLORGREEN);//T線條T1///////////////////////////////////上升 //DRAWWAVERULER(HD&&BBB,H,LD&&BBB,L,HD&&BBB,H,0.236,RGB(0,128,255));//T線條T2////上升 //DRAWWAVERULER(HD&&BBB,H,LD&&BBB,L,HD&&BBB,H,0.382,RGB(0,128,255));//T線條T3//上升 //DRAWWAVERULER(HD&&BBB,H,LD&&BBB,L,HD&&BBB,H,0.618,COLORWHITE);//T線條T4//上升 //DRAWWAVERULER(HD&&BBB,H,LD&&BBB,L,HD&&BBB,H,0.764,COLORYELLOW);//T線條T5//上升 //DRAWWAVERULER(HD&&BBB,H,LD&&BBB,L,HD&&BBB,H,1,COLORMAGENTA);//T線條T6//上升 A:=REFX1(BARSLAST(HD)<BARSLAST(LD),0);//10000 轉(zhuǎn).空.:IF(A&&AAA,VALUEWHEN(HD&&BBB,H)-(VALUEWHEN(HD&&BBB,H)-VALUEWHEN(LD&&BBB,L))*0.236,NULL),PRECIS0,RGB(0,128,255); 轉(zhuǎn)空.:IF(A&&AAA,VALUEWHEN(HD&&BBB,H)-(VALUEWHEN(HD&&BBB,H)-VALUEWHEN(LD&&BBB,L))*0.382,NULL),PRECIS0,RGB(0,128,255); 中間.:IF(A&&AAA,VALUEWHEN(HD&&BBB,H)-(VALUEWHEN(HD&&BBB,H)-VALUEWHEN(LD&&BBB,L))*0.618,NULL),PRECIS0,COLORWHITE; 轉(zhuǎn)多.:IF(A&&AAA,VALUEWHEN(HD&&BBB,H)-(VALUEWHEN(HD&&BBB,H)-VALUEWHEN(LD&&BBB,L))*0.764,NULL),PRECIS0,COLORYELLOW; 賣點.:IF(A&&AAA,VALUEWHEN(HD&&BBB,H),NULL),PRECIS0,COLORGREEN; 買點.:IF(A&&AAA,VALUEWHEN(LD&&BBB,L),NULL),PRECIS0,COLORMAGENTA; 買賣差值.:賣點.-買點.,COLORWHITE,NODRAW,PRECIS0; DRAWTEXT(ISLASTBAR&&BARSLAST(HD)<BARSLAST(LD),賣點.,' 賣0 %'),COLORGREEN,ALIGN0,VALIGN1,FONTSIZE15;//T1//0 %,FONTSIZE16 DRAWTEXT(ISLASTBAR&&BARSLAST(HD)<BARSLAST(LD),轉(zhuǎn).空.,' 空23.6 %'),RGB(0,128,255),ALIGN0,VALIGN1,FONTSIZE15;//T2//38.2 % DRAWTEXT(ISLASTBAR&&BARSLAST(HD)<BARSLAST(LD),轉(zhuǎn)空.,' 空38.2 %'),RGB(0,128,255),ALIGN0,VALIGN1,FONTSIZE15;//T2//38.2 % DRAWTEXT(ISLASTBAR&&BARSLAST(HD)<BARSLAST(LD),中間.,' 中61.8 %'),COLORWHITE,ALIGN0,VALIGN1,FONTSIZE15;//T3//50 % DRAWTEXT(ISLASTBAR&&BARSLAST(HD)<BARSLAST(LD),轉(zhuǎn)多.,' 多74.6 %'),COLORYELLOW,ALIGN0,VALIGN1,FONTSIZE15;//T4//61.8 % DRAWTEXT(ISLASTBAR&&BARSLAST(HD)<BARSLAST(LD),買點.,' 買100 %'),COLORMAGENTA,ALIGN0,VALIGN1,FONTSIZE15;//T5//100 % 轉(zhuǎn).多:IF(NOT(A)&&AAA,VALUEWHEN(LD&&BBB,L)+(VALUEWHEN(HD&&BBB,H)-VALUEWHEN(LD&&BBB,L))*0.236,NULL),PRECIS0,COLORYELLOW;//抬頭T2 轉(zhuǎn)多:IF(NOT(A)&&AAA,VALUEWHEN(LD&&BBB,L)+(VALUEWHEN(HD&&BBB,H)-VALUEWHEN(LD&&BBB,L))*0.382,NULL),PRECIS0,COLORYELLOW;//抬頭T2 中間:IF(NOT(A)&&AAA,VALUEWHEN(LD&&BBB,L)+(VALUEWHEN(HD&&BBB,H)-VALUEWHEN(LD&&BBB,L))*0.618,NULL),PRECIS0,COLORWHITE;//抬頭T3 轉(zhuǎn)空:IF(NOT(A)&&AAA,VALUEWHEN(LD&&BBB,L)+(VALUEWHEN(HD&&BBB,H)-VALUEWHEN(LD&&BBB,L))*0.764,NULL),PRECIS0,RGB(0,128,255);//抬頭T4 賣點:IF(NOT(A)&&AAA,VALUEWHEN(HD&&BBB,H),NULL),PRECIS0,COLORGREEN;//抬頭T5 買點:IF(NOT(A)&&AAA,VALUEWHEN(LD&&BBB,L),NULL),PRECIS0,COLORMAGENTA;//抬頭T1 買賣差值:賣點-買點,COLORWHITE,NODRAW,PRECIS0; DRAWTEXT(ISLASTBAR&&BARSLAST(HD)>BARSLAST(LD),買點,' 買0 %'),COLORMAGENTA,ALIGN0,VALIGN1,FONTSIZE15;//T1//0 %,FONTSIZE16 DRAWTEXT(ISLASTBAR&&BARSLAST(HD)>BARSLAST(LD),轉(zhuǎn).多,' 多23.6 %'),COLORYELLOW,ALIGN0,VALIGN1,FONTSIZE15;//T2//38.2 % DRAWTEXT(ISLASTBAR&&BARSLAST(HD)>BARSLAST(LD),轉(zhuǎn)多,' 多38.2 %'),COLORYELLOW,ALIGN0,VALIGN1,FONTSIZE15;//T2//38.2 % DRAWTEXT(ISLASTBAR&&BARSLAST(HD)>BARSLAST(LD),中間,' 中61.8 %'),COLORWHITE,ALIGN0,VALIGN1,FONTSIZE15;//T3//50 % DRAWTEXT(ISLASTBAR&&BARSLAST(HD)>BARSLAST(LD),轉(zhuǎn)空,' 空76.4 %'),RGB(0,128,255),ALIGN0,VALIGN1,FONTSIZE15;//T4//61.8 % DRAWTEXT(ISLASTBAR&&BARSLAST(HD)>BARSLAST(LD),賣點,' 賣100 %'),COLORGREEN,ALIGN0,VALIGN1,FONTSIZE15;//T5//100 % DRAWNUMBER(CROSS(AAA=1,0.5),REFX1(轉(zhuǎn)多,40),REFX1(轉(zhuǎn)多,40),0,COLORYELLOW),ALIGN2,VALIGN1,FONTSIZE15;//賣價格左邊 DRAWNUMBER(CROSS(AAA=1,0.5),REFX1(中間,40),REFX1(中間,40),0,COLORWHITE),ALIGN2,VALIGN1,FONTSIZE15;//買價格左邊 DRAWNUMBER(CROSS(AAA=1,0.5),REFX1(轉(zhuǎn)空,40),REFX1(轉(zhuǎn)空,40),0,RGB(0,128,255)),ALIGN2,VALIGN1,FONTSIZE15;//賣價格左邊 DRAWNUMBER(CROSS(AAA=1,0.5),REFX1(賣點,40),REFX1(賣點,40),0,COLORLIGHTGREEN),ALIGN2,VALIGN1,FONTSIZE15;//買價格左邊 DRAWNUMBER(CROSS(AAA=1,0.5),REFX1(買點,40),REFX1(買點,40),0,COLORMAGENTA),ALIGN2,VALIGN1,FONTSIZE15;//賣價格左邊 |
|