AB:=EMA(((2*C+H+L)/4-LLV(LOW,30))/(HHV(HIGH,30)-LLV(LOW,30))*100,8);

BA:=EMA(AB,5);

箱顶:=IF(AB>0 AND AB-BA<=0,A1,A1),COLORGREEN,DOTLINE;

箱底:=IF(AB>0 AND AB-BA<=0,B1,B1),COLORRED,DOTLINE;

费氏数:=HHV(H,20);

成立距今:=BARSLAST(费氏数);

H天数:=STICKLINE(成立距今=6 OR 成立距今=8 OR 成立距今=12 OR 成立距今=14

OR 成立距今=15 OR 成立距今=18 OR 成立距今=19 OR 成立距今=20 OR 成立距今=21

OR 成立距今=23 OR 成立距今=28 OR 成立距今=31 ,箱顶,箱底,0,0),COLORYELLOW;

{DRAWTEXT(ISLASTBAR,箱顶,' 箱顶'),COLORYELLOW;

DRAWTEXT(ISLASTBAR,箱底,' 箱底'),COLORYELLOW;}

C极点精准线:CONST(REF(C,0)),COLOR7777FF;

K:=BARSLAST(CURRBARSCOUNT=60);

GD:=CONST(IF(ISLASTBAR=1,HHV(H,K),0)),NODRAW;

DDA:=CONST(IF(ISLASTBAR=1,LLV(L,K),0)),NODRAW;

KJ:=GD-DDA;

DIF:=EMA(CLOSE,9)-EMA(CLOSE,21);

吸:=XLPL.NOTEXT吸,NODRAW;

拉:=XLPL.NOTEXT拉,NODRAW;

派:=XLPL.NOTEXT派,NODRAW;

落:=XLPL.NOTEXT落,NODRAW;

AAW:=IF(吸!=DRAWNULL,DIF,DRAWNULL),COLORLIRED,LINETHICK2;

BBW:=IF(拉!=DRAWNULL,DIF,DRAWNULL),COLORRED,LINETHICK2;

CCW:=IF(派!=DRAWNULL,DIF,DRAWNULL),COLORGREEN,LINETHICK2;

DDW:=IF(落!=DRAWNULL,DIF,DRAWNULL),COLORWHITE,LINETHICK2;

STICKLINE(AAW,LOW,HIGH,0,0),COLORLIRED;

STICKLINE(AAW,C,O,3,0),COLORLIRED;

STICKLINE(BBW,LOW,HIGH,0,0),COLORRED;

STICKLINE(BBW ,C,O,3,0),COLORRED;

STICKLINE(CCW,LOW,HIGH,0,0),COLORGREEN;

STICKLINE(CCW,C,O,3,0)COLORGREEN;

STICKLINE(DDW,LOW,HIGH,0,0),COLORWHITE;

STICKLINE(DDW,C,O,3,0),COLORWHITE;

VAR1:=CLOSE>REF(CLOSE,1) AND CLOSE>REF(CLOSE,2);

VAR2:=REF(VAR1,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);

VAR3:=REF(VAR2,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);

VAR4:=REF(VAR3,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);

VAR5:=REF(VAR4,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);

VAR6:=REF(VAR5,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);

VAR7:=REF(VAR6,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);

VAR8:=REF(VAR7,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);

VAR9:=REF(VAR8,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);

VARA:=REF(VAR9,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);

VARB:=REF(VARA,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);

VARC:=REF(VARB,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);

VARD:=CLOSE<REF(CLOSE,1) AND CLOSE<REF(CLOSE,2);

VARE:=REF(VARD,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);

VARF:=REF(VARE,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);

VAR10:=REF(VARF,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);

VAR11:=REF(VAR10,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);

VAR12:=REF(VAR11,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);

VAR13:=REF(VAR12,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);

VAR14:=REF(VAR13,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);

VAR15:=REF(VAR14,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);

VAR16:=REF(VAR15,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);

VAR17:=REF(VAR16,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);

VAR18:=REF(VAR17,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);

VAR19:=REF(VARD OR VARE OR VARF OR VAR10 OR VAR11 OR VAR12 OR VAR13 OR VAR14 OR VAR15 OR VAR16 OR VAR17 OR VAR18,1) AND VAR1;

VAR1A:=REF(VAR1 OR VAR2 OR VAR3 OR VAR4 OR VAR5 OR VAR6 OR VAR7 OR VAR8 OR VAR9 OR VARA OR VARB OR VARC,1) AND VARD;

DRAWTEXT(成立距今=6,箱顶*0.8,'6'),COLORYELLOW;

DRAWTEXT(成立距今=8,箱顶*0.8,'8'),COLORYELLOW;

DRAWTEXT(成立距今=12,箱顶*0.8,'12'),COLORYELLOW;

DRAWTEXT(成立距今=14,箱顶*0.8,'14'),COLORYELLOW;

DRAWTEXT(成立距今=15,箱顶*0.8,'15'),COLORYELLOW;

DRAWTEXT(成立距今=18,箱顶*0.8,'18'),COLORYELLOW;

DRAWTEXT(成立距今=19,箱顶*0.8,'19'),COLORYELLOW;

DRAWTEXT(成立距今=20,箱顶*0.8,'20'),COLORYELLOW;

DRAWTEXT(成立距今=21,箱顶*0.8,'21'),COLORYELLOW;

DRAWTEXT(成立距今=23,箱顶*0.8,'23'),COLORYELLOW;

DRAWTEXT(成立距今=28,箱顶*0.8,'28'),COLORYELLOW;

DRAWTEXT(成立距今=31,箱顶*0.8,'31'),COLORYELLOW;

{DRAWTEXT(CURRBARSCOUNT=1,一,' 一线'),COLOR00FFFF;

DRAWTEXT(CURRBARSCOUNT=1,二,' 二线'),COLOR00FFFF;

DRAWTEXT(CURRBARSCOUNT=1,三,' 三线'),COLOR00FFFF;

DRAWTEXT(CURRBARSCOUNT=1,四,' 四线'),COLOR00FFFF;

DRAWTEXT(CURRBARSCOUNT=1,五,' 五线'),COLOR00FFFF;

DRAWTEXT(CURRBARSCOUNT=1,六,' 六线'),COLOR00FFFF;

DRAWTEXT(CURRBARSCOUNT=1,七,' 七线'),COLOR00FFFF;

DRAWTEXT(CURRBARSCOUNT=1,八,' 八线'),COLOR00FFFF;}

PMA:=MA(C,5),COLORWHITE,LINETHICK2;

{IF(PMA>REF(PMA,1),PMA,DRAWNULL),COLORRED,LINETHICK2;

IF(PMA<REF(PMA,1),PMA,DRAWNULL),COLORGREEN,LINETHICK2;}

X:=(3*C+L+O+H)/6;

多空线:(20*X+19*REF(X,1)+18*REF(X,2)+17*REF(X,3)+16*REF(X,4)+15*REF(X,5)+14*REF(X,6)

+13*REF(X,7)+12*REF(X,8)+11*REF(X,9)+10*REF(X,10)+9*REF(X,11)+8*REF(X,12)

+7*REF(X,13)+6*REF(X,14)+5*REF(X,15)+4*REF(X,16)+3*REF(X,17)+2*REF(X,18)+

REF(X,20))/210,COLORFF00FF,LINETHICK2;

{用法:黄托底买进,蓝压顶卖出。}

DD:=多空线<REF(多空线,1);

{IF(DD,多空线,DRAWNULL),COLOR00FFFF,LINETHICK2;}

A:=(PMA>多空线);

IF(A,多空线 ,DRAWNULL),COLOR33FF33,CIRCLEDOT,LINETHICK4;

P:=5;P1:=13;

{N为多少天内的高低值参数,我以自已的初始K线根数定义。

P1、P2为短、长支撑压力取点参数}

A1S:=REF(H,P)=HHV(H,2*P+1);

B1S:=FILTER(A1S,P);

C1S:=BACKSET(B1S,P+1);

D1S:=FILTER(C1S,P);

E1S:=BACKSET(ISLASTBAR,BARSLAST(D1S)+1);

F1S:=E1S>REF(E1S,1);

短压:=DRAWLINE(D1S,H,F1S,H,1),COLORCYAN,DOTLINE;

A2:=REF(L,P)=LLV(L,2*P+1);

B2:=FILTER(A2,P);

C2:=BACKSET(B2,P+1);

D2:=FILTER(C2,P);

E2:=BACKSET(ISLASTBAR,BARSLAST(D2)+1);

F2:=E2>REF(E2,1);

短支:=DRAWLINE(D2,L,F2,L,1),COLORLIRED,DOTLINE;

AA1:=REF(H,P1)=HHV(H,2*P1+1);

BB1:=FILTER(AA1,P1);

CC1:=BACKSET(BB1,P1+1);

DD1:=FILTER(CC1,P1);{GUPIAOFF.COM};

EE1:=BACKSET(ISLASTBAR,BARSLAST(DD1)+1);

FF1:=EE1>REF(EE1,1);

长压:=DRAWLINE(DD1,H,FF1,H,1),COLORGREEN,DOTLINE;

AA2:=REF(L,P1)=LLV(L,2*P1+1);

BB2:=FILTER(AA2,P1);

CC2:=BACKSET(BB2,P1+1);

DD2:=FILTER(CC2,P1);{GUPIAOFF.COM};

EE2:=BACKSET(ISLASTBAR,BARSLAST(DD2)+1);

FF2:=EE2>REF(EE2,1);

长支:=DRAWLINE(DD2,L,FF2,L,1),COLORYELLOW,DOTLINE;

TA:=MAX(MAX((HIGH-LOW),ABS(REF(CLOSE,1)-HIGH)),ABS(REF(CLOSE,1)-LOW));

ATR:=EMA(TA,13);

VAR8A:=REF(CLOSE,1)-REF(ATR,1);

涨:=TROUGHBARS(3,15,1)=0 AND HIGH>LOW+0.01 AND TIME<=0945;

跌:=PEAKBARS(3,15,1)=1;

STICKLINE(涨,L-0.1,L*999,5,0)COLORWHITE;

STICKLINE(跌,H,H+0.006,5,0)COLORLIGREEN;

DRAWTEXT(涨,L*999,'变盘')COLORYELLOW;

DRAWTEXT(跌,H+0.09,'变盘')COLORYELLOW;

跟A7:=C-REF(C,1);

跟A8:=100*EMA(EMA(跟A7,6),6)/EMA(EMA(ABS(跟A7),6),6);

买:=LLV(跟A8,2)=LLV(跟A8,7) AND COUNT(跟A8<0,2) AND CROSS(跟A8,MA(跟A8,2));

跟庄买进:DRAWTEXT(FILTER(买=1,5),L*666,'∠跟庄买进')COLORMAGENTA;