TBS:=POW(10,ABS(LOG(MINDIFF)));
//周线
BZ:=WEEKDAY;ZB:=DATEDIFF(REF(DATE,1),DATE)<>BZ-REF(BZ,1) OR BARPOS=1;
ZW:=BARSLAST(ZB),LINETHICK;
Zdg:=ZW=0 or ISLASTBAR;
Zwx:=0*c;
for i=datacount-1 downto lbound(Zdg) do
if Zdg[i] then
Zwx[i]:=0;
else
Zwx[i]:=Zwx[i+1]+1;
Zr:=BACKSET(ISLASTBAR,Zw+1)-ISLASTBAR;
Zwx:=refx(Zwx,1)+Zr,LINETHICK;
zq:=BARSLAST(ref(Zwx,1)=0 or BARPOS=1)+1;
Zo:=ref(o,Zw);
Zh:=hhv(h,Zw+1);
ZL:=LLv(L,Zw+1);
周开:ROUND(ZO*TBS)/TBS,LINETHICK;
周高:ROUND(refx(Zh,Zwx)*TBS)/TBS,,COLORFF,LINETHICK;
周低:ROUND(refx(ZL,Zwx)*TBS)/TBS,COLORFF00,LINETHICK;
周收:ROUND(refx(c,Zwx)*TBS)/TBS,,COLORFF00FF,LINETHICK;
Zf:=周收>周开 or (周收=周开 and 周收>ref(周收,Zw+1));
Zj:=cross(Zw,Zwx);// OR ISLASTBAR;
yt:=if(zq=1 and refx(zq,2)=1,13,if(refx(zq,1)=1 or zq=1,7,14));
//影线
STICKLINE(Zw>0 and Zf and Zj,周低,周高,1,0)COLORAAAAEE;
STICKLINE(周开<周收,周开,周收,YT,0),COLORAAAAEE;
STICKLINE(Zw>0 and not(Zf) and Zj,周低,周高,1,0)COLOREEAAAA;
STICKLINE(周开>周收,周开,周收,YT,0),COLOREEAAAA;
//日线
TJ:=CLOSE>OPEN or CLOSE=OPEN and CLOSE>REF(CLOSE,1);
STICKLINE(TJ,LOW,HIGH,1,0),ColorE9;
STICKLINE(TJ,LOW,CLOSE,8,0),Color80;
STICKLINE(TJ,LOW,CLOSE,6,0),ColorA5;
STICKLINE(TJ,LOW,CLOSE,4,0),ColorC0;
STICKLINE(TJ,LOW,CLOSE,2,0),ColorE6;
STICKLINE(NOT(TJ),HIGH,LOW,1,0),ColorAA00;
STICKLINE(NOT(TJ),CLOSE,OPEN,8,0),Color5000;
STICKLINE(NOT(TJ),CLOSE,OPEN,6,0),Color6600;
STICKLINE(NOT(TJ),CLOSE,OPEN,4,0),Color8000;
STICKLINE(NOT(TJ),CLOSE,OPEN,2,0),ColorA000;
//月线
BY:=MONTH;YB:=BY-REF(BY,1)<>0 OR BARPOS=1;
w:=BARSLAST(YB),LINETHICK;
dg:=w=0 or ISLASTBAR;
wx:=0*C;
for i=datacount-1 downto lbound(dg) do
if dg[i] then
wx[i]:=0;
else
wx[i]:=wx[i+1]+1;
r:=BACKSET(ISLASTBAR,w+1)-ISLASTBAR;
wx:=refx(wx,1)+r,LINETHICK;
oo:=ref(o,w);
hh:=hhv(h,w+1);
LL:=LLv(L,w+1);
月开:ROUND(OO*TBS)/TBS,LINETHICK;
月高:ROUND(refx(hh,wx)*TBS)/TBS,LINETHICK;
月低:ROUND(refx(LL,wx)*TBS)/TBS,LINETHICK;
月收:ROUND(refx(c,wx)*TBS)/TBS,LINETHICK;
f:=月收>月开 or (月收=月开 and 月收>ref(月收,w+1));
j:=cross(w,wx);// OR ISLASTBAR;
//画横线
PARTLINE(w>0 and f,月收)COLORMAGENTA;
PARTLINE(w>0 and f,月开)COLORMAGENTA;
//影线
STICKLINE(w>0 and f and j,月收,月高,1,0),COLORMAGENTA;
STICKLINE(w>0 and f and j,月开,月低,1,0),COLORMAGENTA;
STICKLINE(w=0 and f ,月收,月开,1,0),COLORMAGENTA;
STICKLINE((refx(w=0,1) or ISLASTBAR) and f,月开,月收,1,0),COLORMAGENTA;
PARTLINE(w>0 and not(f),月收),COLORFFDD00;
PARTLINE(w>0 and not(f),月开),COLORFFDD00;
STICKLINE(w>0 and not(f) and j,月开,月高,1,0)COLORFFDD00;
STICKLINE(w>0 and not(f) and j,月收,月低,1,0)COLORFFDD00;
STICKLINE(w=0 and not(f),月开,月收,1,0)COLORFFDD00;
STICKLINE((refx(w=0,1) or ISLASTBAR) and not(f),月收,月开,1,0)COLORFFDD00;
//