通达信公式源码概况:
指标类别:通达信公式
授权方式: 免费版
指标评级: ★★★★★
指标分类: 策略
画线方法: 副图
1、选股原理
股价处于上升趋势代表市场健康发展,DIF能够二次出现红柱放大,并且股价调整时间不长,macd金叉向上,说明上涨动力还在持续,再配合成交量的放大。
2、选股条件
(1)股价处于上涨趋势,底比底高。
(2)在股价上涨时DIF出现红柱放大,待股价回抽时DIF红柱逐渐缩短,股价在此上涨时,DIF红柱再次放大,此过程中没有DIF绿柱出现。
(3)DIF出现红柱时快速线慢速线必须形成金叉。
(4)随着低点位的出现最好配合成交量放大。3、注意事项
(1)在DIF二次出现红柱之前,最好不要出现绿柱,即使出现绿柱也不能有放大现象。
(2)MacD金叉的位置(DIF红柱二次放大)最好离0轴很近,或者在0轴之上出现,这种现象说明市场处于强势当中。
通达信接力黄金柱指标公式-macd启动选股 公式源码
DIFF:EMA(CLOSE,10)-EMA(CLOSE,22),NODRAW;
DEA:EMA(DIFF,7.5),NODRAW;
MACD:2*(DIFF-DEA),NODRAW;
DRAWBAND(DIFF,RGB(255,157,255),DEA,RGB(21,138,255));
STICKLINE(MACD>0,0,MACD,0.01,0),COLOR0000FF;
STICKLINE(MACD<0,0,MACD,0.01,0),COLORFFF000;
GMB:IF(CROSS(DIFF,DEA)ANDDIFF>0,-0.02,DRAWNULL),CROSSDOT,LINETHICK4,COLOR0000FF;
GMC:IF(CROSS(DIFF,DEA)ANDDIFF<0,-0.02,DRAWNULL),CROSSDOT,LINETHICK4,COLOR208FFF;
趋势:=(5)*(SMA(((CLOSE-LLV(LOW,27))/(HHV(HIGH,27)-LLV(LOW,27)))*(100),5,1))-(3)*(SMA(SMA(((CLOSE-LLV(LOW,27))/(HHV(HIGH,27)-LLV(LOW,27)))*(100),5,1),3,1))-SMA(SMA(SMA(((CLOSE-LLV(LOW,27))/(HHV(HIGH,27)-LLV(LOW,27)))*(100),5,1),3,1),2,1);
STICKLINE(趋势<=5,0,MACD,0.01,0),COLOR208FFF;
0,COLORFFFF00,LINETHICK1;
DRAWICON(CROSS(DIFF,DEA)ANDDIFF>0,DEA,36);
DRAWICON(CROSS(DIFF,DEA)ANDDIFF<0,DEA,37);
A1:=BARSLAST(REF(CROSS("MACD.DIF","MACD.DEA"),1));
B1:=REF(C,A1+1)>CANDREF("MACD.DIF",A1+1)<"MACD.DIF"ANDCROSS("MACD.DIF","MACD.DEA");
DRAWTEXT(FILTER(B1>0,5),0,'MACD'),COLORGREEN;
A2:=BARSLAST(REF(CROSS("KDJ.K","KDJ.D"),1));
B2:=REF(C,A2+1)>CANDREF("KDJ.K",A2+1)<"KDJ.K"ANDCROSS("KDJ.K","KDJ.D");
DRAWTEXT(FILTER(B2>0,5),MACD,'KDJ'),COLORYELLOW;
A3:=BARSLAST(REF(CROSS("RSI.RSI1","RSI.RSI2"),1));
B3:=REF(C,A3+1)>CANDREF("RSI.RSI1",A3+1)<"RSI.RSI1"ANDCROSS("RSI.RSI1","RSI.RSI2");
DRAWTEXT(FILTER(B3>0,5),MACD,'RSI'),COLORCYAN;
C1:=BARSLAST(REF(CROSS("MACD.DEA","MACD.DIF"),1));
D1:=REF(C,C1+1)<CANDREF("MACD.DIF",C1+1)>"MACD.DIF"ANDCROSS("MACD.DEA","MACD.DIF");
DRAWTEXT(FILTER(D1>0,5),MACD,'MACD'),COLORWHITE;
C2:=BARSLAST(REF(CROSS("KDJ.D","KDJ.K"),1));
D2:=REF(C,C2+1)<CANDREF("KDJ.K",C2+1)>"KDJ.K"ANDCROSS("KDJ.D","KDJ.K");
DRAWTEXT(FILTER(D2>0,5),MACD,'KDJ'),COLORWHITE;
C3:=BARSLAST(REF(CROSS("RSI.RSI2","RSI.RSI1"),1));
D3:=REF(C,C3+1)<CANDREF("RSI.RSI1",C3+1)>"RSI.RSI1"ANDCROSS("RSI.RSI2","RSI.RSI1");
DRAWTEXT(FILTER(D3>0,5),MACD,'RSI'),COLORMAGENTA;
价涨不破:=LLV(L,3)>=REF(L,3);
三日量缩:=HHV(vol,3)<REF(VOL,3);
高量柱:=C/REF(C,1)>=1.03ANDVOL=HHV(VOL,35);
倍量柱:=C/REF(C,1)>=1.03ANDVOL>=REF(VOL,1)*1.91;
梯量柱:=VOL>REF(VOL,1)ANDREF(VOL,1)>REF(VOL,2)ANDC/REF(C,1)>=1.03;
高黄金柱:=REF(高量柱,3)AND价涨不破AND三日量缩;
倍黄金柱:=REF(倍量柱,3)AND价涨不破AND三日量缩;
梯黄金柱:=REF(梯量柱,3)AND价涨不破AND三日量缩;
stICKLINE(高量柱,OPEN,CLOSE,2,0),COLORYELLOW;
STICKLINE(倍量柱,OPEN,CLOSE,2,0),COLORYELLOW;
STICKLINE(梯量柱,OPEN,CLOSE,2,0),COLORYELLOW;
STICKLINE(高黄金柱,LLV(L,3),LLV(L,3),25,1),COLORYELLOW;
STICKLINE(倍黄金柱,LLV(L,3),LLV(L,3),25,1),COLORYELLOW;
STICKLINE(梯黄金柱,LLV(L,3),LLV(L,3),25,1),COLORYELLOW;
DRAWTEXT(高量柱,L*0.99,'↖高')COLORWHITE;
DRAWTEXT(倍量柱,L*0.96,'↖倍')COLORWHITE;
DRAWTEXT(梯量柱,L*0.93,'↖梯')COLORWHITE;
DRAWTEXT(高黄金柱,L*0.99,'↖成立')COLORYELLOW;
DRAWTEXT(倍黄金柱,L*0.99,'↖成立')COLORYELLOW;
DRAWTEXT(梯黄金柱,L*0.99,'↖成立')COLORYELLOW;
MA1:=MA(C,5);MA2:=MA(C,10);
MA3:=MA(C,20);MA4:=MA(C,60);
MA5:=MA(C,120);MA6:=MA(C,250);
P:=26;S:=12;M:=9;
A:=EMA(CLOSE,S)-EMA(CLOSE,P);
B:=EMA(A,M);
D:=2*(A-B);
C>MA1ANDC>MA2ANDC>MA3ANDMA1>OANDH/C<1.015ANDMA3>OANDMA3>MA4ANDMA4>MA5ANDMA5>MA6ANDA>REF(A,1)ANDV>=HHV(V,10)ANDD<0ANDD>REF(D,1);
{买卖点}
VAR1:=(100-((90*(HHV(HIGH,21)-CLOSE))/(HHV(HIGH,21)-LLV(LOW,21))));
VAR2:=(100-((90*(HHV(HIGH,21)-CLOSE))/(HHV(HIGH,21)-LLV(LOW,21))));
VAR3:=(100-ma(((100*(HHV(HIGH,6)-CLOSE))/(HHV(HIGH,6)-LLV(LOW,6))),34));
DRAWICON(crOSS(VAR2,MA(VAR3,6)),(LOW*0.984),1);
DRAWICON(CROSS(MA(VAR3,6),VAR1),(HIGH*1.035),2);
{前期高低位}
BA1:=REF(C,10)=HHV(C,2*10+1);
B1:=FILTER(BA1,10);
C1:=BacKSET(B1,10+1);
HD:=FILTER(C1,10);
BA2:=REF(C,10)=LLV(C,2*10+1);
B2:=FILTER(BA2,10);
C2:=BACKSET(B2,10+1);
LD:=FILTER(C2,10);
前期高位:REF(H,BArslAST(HD)),COLOR00FF00,LINETHICK1,POINTDOT;
前期低位:REF(L,BARSLAST(LD)),COLORFF00FF,LINETHICK1,POINTDOT;
STICKLINE(C,前期高位,前期高位,1,0),COLOR00FF00;
STICKLINE(C,前期低位,前期低位,1,0),COLORFF00FF;
BL:=AMO>=REF(AMO,1)*2ANDC>REF(C,1);
STZF:=(((C-O)/O)*100)>=1.5;
STBL:=BLANDSTZF;
今日涨幅:=(C-O)/C*100;
涨幅2点:=今日涨幅>=0AND今日涨幅<=3.5;
十天倍量:=COUNT(STBL,7);
结果:STBLAND涨幅2点AND(十天倍量>=2);
真阴线:=C<REF(C,1)ANDC<=O;
假阳线:=C<REF(C,1)ANDC>=O;
阴线:=真阴线>0OR假阳线>0;
阴线天数:=BARSLAST(阴线);
阴线实体最高价:=MAX(REF(C,阴线天数),REF(O,阴线天数));
阴线成交量:=REF(V,阴线天数);
阳胜条件:=阴线天数>0ANDC>=阴线实体最高价ANDV>=阴线成交量;
阳胜:=IF(阳胜条件>0ANDREF(阳胜条件,1)=0,1,0);
黄金阳胜:=C>REF(C,1)ANDV>=REF(V*1.9,1)ANDV<=REF(V*3,1);
{黄金柱:按后3天收盘价不低于基柱收盘价,或平均价不低于基柱收盘价}
HJJ1:=C<REFX(C,3)ANDC<REFX(C,2)ANDC<REFX(C,1);
HJJ2:=C<REFX(MA(C,3),3);
黄金价:=HJJ1ORHJJ2;
{黄金柱:1,后3日平均量小于基柱的量,2,或者成交量连续3天一天比一天小(下台阶)并且后
3日平均量小于基柱的量}
HJL1:=V>REFX(MA(V,3),3);
HJL2:=REFX(V,1)>REFX(V,2)ANDREFX(V,2)>REFX(V,3)ANDV>REFX(MA(V,3),1);
黄金量:=HJL1ORHJL2;
{黄金柱的升幅:(3日平均价-基柱的收盘)/基柱的收盘价*100%>(3日平
均量-基柱成交量/基柱成交量*100%的1.01倍以上}
黄金升幅:=(MA(C,3)-REF(C,3))/REF(C,3)*100>=(MA(V,3)-REF(V,3))/REF(V,3)*100*1.01;
黄金柱:={黄金升幅AND}黄金量AND黄金价AND(阳胜OR黄金阳胜);
合力黄金柱:=黄金柱ANDCOUNT(黄金柱,4)>=2ANDCOUNT(黄金柱,20)<=2;
JLHJZ1:=黄金柱ANDCOUNT(合力黄金柱,4)=1ANDCOUNT(黄金柱,20)>=3;
JLHJZ2:=黄金柱ANDO>=REF(C,REF(BARSLAST(黄金柱),1)+1)ANDO<=REF(C*1.02,REF(BARSLAST(黄金柱),1)+1)ANDREF(BARSLAST(黄金柱),1)+1>=4ANDREF(BARSLAST(黄金柱),1)+1<=20;
接力黄金柱:=JLHJZ1ORJLHJZ2;
XG:接力黄金柱;
[源码注释]通达信公式动态翻译结果
ZT赋值:如果沪深品种类型=3或者沪深品种类型=4,返回收盘价=计算涨停价,否则返回收盘价=计算涨停价
输出XG:1日前的ZT并且ZT并且最低价>1日前的最高价
评论(0)