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

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

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

DRAWTEXT_FIX(01,0.01,0.01.0,0,CJL1),COLORYELLOW;

高点:=50;

低点:=30;

GD:=CONST(FINDHIGH(H,0,高点*10,1));

DD:=CONST(FINDLOW(L,0,低点*10,1));

GT:=CONST(BARSLAST(GD=H))+1;

DT:=CONST(BARSLAST(DD=L))+1;

SH:=CONST(IF(GT=1,H,REF(H,GT-1)));

SL:=CONST(IF(DT=1,L,REF(L,DT-1)));

CC:=IF(DT>GT,DT,GT);

CD:=INTPART(CC-(DT+GT)/2);

CG:=IF(高点>CD,CD/2,高点);

下跌周期:BARSLAST(GD=H),COLORWHITE,NODRAW;

下跌幅:IF(CURRBARSCOUNT<=GT,C/SH*100-100,DRAWNULL),NODRAW,COLORGREEN;

下跌均价:IF(CURRBARSCOUNT<=GT,SUM(AMOUNT,GT)/SUM(V,GT)/100,DRAWNULL),NODRAW,COLORLIGRAY;

跌换手%:IF(CURRBARSCOUNT<=GT,SUM(HSL.HSL,GT),DRAWNULL),COLORCYAN,NODRAW;

上涨周期:IF(CURRBARSCOUNT<=DT,BARSLAST(DD=L),DRAWNULL),COLORWHITE,NODRAW;

上涨幅:IF(CURRBARSCOUNT<=DT,C/SL*100-100,DRAWNULL),NODRAW,COLORRED;

上涨均价:IF(CURRBARSCOUNT<=DT,SUM(AMOUNT,DT)/SUM(V,DT)/100,DRAWNULL),NODRAW,COLORLIGRAY;

涨换手%:IF(CURRBARSCOUNT<=DT,SUM(HSL.HSL,DT),DRAWNULL),COLORLIMAGENTA,NODRAW;

星期:=VARCAT(VARCAT('(',IF(WEEKDAY=1,'一',IF(WEEKDAY=2,'二',IF(WEEKDAY=3,'三',IF(WEEKDAY=4,'四',IF(WEEKDAY=5,'五','')))))),')');

日期:=VARCAT('-',VARCAT(VARCAT(VARCAT(VARCAT(VARCAT(VARCAT(VAR2STR(YEAR,0),'年'),VAR2STR(MONTH,0)),'月'),VAR2STR(DAY,0)),'日'),星期));

{自动黄金分割 普通等系坐标}

STICKLINE(CURRBARSCOUNT=DT AND TIME<=0935,SL*20 ,SL,8,0),COLORYELLOW;

STICKLINE(CURRBARSCOUNT=GT,SH,SH-SH*0.9,0,-1),COLORGREEN;

{DRAWTEXT(CURRBARSCOUNT=DT ,(SL+SL*1.2)/2,日期),COLORYELLOW;

DRAWTEXT(CURRBARSCOUNT=GT ,GD*0.97,日期),COLORYELLOW;}

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

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

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

{STICKLINE(金钻趋势>LOW AND 金钻趋势<HIGH,金钻趋势,MIN(MIN(OPEN,CLOSE),金钻趋势),2,0),COLORYELLOW;

STICKLINE(金钻趋势>MIN(C,O) AND 金钻趋势<MAX(C,O),金钻趋势,MIN(OPEN,CLOSE),2,0),COLORYELLOW;

STICKLINE(金钻趋势>HIGH,OPEN,CLOSE,2,0),COLORYELLOW;

STICKLINE(金钻趋势>HIGH,HIGH,LOW,2,0),COLORYELLOW;}

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<=金钻趋势;

{DRAWTEXT(XG,L+0.04,'▲买入'),COLORMAGENTA;}

{STICKLINE(XG,L,L*9,3,0),COLOR0099FF,LINETHICK9;}

N:=CURRBARSCOUNT;

B:=C<REF(C,4);

T1:= BARSLASTCOUNT(B);

A_B1:=(T1>9) AND MOD(T1,9)=1;

A_B2:=(T1>9) AND MOD(T1,9)=2;

A_B8:=(T1>9) AND MOD(T1,9)=8;

A_B9:=(T1>9) AND MOD(T1,9)=0;

B1:=(N=6 AND REFXV(COUNT(B,6),5)=6) OR (N=7 AND REFXV(COUNT(B,7),6)=7) OR (N=8 AND REFXV(COUNT(B,8),7)=8) OR (N>=9 AND REFXV(COUNT(B,9),8)=9);

DRAWNUMBER(B1 AND (REF(B,1)=0 OR A_B1),L,1),COLORMAGENTA;

B2:=(N=5 AND REFXV(COUNT(B,6),4)=6) OR (N=6 AND REFXV(COUNT(B,7),5)=7) OR (N=7 AND REFXV(COUNT(B,8),6)=8) OR (N>=8 AND REFXV(COUNT(B,9),7)=9);

DRAWNUMBER(B2 AND(REF(B,2)=0 OR A_B2),L,2),COLORMAGENTA;

B8:=(N=1 AND COUNT(B,8)=8) OR (N>=2 AND REFXV(COUNT(B,9),1)=9);

DRAWNUMBER(B8 AND (REF(B,8)=0 OR A_B8),L,8),COLORMAGENTA;

B9:=(N>=1 AND COUNT(B,9)=9);

DRAWNUMBER(B9 AND (REF(B,9)=0 OR A_B9),L,9),COLORRED;

S:=C>REF(C,4);

T2:= BARSLASTCOUNT(S);

A_S1:=(T2>9) AND MOD(T2,9)=1;

A_S2:=(T2>9) AND MOD(T2,9)=2;

A_S9:=(T2>9) AND MOD(T2,9)=0;

S1:=(N=6 AND REFXV(COUNT(S,6),5)=6) OR (N=7 AND REFXV(COUNT(S,7),6)=7) OR (N=8 AND REFXV(COUNT(S,8),7)=8) OR (N>=9 AND REFXV(COUNT(S,9),8)=9);

DRAWNUMBER(S1 AND (REF(S,1)=0 OR A_S1) AND TIME<=0935,H,1),COLORGREEN,DRAWABOVE;

S2:=(N=5 AND REFXV(COUNT(S,6),4)=6) OR (N=6 AND REFXV(COUNT(S,7),5)=7) OR (N=7 AND REFXV(COUNT(S,8),6)=8) OR (N>=8 AND REFXV(COUNT(S,9),7)=9);

DRAWNUMBER(S2 AND (REF(S,2)=0 OR A_S2) AND TIME<=0935 ,H*9,2),COLORGREEN,DRAWABOVE;

S8:=(N=1 AND COUNT(S,8)=8) OR (N>=2 AND REFXV(COUNT(S,9),1)=9);