红绿金盾线A简单买和卖通达信公式 主图 源码附图
NH:=120;
KK:=BARSLAST(CURRBARSCOUNT=NH);
GD:=CONST(IF(ISLASTBAR=1,HHV(H,KK),0));
DD:=CONST(IF(ISLASTBAR=1,LLV(L,KK),0));
KJ:=GD-DD;
GD4:=IF(CURRBARSCOUNT<=NH/2,GD,DRAWNULL);
DRAWBAND(GD4,RGB(80,80,30),DD+KJ/2,RGB(0,0,0));{该行设置背景色}
突破:REF(EMA(C,14),1)COLORRED,LINETHICK2;
A1X:=(EMA(C,14)-突破)/突破*100,NODRAW;
多方:IF(A1X>=0,REF(EMA(C,14),BARSLAST(CROSS(A1X,0))+1),DRAWNULL)COLORRED,LINETHICK2;
IF(A1X>=0,突破,DRAWNULL),COLORRED,LINETHICK2;
空方:IF(A1X<0,REF(EMA(C,14),BARSLAST(CROSS(0,A1X))+1),DRAWNULL)COLORGREEN,LINETHICK2;
IF(A1X<0 ,突破,DRAWNULL),COLORGREEN,LINETHICK2;
DRAWTEXT_FIX(1,0.00,0.00,0,' 股票指标网'),COLORRED;
STICKLINE(CROSS(A1X,0),C,O,2,0)COLORRED;
STICKLINE(CROSS(A1X,0),H,L,0,1)COLORRED;
STICKLINE(CROSS(0,A1X),C,O,2,0)COLORGREEN;
STICKLINE(CROSS(0,A1X),H,L,0,1)COLORGREEN;
STICKLINE(突破>0,O,C,2,0), COLORRED;
STICKLINE(突破>0,H,L,0,0), COLORRED;
STICKLINE(A1X<0,O,C,2,0), COLORGREEN;
STICKLINE(A1X<0,H,L,0,0), COLORGREEN;
STICKLINE(CROSS(0,A1X),C,O,2,0)COLORGREEN;
STICKLINE(CROSS(0,A1X),H,L,0,1)COLORGREEN;
STICKLINE(CROSS(A1X,0),C,O,2,0)COLORYELLOW;
STICKLINE(CROSS(A1X,0),H,L,0,1)COLORYELLOW;
STICKLINE(A1X>=0,多方,突破,0,-1)COLORRED;
STICKLINE(A1X<0,空方,突破,0,-1)COLORGREEN;
平衡:IF(CURRBARSCOUNT<=NH,DD+KJ/2,DRAWNULL),COLOR0055FF;
压力:IF(CURRBARSCOUNT<=NH,GD-KJ*0.191,DRAWNULL),COLOR00FF00;
支撑:IF(CURRBARSCOUNT<=NH,DD+KJ*0.191,DRAWNULL),COLOR00FFFF;
顶点:IF(CURRBARSCOUNT<=NH/2, CONST(IF(ISLASTBAR=1,HHV(H, BARSLAST(CURRBARSCOUNT=60)),1)),DRAWNULL),COLORLIRED,POINTDOT,LINETHICK3;
低点:IF(CURRBARSCOUNT<=NH/2, CONST(IF(ISLASTBAR=1,LLV(L, BARSLAST(CURRBARSCOUNT=60)),1)),DRAWNULL),COLORMAGENTA,POINTDOT,LINETHICK3;
STICKLINE(CCI>=200 AND H>=顶点,O,C,2,0),COLORLIRED;
STICKLINE(CCI<=100 AND L<=低点,O,C,2,0),COLORMAGENTA;
阿鹏哥:=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);
NOTEXT下笔划线:=DRAWLINE(顶,H,底,L,0);
分界点:=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,{60F}
IF(PERIOD=3,0.001,{30F}
IF(PERIOD=2,0.001,{15F}
IF(PERIOD=1,0.0003,{5F}
IF(PERIOD=0,0.0002,{1F}0))))))))))));
DRAWNUMBER(分界点 AND 顶,H+H*位置调整,H),COLORCYAN;
DRAWNUMBER(分界点 AND 底,L,L),COLORLIMAGENTA;
HIGHN:=10;
LOWN:=10;
HIGHDISPLAY:=0;
LOWDISPLAY:=0;
ZGDISPLAY:=0;
MADISPLAY:=0;
AAP:=REF(H,HIGHN)=HHV(H,2*HIGHN+1);
QY:=BACKSET(AAP,HIGHN+1);
CC2:=FILTER(QY,HIGHN) AND H=HHV(H,HIGHN+1);
DRAWICON(CC2,H*1.01,2);
AAAA1:=REF(L,LOWN)=LLV(L,2*LOWN+1);
QY1:=BACKSET(AAAA1,LOWN+1);
CC1P:=FILTER(QY1,LOWN) AND L=LLV(L,LOWN+1);
DRAWICON(CC1P,L*0.99,1);
未来函数检测结果如下:
该公式包含未来函数:BACKSET
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
NH赋值:120
KK赋值:上次 到最后交易的周期=NH距今天数
GD赋值:CONST(IF(ISLASTBAR=1,KK日内H最高值,0))
DD赋值:CONST(IF(ISLASTBAR=1,KK日内L最低值,0))
KJ赋值:GD-DD
如果 到最后交易的周期<=NH/2返回GD否则返回DRAWNULL
DRAWBAND(GD4,RGB(80,80,30),DD+KJ/2,RGB(0,0,0))
输出{该行设置背景色}
突破:1日前的C的14日指数移动平均画红色, 线宽为2
A1X赋值:(C的14日指数移动平均-突破)/突破*100,NODRAW
输出多方:IF(A1X>=0,REF(C的14日指数移动平均,上次A1X上穿0距今天数+1),DRAWNULL)画红色, 线宽为2
如果A1X>=0返回突破否则返回DRAWNULL
输出空方:IF(A1X<0,REF(C的14日指数移动平均,上次0上穿A1X距今天数+1),DRAWNULL)画绿色, 线宽为2
如果A1X<0 返回突破否则返回DRAWNULL
当满足条件1时,在横轴0.00纵轴0.00位置书写文字
STICKLINE(A1X上穿0,C,O,2,0)画红色
STICKLINE(A1X上穿0,H,L,0,1)画红色
STICKLINE(0上穿A1X,C,O,2,0)画绿色
STICKLINE(0上穿A1X,H,L,0,1)画绿色
当满足条件突破>0时,在O和C之间画柱状线
当满足条件突破>0时,在H和L之间画柱状线
当满足条件A1X<0时,在O和C之间画柱状线
当满足条件A1X<0时,在H和L之间画柱状线
STICKLINE(0上穿A1X,C,O,2,0)画绿色
STICKLINE(0上穿A1X,H,L,0,1)画绿色
STICKLINE(A1X上穿0,C,O,2,0)画黄色
STICKLINE(A1X上穿0,H,L,0,1)画黄色
当满足条件A1X>=0时,在多方和突破之间画柱状线
当满足条件A1X<0时,在空方和突破之间画柱状线
如果 到最后交易的周期<=NH返回DD+KJ/2否则返回DRAWNULL
如果 到最后交易的周期<=NH返回GD-KJ*0.191否则返回DRAWNULL
如果 到最后交易的周期<=NH返回DD+KJ*0.191否则返回DRAWNULL
输出顶点:IF( 到最后交易的周期<=NH/2, CONST(IF(ISLASTBAR=1,HHV(H, 上次 到最后交易的周期=60距今天数),1)),DRAWNULL),COLORLIRED,POINTDOT, 线宽为3
输出低点:IF( 到最后交易的周期<=NH/2, CONST(IF(ISLASTBAR=1,LLV(L, 上次 到最后交易的周期=60距今天数),1)),DRAWNULL),画洋红色,POINTDOT, 线宽为3
当满足条件CCI>=200 AND H>=顶点时,在O和C之间画柱状线
当满足条件CCI<=100 AND L<=低点时,在O和C之间画柱状线
阿鹏哥赋值: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)
NOTEXT下笔划线赋值:DRAWLINE(顶,H,底,L,0)
分界点赋值: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,{60F}
IF(PERIOD=3,0.001,{30F}
IF(PERIOD=2,0.001,{15F}
IF(PERIOD=1,0.0003,{5F}
IF(PERIOD=0,0.0002,{1F}0))))))))))))
DRAWNUMBER(分界点 AND 顶,H+H*位置调整,H),画青色
DRAWNUMBER(分界点 AND 底,L,L),COLORLIMAGENTA
HIGHN赋值:10
LOWN赋值:10
HIGHDISPLAY赋值:0
LOWDISPLAY赋值:0
ZGDISPLAY:=0
MADISPLAY赋值:0
AAP赋值:HIGHN日前的H=2*HIGHN+1日内H最高值
QY赋值:BACKSET(AAP,HIGHN+1)
CC2赋值:QY的HIGHN过滤 AND H=HIGHN+1日内H最高值
当满足条件CC2时,在H*1.01和2之间画图标
AAAA1赋值:LOWN日前的L=2*LOWN+1日内L最低值
QY1:=BACKSET(AAAA1,LOWN+1)
CC1P赋值:QY1的LOWN过滤 AND L=LOWN+1日内L最低值
当满足条件CC1P时,在L*0.99和1之间画图标