任意合并K线最大好处:通过N天K线形成一个较大K线,一般可看出短期的强弱

{任意合并K线 最大好处:通过n天K线形成一个较大K线,一般可看出短期的强弱}
XK:=5;XR1:=1;
 HH:=HHV(HIGH,XK);
 LL:=LLV(LOW ,XK);
 OO:=IF(XK<=1,OPEN,REF(OPEN,XK-1));
 CC:=CLOSE;
 XH1:=CONST(IF(ISLASTBAR,IF(XR1<=1,HH,REF(HH,XR1-1)),DRAWNULL)),NODRAW;
 XL1:=CONST(IF(ISLASTBAR,IF(XR1<=1,LL,REF(LL,XR1-1)),DRAWNULL)),NODRAW;
 XO1:=CONST(IF(ISLASTBAR,IF(XR1<=1,OO,REF(OO,XR1-1)),DRAWNULL)),NODRAW;
 XC1:=CONST(IF(ISLASTBAR,IF(XR1<=1,CC,REF(CC,XR1-1)),DRAWNULL)),NODRAW;
 STICKLINE(CURRBARSCOUNT=XR1+FLOOR(XK/2) AND XC1>XO1,XH1,XL1,XK*1+0.5,0)
 ,COLOR73599D;{合并阳K线上下影线}
STICKLINE(CURRBARSCOUNT=XR1+FLOOR(XK/2) AND XC1<XO1,XH1,XL1,XK*1+0.5,0)
 ,COLOR808000;{合并阴K线上下影线}
STICKLINE(CURRBARSCOUNT=XR1+FLOOR(XK/2) AND XC1>XO1,XO1,XC1,XK*4+0.5,0)
 ,COLOR73599D;{合并阳K线实体部份}
STICKLINE(CURRBARSCOUNT=XR1+FLOOR(XK/2) AND XC1<XO1,XO1,XC1,XK*4+0.5,0)
 ,COLOR808000;{合并阴K线实体部份}