N:=21;M:=55;Q:=3;

回归:=EMA(SLOPE(CLOSE,N)*20+CLOSE,M)*1,COLORMAGENTA,LINETHICK3;

平滑:=EMA(CLOSE,Q),COLORYELLOW,LINETHICK2;

简单差:=平滑-回归;

DRAWICON(CROSS(ZIG(3,8),REF(ZIG(3,8),1)),平滑,9);

CJL:=IF(DYNAINFO(10)>99999999,STRCAT(CON2STR(DYNAINFO(10)/100000000,2)<10,'亿'),STRCAT(CON2STR(DYNAINFO(10)/10000,0),'万'));

DRAWTEXT_FIX(01,0.01,0.01.0,0,CJL),COLOR0099FF;

VAR3AA:=IF((CLOSE>REF(CLOSE,1)),88,0);

VAR4AA:=IF(((CLOSE)/(REF(CLOSE,1))>1.50) AND ((HIGH)/(CLOSE)<1.01) AND (VAR3AA>0),91,0);

XGX:=(FILTER((VAR4AA>90),50)),COLORYELLOW;

STICKLINE(XGX*9999999999,90,0,4,3),COLORMAGENTA;

V1:=MA(100*(C-LLV(C,34))/(HHV(H,34)-LLV(L,34)),5)-20;

V2:=2*ABS(V1);

V3:=100-(100-3*SMA((C-LLV(L,55))/(HHV(H,55)-LLV(L,55))

100,20,1)+2SMA(SMA((C-LLV(L,55))/(HHV(H,55)-LLV(L,55))

*100,20,1),15,1));

V4:=100-(100-3*SMA((O-LLV(L,55))/(HHV(H,55)-LLV(L,55))

100,20,1)+2SMA(SMA((O-LLV(L,55))/(HHV(H,55)-LLV(L,55))

*100,20,1),15,1));

V5:=(H+L+C)/3;

V6:=(V5-MA(V5,10))/(0.015*AVEDEV(V5,10));

V7:=(V5-MA(V5,30))/(0.015*AVEDEV(V5,30));

V8:=IF(V6>=150 AND V6<200 AND V7>=150 AND V7<200,10,0);

V9:=IF(V6<=-150 AND V6>-200 AND V7<=-150 AND V7>-200,-10,V8);

VA:=(C-MA(C,13))/MA(C,13)*100;

VB:=100-ABS(VA);

VC:=3*SMA((INDEXC-LLV(INDEXL,55))/(HHV(INDEXH,55)-LLV(INDEXL,55))*100,20,1)-2*SMA(SMA((INDEXC-LLV(INDEXL,55))/(HHV(INDEXH,55)-LLV(INDEXL,55))*100,20,1),15,1);

VD:=3*SMA((INDEXO-LLV(INDEXL,55))/(HHV(INDEXH,55)-LLV(INDEXL,55))*100,20,1)-2*SMA(SMA((INDEXO-LLV(INDEXL,55))/(HHV(INDEXH,55)-LLV(INDEXL,55))*100,20,1),15,1);

VE:=REF(L,1)*0.9;

VF:=L*0.9;V10:=(VF*V+VE*(CAPITAL-V))/CAPITAL;V11:=EMA(V10,30);V12:=V11-C;V13:=REF(C,1);

V14:=SMA(MAX(C-V13,0),7,1)/SMA(ABS(C-V13),7,1)*100;

V15:=SMA(MAX(C-V13,0),13,1)/SMA(ABS(C-V13),13,1)*100;V16:=BARSCOUNT(C);

V17:=SMA(MAX(C-REF(C,1),0),6,1)/SMA(ABS(C-REF(C,1)),6,1)*100;

V18:=((-100)*(HHV(H,60)-C)/(HHV(H,60)-LLV(L,60))+50)*2;

V19:=(C-LLV(L,15))/(HHV(H,15)-LLV(L,15))*100;V1A:=(SMA(V19,4,1)-50)*2;V1B:=SMA(V1A,3,1);

V1C:=(INDEXC-LLV(INDEXL,14))/(HHV(INDEXH,14)-LLV(INDEXL,14))*100;V1D:=SMA(V1C,4,1);

V1E:=SMA(V1D,3,1);V1F:=(HHV(H,30)-C)/C*100;

V20:=IF(V17<=25 AND V18<-95 AND V1F>20 AND V1B<-30 AND V1E<30 AND V12>=-0.25 AND V14<22 AND V15<28 AND V16>50,80,0);

大趋势:= V3;顶线: IF(VB<90,VB,100);多方:= IF(V1>0,V1,0),LINESTICK;空方:= -IF(V1<0,V2,0),LINESTICK;

抄底: V20,COLORRED,LINETHICK2;

预警系统:(IF((V7>=200 AND V6>=150) OR CROSS(65,多方),15,IF(V7<=-200

AND V6<=-150,-15,V9))+65),COLORWHITE;

{STICKLINE(V3<=REF(V4,1),V3,V4,8,0),COLORWHITE;}

STICKLINE(V3>REF(V4,1),V3,V4,8,1),COLORRED;

T1:=C>MA(C,20) AND MA(C,20)>=REF(MA(C,20),1);

T2:=C; T3:=多方>60 AND 预警系统>65 AND 顶线=100;

T4:=多方>48 AND 预警系统>65 AND 顶线<100;

T5:=空方<-38 AND 预警系统<65;

T6:=抄底>50 AND 顶线<90;

T7:=V3>REF(V4,1) AND V>REF(V,1) AND C>REF(C,1);

T8:=V3<=REF(V4,1) AND C AND 空方>=REF(空方,1) AND VC;

DRAWTEXT(T1 AND COUNT(T1,30)=1,10,'上升通道'),COLORMAGENTA;

DRAWTEXT(T3 AND COUNT(T3,30)=1,10,'上涨过急'),COLORYELLOW;

VAR326:=IF(CLOSE AND MA(VOL, 5)/240 AND CLOSE>REF(CLOSE, 1)*1.00 AND CLOSE,88,0);{VAR38>VAR39;}

VAR327:=IF(CLOSE/REF(CLOSE, 1)>1.050 AND VOL/CAPITAL*100<10 AND CLOSE<17 AND HIGH/CLOSE<1.050 AND VAR326>0, 91, 0);

STICKLINE(VAR327>90,L,L*9.5.5,2,0),COLORGREEN;

DRAWTEXT(VAR327>90,L,'↖杀庄'),COLORGREEN;

VAR1:=CLOSE-LOW;

VAR2:=HIGH-LOW;

VAR3:=CLOSE-HIGH;

VAR4:=IF(HIGH>LOW,(VAR1/VAR2+VAR3/VAR2)*VOL,0);

HPTP:=SUM(VAR4,10)/10000,COLORSTICK;

TKXL:=-1;

XVYO:=UPNDAY(TKXL,1),NODRAW;

G:=MA(C,5);

D:=MA(C,10);

HH:=REF(H,5)=HHV(H,11);

LL:=REF(L,5)=LLV(L,11);

FG01:=BACKSET(HH,6)>BACKSET(HH,5);

FD01:=BACKSET(LL,6)>BACKSET(LL,5);

FG02:=IF(BARSLAST(FG01)=BARSLAST(FD01) AND G>D,FG01,

IF(BARSLAST(FD01)>BARSLAST(FG01),FG01,0));

FD02:=IF(BARSLAST(FG01)=BARSLAST(FD01) AND D>G,FD01,

IF(BARSLAST(FG01)>BARSLAST(FD01),FD01,0));

FG0:=FG02 AND H=HHV(H,BARSLAST(FD02));

FD0:=FD02 AND L=LLV(L,BARSLAST(FG02));

GQ:=L>REF(H,1) AND DAY!=REF(DAY,1);

DQ:=H<REF(L,1) AND DAY!=REF(DAY,1);

FGH:=REF(H,BARSLAST(FG0));

FGL:=REF(L,BARSLAST(FG0));

FGH1:=REF(H,BARSLAST(FG0)+1);

FGL1:=REF(L,BARSLAST(FG0)+1);

FGL2:=REF(L,BARSLAST(FG0)+2);

FDH2:=REF(H,BARSLAST(FD0)+2);

FDH:=REF(H,BARSLAST(FD0));

FDL:=REF(L,BARSLAST(FD0));

FDH1:=REF(H,BARSLAST(FD0)+1);

FDL1:=REF(L,BARSLAST(FD0)+1);

FGZL:=IF(FGH1<FGL,FGL,IF(FGL<=FGL1,FGL2,FGL1));

FDZH:=IF(FDL1>FDH,FDH,IF(FDH>=FDH1,FDH2,FDH1));

FG1:=FGH>FDZH AND FG0;

FD1:=FDL<FGZL AND FD0;

FG:=FG1 AND FGH>FDH AND FGL>FDL AND FGL1>FDL;

FD:=FD1 AND FDL<FGL AND FDH<FGH AND FDH1<FGH;

BH0:=(H<=REF(H,1) AND L>=REF(L,1)) OR (H>=REF(H,1) AND L<=REF(L,1));

BHG:=COUNT(BH0,BARSLAST(FD0));

BHD:=COUNT(BH0,BARSLAST(FG0));

BGQ:=COUNT(GQ,BARSLAST(FD0));

BDQ:=COUNT(DQ,BARSLAST(FG0));

BK0:=IF(BHG>0,BHG+2,IF(BHD,BHD+2,3));

BK:=IF(BGQ,BK0-BGQ,IF(BDQ,BK0-BDQ,BK0));

G1X:=(FG AND BARSLAST(FD)>BK),NODRAW;

D1X:=(FD AND BARSLAST(FG)>BK),NODRAW;

G1:=(FG0 AND REF(H,BARSLAST(FG0))>=REF(H,BARSLAST(G1X)) AND BARSLAST(D1X)>BARSLAST(G1X))

OR (FG1 AND COUNT(GQ,BARSLAST(FD1))>0 AND REF(H,BARSLAST(FG1))>REF(H,BARSLAST(G1X)));

{W:=IF(DATE<1201231,C,DRAWNULL);}

D1:=(FD0 AND REF(L,BARSLAST(FD0))<=REF(L,BARSLAST(D1X)) AND BARSLAST(G1X)>BARSLAST(D1X))

OR (FD1 AND COUNT(DQ,BARSLAST(FG1))>0 AND REF(L,BARSLAST(FD1))<REF(H,BARSLAST(D1X)));

G1H:=IF(BARSLAST(D1)>BARSLAST(G1),REF(H,BARSLAST(G1)),REF(H,BARSLAST(D1))),NODRAW;

D1L:=IF(BARSLAST(G1)>BARSLAST(D1),REF(L,BARSLAST(D1)),REF(L,BARSLAST(G1))),NODRAW;

G2:=G1 AND H=HHV(G1H,BARSLAST(D1)+1) AND H>REF(H,1) AND BARSLAST(D1)>BARSLAST(G1);

D2:=D1 AND L=LLV(D1L,BARSLAST(G1)+1) AND L<REF(L,1) AND BARSLAST(G1)>BARSLAST(D1);

NN:=G2 OR (FG0 AND REF(H,BARSLAST(FG0))>REF(H,BARSLAST(G2))

AND BARSLAST(D2)>BARSLAST(G2));

UU:=D2 OR (FD0 AND REF(L,BARSLAST(FD0))<REF(L,BARSLAST(D2))

AND BARSLAST(G2)>BARSLAST(D2));

找顶线:=DRAWLINE(NN,H,REF(NN,1),REF(H,1),1),COLORGREEN,DOTLINE;

找底线:=DRAWLINE(UU,L,REF(UU,1),REF(L,1),1),COLORRED,DOTLINE;

ZT:=C=ZTPRICE(REF(C,1),0.1);

{STICKLINE(ZT,C,O,2,0),COLORMAGENTA;}

DRAWICON(CROSS(C,找顶线),找顶线*5,34);

金牛:=(XMA(XMA(H,25),25)-XMA(XMA(L,25),25))*1+XMA(XMA(H,25),25),DOTLINE,COLORYELLOW;

金钻趋势:=XMA(XMA(L,25),25)-(XMA(XMA(H,25),25)-XMA(XMA(L,25),25))*1,LINETHICK2,COLORRED;

金牛2:=EMA(金钻趋势,25)COLORCYAN,LINETHICK2;

VAR23:=100*XMA(XMA((C-REF(C,1)),6),6)/XMA(XMA(ABS((C-REF(C,1))),6),6);

回调买:=LLV(VAR23,2)=LLV(VAR23,7) AND COUNT(VAR23<0,2) AND CROSS(VAR23,MA(VAR23,2));

XG:=金钻趋势>HIGH AND 回调买 AND L<=金钻趋势;

STICKLINE(XG,L,L*5,3,0),COLOR0099FF,LINETHICK9;

LOWV:=LLV(LOW,6);

HIGHV:=HHV(HIGH,6);

RSV:=EMA((CLOSE-LOWV)/(HIGHV-LOWV)*100,2);

K:=EMA(RSV,3);

{D:MA(K,3);}

{DRAWBAND(K,RGB(200,10,10),D,RGB(10,200,10));}

20,POINTDOT,COLORCYAN;

50,COLORRED,POINTDOT;

80,POINTDOT,COLORWHITE;

{IF(K>D,K,DRAWNULL),COLORYELLOW,LINETHICK1;

IF(K<D,K,DRAWNULL),COLORCYAN,LINETHICK1;}

LC:=REF(CLOSE,1);

RSI5:=((SMA(MAX((CLOSE - LC),0),5,1) / SMA(ABS((CLOSE - LC)),5,1)) * 100);

TR1:=SUM(MAX(MAX((HIGH - LOW),ABS((HIGH - REF(CLOSE,1)))),ABS((LOW - REF(CLOSE,1)))),10);

HD:=(HIGH - REF(HIGH,1));

LD:=(REF(LOW,1) - LOW);

DMP:=SUM(IF(((HD > 0) AND (HD > LD)),HD,0),10);

DMM:=SUM(IF(((LD > 0) AND (LD > HD)),LD,0),10);

PDI:=((DMP * 100) / TR1);

MDI:=((DMM * 100) / TR1);

ADX:=MA(((ABS((MDI - PDI)) / (MDI + PDI)) * 100),5);

AV:=(RSI5 + ADX);

DXR:=(((ADX + REF(ADX,5)) / 2) + RSI5);

WR10:=((100 * (HHV(HIGH,10) - CLOSE)) / (HHV(HIGH,10) - LLV(LOW,10)));

NEWVOL:=(RSI5 - WR10);

阶段底部:=(AV + NEWVOL);

趋势线:=LLV(阶段底部,1),COLORWHITE,LINETHICK0;

{STICKLINE((阶段底部 < 0),20,25,1,0),LINETHICK6,COLORYELLOW;

STICKLINE(CROSS(阶段底部,0),20,30,1,0),LINETHICK6,COLORRED;}

STICKLINE((趋势线 >230 ),90,85,1,0),LINETHICK6,COLORGREEN;

VAR1Z:=1;

VAR2Z:=1/WINNER(CLOSE);

VAR3Z:=MA(CLOSE,13);

VAR4Z:=100-ABS((CLOSE-VAR3Z)/VAR3Z*100);

VAR5:=LLV(LOW,75);

VAR6:=HHV(HIGH,75);

VAR7:=(VAR6-VAR5)/100;

VAR8:=SMA((CLOSE-VAR5)/VAR7,21,1);

VAR9:=SMA((OPEN-VAR5)/VAR7,21,1);

VARA:=3*VAR8-2*SMA(VAR8,13,1);

VARB:=3*VAR9-2*SMA(VAR9,13,1);

VARC:=100-VARB;

平衡:=50.5,COLOR998899,POINTDOT;

主力:=MA(WINNER(CLOSE*0.95)*100,3)*VAR1,COLORYELLOW,LINETHICK1;

散户:=(100-VARA)*VAR1,COLORLIBLUE,LINETHICK1;

{DRAWTEXT(CROSS(主力,散户) AND 主力>50,主力,'★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★'),COLORRED;}

→:=100,LINETHICK3,COLORYELLOW;

MINUS:=(主力-散户)>0;

{DRAWTEXT_FIX(1,0.850,0.85,0,MINUS),COLORWHITE;}

DRAWICON(CROSS(主力,散户) AND 主力>50,L,23);

AA:=WINNER(C+C*15/100)*100;

BB:=WINNER(C+C*0/100)*100;

CC:=AA-BB;

DD:=(WINNER(C-C*0.1/100)-WINNER(C-C*15/100))*100;

EE:=CC<3 AND DD<0.5 AND O<>L;

A1:=DYNAINFO(6);

A2:=IF(L>A1,0,IF(H<A1,1,(A1-L+0.01)/(H-L+0.01)));

A3:=V/WINNER(L);

A4:=REF(HHV(C,120),1);

A5:=REF(LLV(C,120),1);

A6:=100*(C-A5)/(A4-A5);

A7:=A2>0 OR A2=1;

A8:=A7 AND A3/REF(A3,3)>=3 AND A6<80 ;

A9:=REF(A8,1) OR REF(A8,2) OR REF(A8,3) OR REF(A8,4);

A10:=A8 AND A9;

进场:FILTER(A8,8),COLORBLUE;

加仓:=FILTER(A10,3) OR EE;

私募机构进场日:=STICKLINE(进场,0,0.9,8,0),COLORFF00FF;

私募机构加仓日:=STICKLINE(加仓,0,99,8,0),COLORFF00FF;

DRAWTEXT(进场,9.8,'进场'),COLORYELLOW;

{DRAWTEXT(加仓,1.3,'加仓'),COLORWHITE;};

V1X:=EMA(CLOSE,60)-EMA(CLOSE,300);

V2X:=EMA(V1X,300);

V3X:=(CLOSE-(LOW,8))/((HIGH,8)-LLV(LOW,8))*100;

V4X:=SMA(V3X,2,1),NODRAW;

V5Z:=SMA(V4X,2,1),NODRAW;

V6X:=CLOSE/REF(CLOSE,3)>=1.094;

V7X:=BACKSET(V6X,3);

大涨:=(V7X AND COUNT(V7X,2.9)=1)*999999999,LINETHICK9,COLORYELLOW;

大涨1:=(V7X AND COUNT(V7X,3)=1)*-999999999,LINETHICK9,COLORYELLOW;

STICKLINE((大涨),L,L*5,50,0),COLORYELLOW;

LCZ:=REF(CLOSE,1);

WRSI:=SMA(MAX(CLOSE-LC,0),5,1)/SMA(ABS(CLOSE-LC),5,1)*100;

WR10Z:=(HHV(HIGH,3)-CLOSE)/(HHV(HIGH,3)-LLV(LOW,3))*100;

活跃:=(WRSI-WR10);

活跃度比:=IF(活跃>=0,(活跃+100)/2,100-ABS((活跃-100)/2));

DRAWTEXT_FIX(1,0.50,0.55,1,STRCAT(STRCAT('活跃:',CON2STR(活跃度比,2)),'%')),COLORCYAN;