DRAWTEXT_FIX(CLOSE>0,0,0,0,STRCAT(STRCAT(STRCAT(STRCAT(DYBLOCK,HYBLOCK),GNBLOCK),FGBLOCK),10)),COLOR80FFFF;
VAR1:=TOTALBARSCOUNT-BARSCOUNT(CLOSE)<IF(TOTALBARSCOUNT<0,TOTALBARSCOUNT-IF(CONST(天机泄露2#WEEK)<5000,CONST(天机泄露2#WEEK)+1,1000),0)+IF(CONST(天机泄露2#WEEK)<5000,CONST(天机泄露2#WEEK)+1,1000) AND PERIOD=5;
VAR2:=REF(天机泄露2#WEEK,IF(ISLASTBAR,0,SUMBARS(天机泄露2#WEEK-REF(天机泄露2#WEEK,1),TOTALBARSCOUNT-BARSCOUNT(CLOSE)-(CONST(SUM(天机泄露2#WEEK-REF(天机泄露2#WEEK,1),0))-SUM(天机泄露2#WEEK-REF(天机泄露2#WEEK,1),0))-1)));
VAR3:=REF(天机泄露2.BT#WEEK,IF(ISLASTBAR,0,SUMBARS(天机泄露2#WEEK-REF(天机泄露2#WEEK,1),TOTALBARSCOUNT-BARSCOUNT(CLOSE)-(CONST(SUM(天机泄露2#WEEK-REF(天机泄露2#WEEK,1),0))-SUM(天机泄露2#WEEK-REF(天机泄露2#WEEK,1),0))-1)));
VAR4:=REF(天机泄露2#WEEK,IF(ISLASTBAR,0,SUMBARS(天机泄露2#WEEK-REF(天机泄露2#WEEK,1),TOTALBARSCOUNT-BARSCOUNT(CLOSE)-(CONST(SUM(天机泄露2#WEEK-REF(天机泄露2#WEEK,1),0))-SUM(天机泄露2#WEEK-REF(天机泄露2#WEEK,1),0))-1)));
VAR5:=REF(天机泄露2#WEEK,IF(ISLASTBAR,0,SUMBARS(天机泄露2#WEEK-REF(天机泄露2#WEEK,1),TOTALBARSCOUNT-BARSCOUNT(CLOSE)-(CONST(SUM(天机泄露2#WEEK-REF(天机泄露2#WEEK,1),0))-SUM(天机泄露2#WEEK-REF(天机泄露2#WEEK,1),0))-1)));
VAR6:=REFX(VAR2,IF(TOTALBARSCOUNT<0,TOTALBARSCOUNT-IF(CONST(天机泄露2#WEEK)<5000,CONST(天机泄露2#WEEK)+1,1000),0));
VAR7:=REFX(VAR3,IF(TOTALBARSCOUNT<0,TOTALBARSCOUNT-IF(CONST(天机泄露2#WEEK)<5000,CONST(天机泄露2#WEEK)+1,1000),0));
VAR8:=REFX(VAR4,IF(TOTALBARSCOUNT<0,TOTALBARSCOUNT-IF(CONST(天机泄露2#WEEK)<5000,CONST(天机泄露2#WEEK)+1,1000),0));
VAR9:=REFX(VAR5,IF(TOTALBARSCOUNT<0,TOTALBARSCOUNT-IF(CONST(天机泄露2#WEEK)<5000,CONST(天机泄露2#WEEK)+1,1000),0));
VAR10:=VAR6>=REF(VAR6,1);
VAR11:=VAR6<REF(VAR6,1);
STICKLINE(VAR1 AND VAR10,VAR8,VAR9,0,0),COLORRED;
STICKLINE(VAR1 AND VAR11,VAR8,VAR9,0,0),COLORLIBLUE;
STICKLINE(VAR1 AND VAR10,VAR6,VAR7,3,1),COLORRED;
STICKLINE(VAR1 AND VAR11,VAR6,VAR7,3,0),COLORLIBLUE;
VAR12:=ALIGNRIGHT(IF(WEEKOFYEAR!=REF(WEEKOFYEAR,1),CLOSE#WEEK,DRAWNULL));
MA5:MA(VAR12,5),COLORWHITE;
MA10:MA(VAR12,10),COLORYELLOW;
MA20:MA(VAR12,20),COLORMAGENTA;
MA60:MA(VAR12,60),COLORGREEN;
MA120:MA(VAR12,120),COLORRED;