BZ:=WEEkdAY;ZB:=BZ<REF(BZ,1);Z1:=SUMBARS(ZB,1);ZZ0:=SUMBARS(ZB,2);
BY:=MONTH;YB:=BY-REF(BY,1)<>0;Y1:=SUMBARS(YB,1);Y0:=SUMBARS(YB,2);
BJ:=ROUND(MONTH/3+0.3);JB:=BJ-REF(BJ,1)<>0;J1:=SUMBARS(JB,1);J0:=SUMBARS(JB,2);
BN:=IF(BY<7,1,2);NB:=BN-REF(BN,1)<>0;N1:=SUMBARS(NB,1);N0:=SUMBARS(NB,2);
年:=YEAR;FN:=年-REF(年,1)<>0;FN1:=SUMBARS(FN,1);FN0:=SUMBARS(FN,2);
p:=SYSPARAM(1);
周仓:SUM(amount,Z1)/10000,linethick,colorffff;
两连周仓:=sum(amount,ZZ0)/10000,linethick;
上周仓位:两连周仓-周仓,linethick,colorabc123;
月仓:SUM(amount,Y1)/10000,linethick,color0123bb;
两连月仓:=sum(amount,Y0)/10000,linethick;
上月仓位:两连月仓-月仓,linethick,color00bb00;
季仓:SUM(amount,J1)/10000,linethick,color001155;
两连季仓:=sum(amount,J0)/10000,linethick;
上季仓位:两连季仓-季仓,linethick,colordd2200;
半年仓:SUM(amount,N1)/10000,linethick,color33cc;
两连半年仓:=sum(amount,N0)/10000,linethick;
前半年仓:两连半年仓-半年仓,linethick,color0077ff;
年仓:SUM(amount,FN1)/10000,linethick,color00dd;
两连年仓:=sum(amount,FN0)/10000,linethick;
上年仓位:两连年仓-年仓,linethick,color005566;
stickline(barpos=sysparam(2)+20,0,上周仓位[p],80,0),colorabc123;
stickline(barpos=sysparam(2)+40,0,周仓[p],80,0),colorffff;
stickline(barpos=sysparam(2)+60,0,上月仓位[p],80,0),color00bb00;
stickline(barpos=sysparam(2)+80,0,月仓[p],80,0),color0123bb;
stickline(barpos=sysparam(2)+100,0,上季仓位[p],80,0),colordd2200;
stickline(barpos=sysparam(2)+120,0,季仓[p],80,0),color001155;
stickline(barpos=sysparam(2)+140,0,前半年仓[p],80,0),color0077ff;
stickline(barpos=sysparam(2)+160,0,半年仓[p],80,0),color33cc;
stickline(barpos=sysparam(2)+180,0,上年仓位[p],80,0),color005566;
stickline(barpos=sysparam(2)+200,0,年仓,80,0),color00dd;
DRAWTEXT(BARPOS=SYSPARAM(2)+20,0,' 上周'),ALIGN5,PXUP18,COLORFFffff;
DRAWTEXT(BARPOS=SYSPARAM(2)+40,0,' 本周'),ALIGN5,PXUP18,COLORFFFFFF;
DRAWTEXT(BARPOS=SYSPARAM(2)+60,0,' 上月'),ALIGN5,PXUP18,COLORFFFFFF;
DRAWTEXT(BARPOS=SYSPARAM(2)+80,0,' 本月'),ALIGN5,PXUP18,COLORFFFFFF;
DRAWTEXT(BARPOS=SYSPARAM(2)+100,0,' 上季'),ALIGN5,PXUP18,COLORFFFFFF;
DRAWTEXT(BARPOS=SYSPARAM(2)+120,0,' 本季'),ALIGN5,PXUP18,COLORFFFFFF;
DRAWTEXT(BARPOS=SYSPARAM(2)+140,0,' 前半年'),ALIGN5,PXUP18,COLORFFFFFF;
DRAWTEXT(BARPOS=SYSPARAM(2)+160,0,' 本半年'),ALIGN5,PXUP18,COLORFFFFFF;
DRAWTEXT(BARPOS=SYSPARAM(2)+180,0,' 上年'),ALIGN5,PXUP18,COLORFFFFFF;
DRAWTEXT(BARPOS=SYSPARAM(2)+200,0,' 本年'),ALIGN5,PXUP18,COLORFFFFFF;
DRAWTEXTEX(c,1,5,0,STKLABEL+' '+STKNAME+''),ColorFFFF00;
DRAWTEXTEX(C and 周仓[p]>上周仓位[p],1,0,300,'周仓位趋势:'+' ↑'),Color00EEFF;
DRAWTEXTEX(C and 周仓[p]<上周仓位[p],1,0,300,'周仓位趋势:'+' ↓'),Color00FF00;
DRAWTEXTEX(C and 月仓[p]>上月仓位[p],1,0,450,'月仓位趋势:'+' ↑'),Color00EEFF;
DRAWTEXTEX(C and 月仓[p]<上月仓位[p],1,0,450,'月仓位趋势:'+' ↓'),Color00FF00;
DRAWTEXTEX(C and 季仓[p]>上季仓位[p],1,0,600,'季仓位趋势:'+' ↑'),Color00EEFF;
DRAWTEXTEX(C and 季仓[p]<上季仓位[p],1,0,600,'季仓位趋势:'+' ↓'),Color00FF00;
DRAWTEXTEX(C and 半年仓[p]>前半年仓[p],1,0,750,'半年仓趋势:'+' ↑'),Color00EEFF;
DRAWTEXTEX(C and 半年仓[p]<前半年仓[p],1,0,750,'半年仓趋势:'+' ↓'),Color00FF00;
DRAWTEXTEX(C and 年仓[p]>上年仓位[p],1,0,900,'年仓位趋势:'+' ↑'),Color00EEFF;
DRAWTEXTEX(C and 年仓[p]<上年仓位[p],1,0,900,'年仓位趋势:'+' ↓'),Color00FF00;