缠论超级箱体 通达信主图指标源码
EXP1:EXPMA(CLOSE,12);EXP2:EXPMA(CLOSE,50);EXP3:EXPMA(CLOSE,60);AB:=EMA(((2*C+H+L)/4-LLV(LOW,30))/(HHV(HIGH,30)-LLV(LOW,30))*100,8);BA:=EMA(AB,5);A1:=REFDATE(REF(HHV(H,96),5),DATE);B1:=REFDATE(REF(LLV(L,96),5),DATE);DY:=((A1)+(B1))/2;箱顶:IF(AB>0 AND AB-BA<=0,A1,A1),LINETHICK3,COLOR00FF00;箱腰:IF(AB>0 AND AB-BA<=0,DY,DY),LINETHICK3,COLOR00FF00;箱低:IF(AB>0 AND AB-BA<=0,B1,B1),LINETHICK3,COLOR00FF00;DRAWTEXT_FIX(1,0,0.95,0,'公众号:指标公式研究所'),COLORMAGENTA;高1:IF(AB>0 AND AB-BA>0,A1,DRAWNULL),LINETHICK3,COLORRED;中1:IF(AB>0 AND AB-BA>0,DY,DRAWNULL),LINETHICK3,COLORRED;低1:IF(AB>0 AND AB-BA>0,B1,DRAWNULL),LINETHICK3,COLORRED;顶周期:=TOPRANGE(H);底周期:=LOWRANGE(L);上内:=LLVBARS(H,顶周期);上外:=LLVBARS(L,顶周期);下内:=HHVBARS(L,底周期);下外:=HHVBARS(H,底周期);上力度:=HHV(L,上内+1)>LLV(H,上内+1);下力度:=HHV(L,下内+1)>LLV(H,下内+1);上包含:=COUNT(L>=REF(L,1),上外)>2 AND COUNT(H>=REF(H,1),上内)>2;下包含:=COUNT(H<=REF(H,1),下外)>2 AND COUNT(L<=REF(L,1),下内)>2;顶0:=顶周期 AND 上力度 AND 上包含 AND 上外>3;底0:=底周期 AND 下力度 AND 下包含 AND 下外>3;顶分天数:=BARSLAST(顶0);底分天数:=BARSLAST(底0);含中间K线:=IF(顶分天数=0,底分天数,顶分天数)>=3;顶:=顶0 AND 含中间K线 AND H=HHV(H,BARSLAST(底0));底:=底0 AND 含中间K线 AND L=LLV(L,BARSLAST(顶0));NOTEXT上笔划线:DRAWLINE(底,L,顶,H,0),COLORLIRED,LINETHICK3;NOTEXT下笔划线:DRAWLINE(顶,H,底,L,0),COLORLIGREEN,LINETHICK3;分界点:=NOTEXT上笔划线 AND NOTEXT下笔划线;位置调整:= IF(PERIOD=11,0.02,IF(PERIOD=10,0.02,IF(PERIOD=9,0.02, IF(PERIOD=8,0.001,IF(PERIOD=7,0.02, IF(PERIOD=6,0.01, IF(PERIOD=5,0.005, IF(PERIOD=4,0.002,IF(PERIOD=3,0.001,IF(PERIOD=2,0.001,IF(PERIOD=1,0.0003,IF(PERIOD=0,0.0002,0))))))))))));DRAWNUMBER(分界点 AND 顶,H+H*位置调整,H),COLORLIGREEN;DRAWNUMBER(分界点 AND 底,L,L),COLORLIMAGENTA;
来函数检测结果如下:
该公式没有未来函数
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
输出EXP1:收盘价的12日指数移动平均
输出EXP2:收盘价的50日指数移动平均
输出EXP3:收盘价的60日指数移动平均
AB赋值:EMA(((2*C+H+L)/4-30日内最低价最低值)/(30日内最高价最高值-30日内最低价最低值)*100,8)
BA赋值:AB的5日指数移动平均
A1赋值:REFDATE(REF(96日内H最高值,5),DATE)
B1赋值:REFDATE(REF(96日内L最低值,5),DATE)
DY赋值:((A1)+(B1))/2
如果AB>0 AND AB-BA<=0返回A1否则返回A1
如果AB>0 AND AB-BA<=0返回DY否则返回DY
如果AB>0 AND AB-BA<=0返回B1否则返回B1
当满足条件1时,在横轴0纵轴0.95位置书写文字
如果AB>0 AND AB-BA>0返回A1否则返回DRAWNULL
如果AB>0 AND AB-BA>0返回DY否则返回DRAWNULL
如果AB>0 AND AB-BA>0返回B1否则返回DRAWNULL
顶周期赋值:TOPRANGE(H)
底周期赋值:最低价RANGE(L)
上内赋值:LLVBARS(H,顶周期)
上外赋值:LLVBARS(L,顶周期)
下内赋值:HHVBARS(L,底周期)
下外赋值:HHVBARS(H,底周期)
上力度赋值:上内+1日内L最高值>上内+1日内H最低值
下力度赋值:下内+1日内L最高值>下内+1日内H最低值
上包含赋值:COUNT(L>=1日前的L,上外)>2 AND COUNT(H>=1日前的H,上内)>2
下包含赋值:COUNT(H<=1日前的H,下外)>2 AND COUNT(L<=1日前的L,下内)>2
顶0赋值:顶周期 AND 上力度 AND 上包含 AND 上外>3
底0赋值:底周期 AND 下力度 AND 下包含 AND 下外>3
顶分天数赋值:上次顶0距今天数
底分天数赋值:上次底0距今天数
如果顶分天数=0返回底分天数否则返回顶分天数
顶赋值:顶0 AND 含中间K线 AND H=HHV(H,上次底0距今天数)
底赋值:底0 AND 含中间K线 AND L=LLV(L,上次顶0距今天数)
输出NOTEXT上笔划线:DRAWLINE(底,L,顶,H,0),COLORLIRED, 线宽为3
输出NOTEXT下笔划线:DRAWLINE(顶,H,底,L,0),COLORLIGREEN, 线宽为3
分界点赋值:NOTEXT上笔划线 AND NOTEXT下笔划线
位置调整赋值: IF(PERIOD=11,0.02,IF(PERIOD=10,0.02,IF(PERIOD=9,0.02, IF(PERIOD=8,0.001,IF(PERIOD=7,0.02, IF(PERIOD=6,0.01, IF(PERIOD=5,0.005, IF(PERIOD=4,0.002,IF(PERIOD=3,0.001,IF(PERIOD=2,0.001,IF(PERIOD=1,0.0003,IF(PERIOD=0,0.0002,0))))))))))))
DRAWNUMBER(分界点 AND 顶,H+H*位置调整,H),COLORLIGREEN
DRAWNUMBER(分界点 AND 底,L,L),COLORLIMAGENTA