高点:=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=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;

{斐波那契周期}

DRAWTEXT(CURRBARSCOUNT=GT-2 ,L,'3'),COLOR00FF00;

DRAWTEXT(CURRBARSCOUNT=GT-4 ,L,'5'),COLOR00FF00;

DRAWTEXT(CURRBARSCOUNT=GT-7 ,L,'8'),COLOR00FF00;

DRAWTEXT(CURRBARSCOUNT=GT-12 ,L,'13'),COLOR00FF00;

DRAWTEXT(CURRBARSCOUNT=GT-20 ,L,'21'),COLOR00FF00;

DRAWTEXT(CURRBARSCOUNT=GT-33 ,L,'34 '),COLOR00FF00;

DRAWTEXT(CURRBARSCOUNT=GT-54 ,L,'55'),COLOR00FF00;

DRAWTEXT(CURRBARSCOUNT=GT-88 ,L,'89'),COLOR00FF00;

DRAWTEXT(CURRBARSCOUNT=GT-143 ,L,'144'),COLOR00FF00;

DRAWTEXT(CURRBARSCOUNT=GT-232 ,L,'233'),COLOR00FF00;

DRAWTEXT(CURRBARSCOUNT=GT-376 ,L,'377'),COLOR00FF00;

DRAWTEXT(CURRBARSCOUNT=DT-2,H,'3'),DRAWABOVE,COLORRED;

DRAWTEXT(CURRBARSCOUNT=DT-4,H,'5'),DRAWABOVE,COLORRED;

DRAWTEXT(CURRBARSCOUNT=DT-7,H,'8'),DRAWABOVE,COLORRED;

DRAWTEXT(CURRBARSCOUNT=DT-12,H,'13'),DRAWABOVE,COLORRED;

DRAWTEXT(CURRBARSCOUNT=DT-20,H,'21'),DRAWABOVE,COLORRED;

DRAWTEXT(CURRBARSCOUNT=DT-33,H,'34'),DRAWABOVE,COLORRED;

DRAWTEXT(CURRBARSCOUNT=DT-54,H,'55'),DRAWABOVE,COLORRED;

DRAWTEXT(CURRBARSCOUNT=DT-88,H,'89'),DRAWABOVE,COLORRED;

DRAWTEXT(CURRBARSCOUNT=DT-143,H,'144'),DRAWABOVE,COLORRED;

DRAWTEXT(CURRBARSCOUNT=DT-232,H,'233'),DRAWABOVE,COLORRED;

DRAWTEXT(CURRBARSCOUNT=DT-376,H,'377'),DRAWABOVE,COLORRED;

{下跌尺}

DRAWTEXT(CURRBARSCOUNT=GT,SH-SH*0.14.6,STRCAT('-14.6% ',CON2STR(SH-SH*0.146,2))),COLORRED;

DRAWTEXT(CURRBARSCOUNT=GT,SH-SH*0.191,STRCAT('-19.1% ',CON2STR(SH-SH*0.191,2))),COLORRED;

DRAWTEXT(CURRBARSCOUNT=GT,SH-SH*0.236,STRCAT('-23.6% ',CON2STR(SH-SH*0.236,2))),COLORRED;

DRAWTEXT(CURRBARSCOUNT=GT,SH-SH*0.382,STRCAT('-38.2% ',CON2STR(SH-SH*0.382,2))),COLORYELLOW;

DRAWTEXT(CURRBARSCOUNT=GT,SH-SH*0.5,STRCAT('-50.0% ',CON2STR(SH-SH*0.5,2))),COLORLIMAGENTA;

DRAWTEXT(CURRBARSCOUNT=GT,SH-SH*0.618,STRCAT('-61.8% ',CON2STR(SH-SH*0.618,2))),COLORYELLOW;

DRAWTEXT(CURRBARSCOUNT=GT,SH-SH*0.764,STRCAT('-76.4% ',CON2STR(SH-SH*0.764,2))),COLORGREEN;

DRAWTEXT(CURRBARSCOUNT=GT,SH-SH*0.809,STRCAT('-80.9% ',CON2STR(SH-SH*0.809,2))),COLORGREEN;

DRAWTEXT(CURRBARSCOUNT=GT,SH-SH*0.854,STRCAT('-85.4% ',CON2STR(SH-SH*0.854,2))),COLORGREEN;