通达信公式源码概况:
指标类别:通达信公式
授权方式: 免费版
指标评级: ★★★★★
指标分类: 策略
画线方法: 副图
1、龙头股必须从涨停板开始,涨停板是多空双方最准确的攻击信号,不能涨停龙头股的个股,不可能做龙头。
2、龙头股必须是低价股,只有低价股才能得到股民追捧,一般不超过10元,因为高价股不具备炒作空间。
3、龙头股流通盘要适中,适合大资金运作和散户追涨杀跌,大市值股票和小盘股都不可能充当龙头。
4、龙头股必须同时满足日kdj,周kdJ,月KDJ同时低价金叉。
5、龙头股通常在大盘下跌末期端,市场恐慌时,逆市涨停,提前见底,或者先于大盘启动,并且经受大盘一轮下跌考验。浙江东日就是例证,它符合刚讲的龙头战法,一是从涨停开始,且筹码稳定,二是低价,三是流通市值较小,从底部起涨,炒到翻倍也不过10几个亿,也就是说不到2-3亿的私募资金或游资就可以炒作。四是该股日周月KDJ同时金叉,说明该股主力有备而来。五是该股在大盘恐慌末端,逆市涨停,此时大盘还在下跌,但并没有影响此股涨停。通过以上介绍可以看出龙头的起涨过程,也说明下跌并不可怕,可怕的是大盘下跌,没有龙头出现。
通达信紫色龙虎榜指标公式-龙头股 公式源码
涨幅偏离:=(((C-REF(C,1))/REF(C,1))-((INDEXC-REF(INDEXC,1))/REF(INDEXC,1)))*100>=0.07;{必须做收盘数据下载}
stICKLINE(涨幅偏离,C,(O+C)/2,2,0),COLORYELLOW;
跌幅偏离:=(((C-REF(C,1))/REF(C,1))-((INDEXC-REF(INDEXC,1))/REF(INDEXC,1)))<=-0.07;
STICKLINE(跌幅偏离,C,(O+C)/2,2,0),COLORGREEN;
振幅偏离:=(H-L)/L>=0.15;{振幅大于15个点}
STICKLINE(振幅偏离,O,C,1,0),COLORmaGENTA;
DRAWTEXT(振幅偏离,H*1.1,'振'),COLORMAGENTA;
换手偏离:=DYNAINFO(37)>=0.20;
STICKLINE(换手偏离,O,(O+C)/2,2,0),COLORWHITE;
三天涨幅:=(SUM((C-REF(C,1))/REF(C,1)*100,3))>=20;
STICKLINE(三天涨幅,C,(O+C)/2,2,0),COLORYELLOW;
DRAWTEXT(三天涨幅,L*0.98,'三连阳'),COLORYELLOW;
三天跌幅:=(SUM((C-REF(C,1))/REF(C,1)*100,3))<=-20;
STICKLINE(三天跌幅,C,(O+C)/2,2,0),COLORGREEN;
DRAWTEXT(三天跌幅,L*0.98,'三连阴'),COLORGREEN;
MX:=EMA(C,2);
MXA:=EMA(SLOPE(C,21)*20+C,42);
AA:=Abs((2*CLOSE+HIGH+LOW)/4-MA(CLOSE,30))/MA(CLOSE,30);
趋势线:DMA((2*CLOSE+LOW+HIGH)/4,AA),LINETHICK3,COLORRED;
CC:=(CLOSE/趋势线);
MA1:=MA(CC*(2*CLOSE+HIGH+LOW)/4,3);
MAAA:=((MA1-趋势线)/趋势线)/3;
TMP:=MA1-MAAA*MA1;
JJ:IF(TMP<=趋势线,趋势线,DRAWNULL),LINETHICK3,COLORGREEN;
XJ:IF(TMP<=趋势线,TMP,DRAWNULL),LINETHICK2,COLORBLUE;
建仓:crOSS(MX,MXA),NODRAW;
SEL:=CROSS(MXA,MX);
DRAWICON(建仓,L-0.8,9);
STICKLINE(建仓,O,C,2.5,0),COLORMAGENTA;
DRAWICON(SEL,H+0.1,2);
DRAWTEXT(建仓,L-0.68,'↖建仓持股'),COLORMAGENTA;
DRAWTEXT(SEL,H+0.38,'↙清仓持币'),COLORBLUE;
STICKLINE(MX>=MXA,LOW,HIGH,0.0,1),COLORRED;
STICKLINE(MX>=MXA,CLOSE,OPEN,3,1),COLORRED;
STICKLINE(MX<MXA,LOW,HIGH,0.0,1),COLORGREEN;
STICKLINE(MX<MXA,CLOSE,OPEN,3,1),COLORGREEN;
STICKLINE(建仓,OPEN,CLOSE,2,0),COLORYELLOW;
STICKLINE(SEL,OPEN,CLOSE,2,0),COLORBLUE;
CP:=MA(CLOSE,9),COLORCYAN,LINETHICK1;
JD:=MA(CLOSE,18),COLORMAGENTA;
DRAWICON(CROSS(CP,JD)ANDMX>=MXA,JD-0.1,1);
DRAWTEXT(CROSS(CP,JD)ANDMX>=MXA,JD-0.38,'↖加仓'),COLORYELLOW;
BL:=vol>=REF(V,1)*1.91ANDC>REF(C,1)*1.01;
DRAWTEXT(FILTER(BL,3),H+0.2,'↙倍量柱');
STICKLINE(FILTER(BL,3),OPEN,CLOSE,1.5,0);
XG:=SUMBARS(FILTER(BL,3),1);
STICKLINE(XG,REF(L,XG-1),REF(L,XG-1),10,0);
DIF:=EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:=EMA(DIF,9);
macd:=(DIF-DEA)*2;
AAAB:=(DIF-DEA)*2*60;
起爆:=CROSS(AAAB-REF(AAAB,1),15);
STICKLINE(起爆,O,C,2.5,0),COLORYELLOW;
DRAWTEXT(起爆,(O+H)/2,'↖起爆'),COLORCYAN,LINETHICK2;
MA5:=MA(C,5);
MA10:=MA(C,10);
MA21:=MA(C,21);
MA60:=MA(C,60);
操盘线:=MA(C,4);
安全线:=MA(C,19);
空:=EMA(CLOSE,5);
均衡:=EMA(空,0),COLORFFFFFF;
下趋势双线持币:=HHV(MA(HIGH,3),2);
上趋势单线持股:=LLV(MA(HIGH,3),1);
VAR5:=FILTER(均衡>REF(均衡,1)AND下趋势双线持币<REF(下趋势双线持币,1)ANDCLOSE>REF(CLOSE,1),11);
FF:=RANGE(C/MA21,0.97,1.15)ORRANGE(O/MA21,0.97,1.15);
金股:=VAR5ANDC>MA(C,21)ANDEVERY(MA21>REF(MA21,1),7)ANDFF;
IF(金股>=1,L*0.996,DRAWNULL);
DRAWTEXT(金股>=1,L*0.98,'↖回踩'),COLORMAGENTA;
Q1:=MA((L+H+C)/3,5);
压力:=HHV(Q1,60);
AHC1:=CLOSE*VOL;
AHC2:=EMA((expma(AHC1,3)/EXPMA(VOL,3)+EXPMA(AHC1,6)/EXPMA(VOL,6)+EXPMA(AHC1,12)/EXPMA(VOL,12)+EXPMA(AHC1,24)/EXPMA(VOL,24))/4,13);
上轨:=1.06*AHC2;
顶:=1.13*AHC2;
ZT:=REF(C,1)*1.1-C<0.01ANDH=C;
启爆:=CROSS(C,上轨)ANDZT;
DRAWTEXT(启爆,L*0.85,'启爆'),COLORYELLOW;
DRAWICON(启爆,L*0.90,24);
DRAWICON(启爆,L*0.92,25);
DRAWICON(启爆,L*0.94,26);
超牛:=CROSS(C,顶)ANDZT;
DRAWTEXT(超牛,L*0.98,'超牛'),COLORRED;
STICKLINE(超牛,O,C,2.5,0),COLORRED;
boll:=MA(C,20);
UPPER:=BOLL+2*STD(C,20);
LOWER:=BOLL-2*STD(C,20);
大黑马:=CROSS(C,UPPER)ANDC/REF(C,1)>1.05;
DRAWTEXT(大黑马,L-1.15,'大黑马'),COLORYELLOW;
敢死队:=大黑马ANDC>MA(C,60)ANDC>MA(C,90)ANDC>MA(C,120)ANDC>MA(C,250);
DRAWTEXT(大黑马ANDC>MA(C,60)ANDC>MA(C,90)ANDC>MA(C,120)ANDC>MA(C,250),H*1.03,'敢死队'),COLORYELLOW;
单阳:=C/REF(C,1)>=1.09;
不破价:=REF(C,BArslAST(单阳));
DRAWTEXT(单阳,H-H*0.02,'阳'),COLOR00FFFF;
LS0:=BARSLAST(单阳);
LS11:=IF(1,LS0=1,单阳);
LS21:=IF(1,LLV(L,1)>REF(L,1),1);
单阳不破:=LS11ANDLS21;
STICKLINE(单阳不破,不破价-不破价*0.002,不破价,4,0),COLORRED;
DRAWTEXT(单阳不破,不破价-不破价*0.02,'1'),COLORGREEN;
LS12:=IF(2,LS0=2,单阳);
LS22:=IF(2,LLV(L,2)>REF(L,2),1);
单阳不破2:=LS12ANDLS22;
STICKLINE(单阳不破2,不破价-不破价*0.002,不破价,4,0),COLORRED;
DRAWTEXT(单阳不破2,不破价-不破价*0.02,'2'),COLORGREEN;
LS13:=IF(3,LS0=3,单阳);
LS23:=IF(3,LLV(L,3)>REF(L,3),1);
单阳不破3:=LS13ANDLS23;
STICKLINE(单阳不破3,不破价-不破价*0.002,不破价,4,0),COLORRED;
DRAWTEXT(单阳不破3,不破价-不破价*0.02,'3'),COLORGREEN;
LS14:=IF(4,LS0=4,单阳);
LS24:=IF(4,LLV(L,4)>REF(L,4),1);
单阳不破4:=LS14ANDLS24;
STICKLINE(单阳不破4,不破价-不破价*0.002,不破价,4,0),COLORRED;
DRAWTEXT(单阳不破4,不破价-不破价*0.02,'4'),COLORGREEN;
LS15:=IF(5,LS0=5,单阳);
LS25:=IF(5,LLV(L,5)>REF(L,5),1);
单阳不破5:=LS15ANDLS25;
STICKLINE(单阳不破5,不破价-不破价*0.002,不破价,4,0),COLORRED;
DRAWTEXT(单阳不破5,不破价-不破价*0.02,'5'),COLORGREEN;
LS16:=IF(6,LS0=6,单阳);
LS26:=IF(6,LLV(L,6)>REF(L,6),1);
单阳不破6:=LS16ANDLS26;
STICKLINE(单阳不破6,不破价-不破价*0.002,不破价,4,0),COLORRED;
DRAWTEXT(单阳不破6,不破价-不破价*0.02,'6'),COLORGREEN;
LS17:=IF(7,LS0=7,单阳);
LS27:=IF(7,LLV(L,7)>REF(L,7),1);
单阳不破7:=LS17ANDLS27;
STICKLINE(单阳不破7,不破价-不破价*0.002,不破价,4,0),COLORRED;
DRAWTEXT(单阳不破7,不破价-不破价*0.02,'7'),COLORGREEN;
LS18:=IF(8,LS0=8,单阳);
LS28:=IF(8,LLV(L,8)>REF(L,8),1);
单阳不破8:=LS18ANDLS28;
STICKLINE(单阳不破8,不破价-不破价*0.002,不破价,4,0),COLORRED;
DRAWTEXT(单阳不破8,不破价-不破价*0.02,'8'),COLORGREEN;
LS19:=IF(9,LS0=9,单阳);
LS29:=IF(9,LLV(L,9)>REF(L,9),1);
单阳不破9:=LS19ANDLS29;
STICKLINE(单阳不破9,不破价-不破价*0.002,不破价,4,0),COLORRED;
DRAWTEXT(单阳不破9,不破价-不破价*0.02,'9'),COLORGREEN;
LS110:=IF(10,LS0=10,单阳);
LS210:=IF(10,LLV(L,10)>REF(L,10),1);
单阳不破10:=LS110ANDLS210;
STICKLINE(单阳不破10,不破价-不破价*0.002,不破价,4,0),COLORRED;
DRAWTEXT(单阳不破10,不破价-不破价*0.02,'10'),COLORGREEN;
C2:=REF(C,1),NODRAW;
涨停1:=REF(C,11)*1.1-C<0.01ANDH=C,NODRAW;
STICKLINE(涨停1,OPEN,CLOSE,1,0),COLORRED;
STICKLINE(涨停1,H,L,0,0),COLORRED;
跌停:=IF((C2-C)*100/C2>=(10-0.01*100/C2)ANDL=C,1,0),NODRAW;
STICKLINE(跌停,OPEN,CLOSE,1,0),COLORGREEN;
STICKLINE(跌停,H,L,0,1),COLORGREEN;
活筹:=(100*WINNER(REF(CLOSE,1)*1.1)-100*WINNER(REF(CLOSE,1)*0.9));M活筹:=SMA(SMA(活筹,3,1),3,1),COLORWHITE;死筹:=100*WINNER(CLOSE),COLORGREEN;M死筹:=SMA(SMA(死筹,3,1),3,1);主力筹码:=100*WINNER(CLOSE*0.9),COLORCYAN;M主力筹码:=SMA(主力筹码,3,1);穿透筹码:=(100*WINNER(CLOSE)-100*WINNER(REF(CLOSE,1)*1)),COLORF00FF0;VAR1:=1;VAR2:=1/WINNER(CLOSE);VAR3:=MA(CLOSE,13);VAR4:=100-ABS((CLOSE-VAR3)/VAR3*100);VAR5:=LLV(LOW,75);VAR6:=HHV(HIGH,75);VAR7:=(VAR6-VAR5)/100;VAR8:=SMA((CLOSE-VAR5)/VAR7,20,1);VARA:=3*VAR8-2*SMA(VAR8,15,1);散户线:=(100-VARA)*VAR1,COLORWHITE,LINETHICK2;主力线:=MA(WINNER(CLOSE*0.95)*100,3)*VAR1,COLORFF00FF,LINETHICK2;新庄:=(100-IF(VAR2>5,IF(VAR2<100,VAR2,VAR4-10),0))*VAR1,COLORGREEN,LINETHICK1,POINTDOT;VARD:=散户线>VAR4;0,COLORBLUE,LINETHICK2;25;-50;STICKLINE(主力线>散户线,0,主力线-散户线,0,0),COLORYELLOW;STICKLINE(主力线>散户线AND主力线>50,50-散户线,主力线-散户线,0,0),COLORRED;STICKLINE(主力线<散户线,0,主力线-散户线,0,0),COLORWHITE;STICKLINE(主力线<散户线AND主力线-散户线<-50,-50,主力线-散户线,0,0),COLORGREEN;STICKLINE(VARD,-75,主力线-散户线,1,0),COLORFF00FF;庄散搏杀选股:IF(VARDAND主力线-散户线<-75,1,0);
A:=SIGNALS_USER(300,0),NODRAW;{上榜总金额}
B:=SIGNALS_USER(299,0),NODRAW;{净流入}
D:=(A+B)/2,NODRAW;{总买入}
E:=A-D,NODRAW;{总卖出};
F:=AMO/10000,NODRAW;{当日成交金额万元}
J:=A/F*100,NODRAW;{上榜资金与成交金额占比}
换手:=vol*10000/FINANCE(7),NODRAW,COLORGREEN;
次数:=COUNT(A>0,30),NODRAW;
月收益:(HHV(H,30)-LLV(L,30))/LLV(L,30)*100,NODRAW;
年收益:(HHV(H,250)-LLV(L,250))/LLV(L,250)*100,NODRAW;
月离高:BArslAst(HHV(H,30)>C),NODRAW;
月离底:BARSLAST(LLV(L,30)<C),NODRAW;
RC1:=REF(C,1);
ZT:=C/REF(C,1)>1.099ANDH>L;
CS:=IF(C>=1,10000,100000);
C涨停10:=1.10*RC1-49/CS;{考虑到4舍5入}
C涨停5:=1.05*RC1-49/CS;
C跌停10:=0.90*RC1+51/CS;
C跌停5:=0.95*RC1+51/CS;
ST:=NAMELIKE('S')ORNAMELIKE('*S');
涨停:=IF(ST,C>=C涨停5,C>=C涨停10);
跌停:=IF(ST,C<=C跌停5,C<=C跌停10);
盘中涨停:=IF(ST,H>=C涨停5,H>=C涨停10);
盘中跌停:=IF(ST,L<=C跌停5,L<=C跌停10);
次数Z:=COUNT(C/REF(C,1)>=1.097OR涨停,30),NODRAW;
次数N:=COUNT(C/REF(C,1)>=1.097OR涨停,250),NODRAW;
STICKLINE(H/REF(C,1)>=1.097ANDH>C,1,10,0.1,-1),COLORWHITE;
STICKLINE(C/REF(C,1)>=1.097,1,10,0.1,0),COLORRED;{价异动换手异动}
STICKLINE(B>0,1,10,0.1,0),COLORRED;
STICKLINE(B<0,1,10,0.1,0),COLORGREEN;
{A}
DRAWTEXT(A>=10000,10*0.6,VARCAT(VARCAT('上榜总:',VAR2STR(A,0)),'万')),COLORYELLOW;
DRAWTEXT(A<10000,10*0.6,VARCAT(VARCAT('上榜总:',VAR2STR(A,0)),'万')),COLORmaGENTA;
DRAWTEXT(D>0,10*0.45,VARCAT(VARCAT('总买入:',VAR2STR(D,0)),'万')),COLORMAGENTA;
DRAWTEXT(D<0,10*0.45,VARCAT(VARCAT('总买入:',VAR2STR(D,0)),'万')),COLORGREEN;
DRAWTEXT(E>0,10*0.3,VARCAT(VARCAT('总卖出:',VAR2STR(E,0)),'万')),COLORMAGENTA;
DRAWTEXT(E<0,10*0.3,VARCAT(VARCAT('总卖出:',VAR2STR(E,0)),'万')),COLORGREEN;
DRAWTEXT(B>0,1.5,VARCAT(VARCAT('净流入:',VAR2STR(B,0)),'万')),COLORMAGENTA;
DRAWTEXT(B>=1000,1.5,VARCAT(VARCAT('净流入:',VAR2STR(B,0)),'万')),COLORYELLOW;
DRAWTEXT(B<0,1.5,VARCAT(VARCAT('净流入:',VAR2STR(B,0)),'万')),COLORGREEN;
DRAWTEXT(B<=-1000,1.5,VARCAT(VARCAT('净流入:',VAR2STR(B,0)),'万')),COLORBLUE;
DRAWTEXT(J>0,9,VARCAT(VARCAT('占比:',VAR2STR(J,0)),'%')),COLORMAGENTA;
DRAWTEXT(换手<=20ANDA>0,7.5,VARCAT(VARCAT('换手:',VAR2STR(换手,0)),'%')),COLORYELLOW;
DRAWTEXT(换手>20AND换手<50ANDA>0,7.5,VARCAT(VARCAT('换手:',VAR2STR(换手,0)),'%')),COLORMAGENTA;
DRAWTEXT(换手>=50ANDA>0,7.5,VARCAT(VARCAT('换手:',VAR2STR(换手,0)),'%')),COLORRED;
DRAWTEXT(H/REF(C,1)>=1.097ANDH>C,6,'炸板操作'),COLORMAGENTA;
DRAWTEXT_FIX(1,0.915,0,0,'月上榜:'),COLORYELLOW;
DRAWNUMBER_FIX(1,0.96,0,0,CONST(次数)),COLORYELLOW;
DRAWTEXT_FIX(1,0.98,0,0,'次'),COLORYELLOW;
DRAWTEXT_FIX(1,0.915,0.2,0,'月涨停:'),COLORYELLOW;
DRAWNUMBER_FIX(1,0.96,0.2,0,CONST(次数Z)),COLORYELLOW;
DRAWTEXT_FIX(1,0.98,0.2,0,'次'),COLORYELLOW;
DRAWTEXT_FIX(1,0.915,0.4,0,'年涨停:'),COLORYELLOW;
DRAWNUMBER_FIX(1,0.96,0.4,0,CONST(次数N)),COLORYELLOW;
DRAWTEXT_FIX(1,0.98,0.4,0,'次'),COLORYELLOW;
{价异动换手异动}
DRAWTEXT(换手<=20ANDC/REF(C,1)>=1.097OR盘中涨停,7.5,VARCAT(VARCAT('换手:',VAR2STR(换手,0)),'%')),COLORYELLOW;
DRAWTEXT(换手>20ANDC/REF(C,1)>=1.097OR盘中涨停,7.5,VARCAT(VARCAT('换手:',VAR2STR(换手,0)),'%')),COLORMAGENTA;
DRAWTEXT(换手>=50ANDC/REF(C,1)>=1.097OR盘中涨停,7.5,VARCAT(VARCAT('换手:',VAR2STR(换手,0)),'%')),COLORRED;
{收益}
QSXS:=MA(CLOSE,8)>REF(MA(CLOSE,8),1)ANDMA(CLOSE,13)>REF(MA(CLOSE,13),1)ANDMA(CLOSE,20)>REF(MA(CLOSE,20),1);
DXJC:=CROSS(CLOSE,MA(C,30))ANDCLOSE>MA(C,22)ANDCLOSE/OPEN>1.015;
HSL:=VOL/CAPITAL*100;
选股:QSXSANDDXJCANDHSL>2;
DRAWTEXT_FIX(1,0.915,0.6,0,'月收益:±'),COLORYELLOW;
DRAWNUMBER_FIX(1,0.96,0.6,0,CONST(月收益)),COLORRED;
DRAWTEXT_FIX(1,0.98,0.6,0,'%'),COLORYELLOW;
DRAWTEXT_FIX(1,0.915,0.8,0,'年收益:±'),COLORYELLOW;
DRAWNUMBER_FIX(1,0.96,0.8,0,CONST(年收益)),COLORRED;
DRAWTEXT_FIX(1,0.98,0.8,0,'%'),COLORYELLOW;
[源码注释]通达信公式动态翻译结果
DIF赋值:收盘价的12日指数移动平均-收盘价的26日指数移动平均
DEA赋值:DIF的9日指数移动平均
MACD赋值:(DIF-DEA)*2
输出XG:最近5日一直存在MACD>0 AND 2日前的最近3日MACD连涨 AND 1日前的MACD<2日前的MACDAND MACD>1日前的MACD
评论(0)