任意合并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线实体部份}
来函数检测结果如下:
该公式没有未来函数
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
XK赋值:5
XR1赋值:1
HH赋值:XK日内最高价最高值
LL赋值:XK日内最低价 最低值
OO赋值:IF(XK<=1,开盘价,XK-1日前的开盘价)
CC赋值:收盘价
{股票指标网}
XH1赋值:CONST(IF(ISLASTBAR,IF(XR1<=1,HH,XR1-1日前的HH),DRAWNULL)),NODRAW
XL1赋值:CONST(IF(ISLASTBAR,IF(XR1<=1,LL,XR1-1日前的LL),DRAWNULL)),NODRAW
XO1赋值:CONST(IF(ISLASTBAR,IF(XR1<=1,OO,XR1-1日前的OO),DRAWNULL)),NODRAW
XC1赋值:CONST(IF(ISLASTBAR,IF(XR1<=1,CC,XR1-1日前的CC),DRAWNULL)),NODRAW
STICKLINE( 到最后交易的周期=XR1+FLOOR(XK/2) AND XC1>XO1,XH1,XL1,XK*1+0.5,0)
,COLOR73599D
{合并阳K线上下影线}
STICKLINE( 到最后交易的周期=XR1+FLOOR(XK/2) AND XC1
,COLOR808000
{合并阴K线上下影线}
STICKLINE( 到最后交易的周期=XR1+FLOOR(XK/2) AND XC1>XO1,XO1,XC1,XK*4+0.5,0)
,COLOR73599D
{合并阳K线实体部份}
STICKLINE( 到最后交易的周期=XR1+FLOOR(XK/2) AND XC1
,COLOR808000
{合并阴K线实体部份}