当前位置: 网站首页 > 股票软件公式 > 通达信公式 > 文章 当前位置: 通达信公式 > 文章

通达信源码:缠论新笔 缠论顶底,发现龙头,价值选股副图

点击: 次    来源:顶尖财经    作者:股市狙击 - 小 + 大

1、缠论新笔 缠论顶底,通达信主图和副图公式无未来函数有测试图

公式的使用方法解释:
1.红色箭头出现后,分批买入,先轻仓介入。等放阳量或均线拐头向上在加仓。( 顶尖财经 股票学院: http://58188.com )
2绿色箭头出现果断卖出,哪怕后期涨停也不用后悔,因为我赚我认知的利润,切记勿贪。


{缠论顶底}
H1:=MAX(DYNAINFO(3),DYNAINFO(5));
L1:=MIN(DYNAINFO(3),DYNAINFO(6));
P1:=H1-L1;
阻力:=L1+P1*7/8,COLORGREEN;
支撑:=L1+P1*0.5/8,COLORRED;
中线:=(支撑+阻力)/2,COLORWHITE,POINTDOT;
V11:=3*SMA((C-LLV(L,55))/(HHV(H,55)-LLV(L,55))*100,5,1)-2*SMA(SMA((C-LLV(L,55))/(HHV(H,55)-LLV(L,55))*100,5,1),3,1);
趋势线:EMA(V11,3),LINETHICK1,COLORYELLOW;
V12:=(趋势线-REF(趋势线,1))/REF(趋势线,1)*100;
准备买入:STICKLINE(趋势线<11,趋势线,11,5,0),COLORRED;
AA:=(趋势线<11) AND FILTER((趋势线<=11),15) AND C<中线;
BB0:=REF(趋势线,1)<11 AND CROSS(趋势线,11) AND C<中线;
BB1:=REF(趋势线,1)<11 AND REF(趋势线,1)>6 AND CROSS(趋势线,11);
BB2:=REF(趋势线,1)<6 AND REF(趋势线,1)>3 AND CROSS(趋势线,6);
BB3:=REF(趋势线,1)<3 AND REF(趋势线,1)>1 AND CROSS(趋势线,3);
BB4:=REF(趋势线,1)<1 AND REF(趋势线,1)>0 AND CROSS(趋势线,1);
BB5:=REF(趋势线,1)<0 AND CROSS(趋势线,0);
BB:=BB1=1 OR BB2=1 OR BB3=1 OR BB4=1 OR BB5=1;
下单买入:STICKLINE(BB=1 AND C<中线,11,52,1,0),COLORRED;
DRAWICON(BB=1 AND C<中线,55,1);
DRAWTEXT(BB0,60,'★抄底'),COLORRED;
DRAWTEXT(AA,16,'超卖见底'),,COLORWHITE;
准备卖出:STICKLINE(趋势线>89,趋势线,89,5,0),COLORGREEN;
CC:=(趋势线>89) AND FILTER((趋势线>89),15) AND C>中线;
DD0:=REF(趋势线,1)>89 AND CROSS(89,趋势线) AND C>中线;
DD1:=REF(趋势线,1)>89 AND REF(趋势线,1)<94 AND CROSS(89,趋势线);
DD2:=REF(趋势线,1)>94 AND REF(趋势线,1)<97 AND CROSS(94,趋势线);
DD3:=REF(趋势线,1)>97 AND REF(趋势线,1)>99 AND CROSS(97,趋势线);
DD4:=REF(趋势线,1)>99 AND REF(趋势线,1)<100 AND CROSS(99,趋势线);
DD5:=REF(趋势线,1)>100 AND CROSS(100,趋势线);
DD:=DD1=1 OR DD2=1 OR DD3=1 OR DD4=1 OR DD5=1;
下单卖出:STICKLINE(DD=1 AND C>中线,89,49,1,0),COLORGREEN;
DRAWICON(DD=1 AND C>中线,55,2);
DRAWTEXT(DD0,40,'★逃顶'),COLORGREEN;
DRAWTEXT (CC,84,'超买见顶'),,COLORWHITE;
顶:89,COLORGREEN;
底:11,COLORRED;
中:50,POINTDOT,COLORWHITE;
DRAWTEXT(ISLASTBAR,顶,'顶'),COLORGREEN;
DRAWTEXT(ISLASTBAR,底,'底'),COLORRED;
DRAWTEXT(ISLASTBAR,中,'中'),COLORWHITE;
 

{缠论新笔}
老笔:=1;
G:=MA(C,5);
D:=MA(C,10);
HH:=REF(H,5)=HHV(H,11);
LL:=REF(L,5)=LLV(L,11);
FG01:=BACKSET(HH,6)>BACKSET(HH,5) ;
FD01:=BACKSET(LL,6)>BACKSET(LL,5) ;
FG02:=IF(BARSLAST(FG01)=BARSLAST(FD01) AND G>D,FG01,
IF(BARSLAST(FD01)>BARSLAST(FG01),FG01,0));
FD02:=IF(BARSLAST(FG01)=BARSLAST(FD01) AND D>G,FD01,
IF(BARSLAST(FG01)>BARSLAST(FD01),FD01,0));
FG0:=FG02 AND H=HHV(H,BARSLAST(FD02));
FD0:=FD02 AND L=LLV(L,BARSLAST(FG02));
GP:IF(FG0,H,DRAWNULL),CIRCLEDOT,COLORCYAN;
DP:IF(FD0,L,DRAWNULL),CIRCLEDOT,COLORCYAN;
GQ:=L>REF(H,1) AND DAY!=REF(DAY,1);
DQ:=H<REF(L,1) AND DAY!=REF(DAY,1);
GQL:=REF(L,BARSLAST(GQ));
DQH:=REF(H,BARSLAST(DQ));
FGH:=REF(H,BARSLAST(FG0));
FGL:=REF(L,BARSLAST(FG0));
FGH1:=REF(H,BARSLAST(FG0)+1);
FGL1:=REF(L,BARSLAST(FG0)+1);
FGH2:=REF(H,BARSLAST(FG0)+2);
FGL2:=REF(L,BARSLAST(FG0)+2);
FDH:=REF(H,BARSLAST(FD0));
FDL:=REF(L,BARSLAST(FD0));
FDH1:=REF(H,BARSLAST(FD0)+1);
FDL1:=REF(L,BARSLAST(FD0)+1);
FDH2:=REF(H,BARSLAST(FD0)+2);
FDL2:=REF(L,BARSLAST(FD0)+2);
FGZH:=IF(FGL<=FGL1,FGH2,FGH1);
FGZL:=IF(FGH1<FGL,FGL,IF(FGL<=FGL1,FGL2,FGL1));
FDZH:=IF(FDL1>FDH,FDH,IF(FDH>=FDH1,FDH2,FDH1));
FDZL:=IF(FDH>=FDH1,FDL2,FDL1);
FG1:=FGH>FDZH AND FG0;
FD1:=FDL<FGZL AND FD0;
FG:=FG1 AND FGH>FDH AND FGL>FDL AND FGL1>FDL;
FD:=FD1 AND FDL<FGL AND FDH<FGH AND FDH1<FGH;
BH0:=(H<=REF(H,1) AND L>=REF(L,1)) OR (H>=REF(H,1) AND L<=REF(L,1));
BHG:=COUNT(BH0,BARSLAST(FD0));
BHD:=COUNT(BH0,BARSLAST(FG0));
BGQ:=COUNT(GQ,BARSLAST(FD0));
BDQ:=COUNT(DQ,BARSLAST(FG0));
BK0:=IF(BHG>0,BHG+2+老笔,IF(BHD,BHD+2+老笔,3));
BK:=IF(BGQ,BK0-BGQ,IF(BDQ,BK0-BDQ,BK0));
G1X:=(FG AND BARSLAST(FD)>BK);
D1X:=(FD AND BARSLAST(FG)>BK);
G1:=(FG0 AND REF(H,BARSLAST(FG0))>=REF(H,BARSLAST(G1X)) AND BARSLAST(D1X)>BARSLAST(G1X))
OR (FG1 AND COUNT(GQ,BARSLAST(FD1))>0 AND REF(H,BARSLAST(FG1))>REF(H,BARSLAST(G1X)));
D1:=(FD0 AND REF(L,BARSLAST(FD0))<=REF(L,BARSLAST(D1X)) AND BARSLAST(G1X)>BARSLAST(D1X))
OR (FD1 AND COUNT(DQ,BARSLAST(FG1))>0 AND REF(L,BARSLAST(FD1))<REF(H,BARSLAST(D1X)));
G1H:=IF(BARSLAST(D1)>BARSLAST(G1),REF(H,BARSLAST(G1)),REF(H,BARSLAST(D1))),;
D1L:=IF(BARSLAST(G1)>BARSLAST(D1),REF(L,BARSLAST(D1)),REF(L,BARSLAST(G1)));
G2:=G1 AND H=HHV(G1H,BARSLAST(D1)+1) AND H>REF(H,1) AND BARSLAST(D1)>BARSLAST(G1);
D2:=D1 AND L=LLV(D1L,BARSLAST(G1)+1) AND L<REF(L,1) AND BARSLAST(G1)>BARSLAST(D1);
G3:=G2 OR (FG0 AND REF(H,BARSLAST(FG0))>REF(H,BARSLAST(G2)) AND BARSLAST(D2)>BARSLAST(G2));
D3:=D2 OR (FD0 AND REF(L,BARSLAST(FD0))<REF(L,BARSLAST(D2)) AND BARSLAST(G2)>BARSLAST(D2));
GPB:IF(G1X,H,DRAWNULL),CIRCLEDOT,COLORYELLOW;
DPB:IF(D1X,L,DRAWNULL),CIRCLEDOT,COLORYELLOW;
{画线}
NN:=G3;UU:=D3;
L1:DRAWLINE(UU,L,NN, H,0),COLORRED;L2:DRAWLINE(NN,H,UU, L,0),COLORYELLOW;
{标示端点数值}
{DRAWNUMBER(L1 AND L2 AND NN ,H,H),COLORLIRED;DRAWNUMBER(L1 AND L2 AND UU ,L,L),COLORLIMAGENTA;};
行业:=STRCAT('所属行业板块: ',HYBLOCK);
概念:=STRCAT(', 所属概念板块: ',GNBLOCK);
地域:=STRCAT(', 所属地域板块: ',DYBLOCK);
指数:=STRCAT(', 所属指数板块: ',ZSBLOCK);
字幕1:=STRCAT(行业,概念);
字幕2:=STRCAT(地域,指数);
字幕:=STRCAT(字幕1,字幕2);
DRAWTEXT_FIX(ISLASTBAR,0,0,0,字幕);{概念};



2、发现龙头

发现龙头,提供主图 副图 选股

《发现龙头》在大趋势H1(白线) H2(黄线)即将金叉或刚刚金叉时触发信号,每月出票不多,但龙头票常常会出选出。用到的《大趋势主图》本身就是一款非常不错的主图指标,来源于网络。
 
触发信号后满足下面几个条件为最佳!
 
1.非波段高位、即将或者刚刚突破60日均线。
 
2.沿大趋势H1(白线)上行或回调不跌破H1。
 
3.H1、H2开口逐步放大为最佳!
 
注意:有很多失败信号,建议结合均线、MACD、板块热点以及个人其他指标等手段综合把握。

{发现龙头主图}
大趋势H1:EMA(CLOSE,8),COLORWHITE;
H2:EMA(大趋势H1,18),COLORYELLOW;
H3:EMA(CLOSE,108),COLORGREEN;
STICKLINE(大趋势H1>H2,大趋势H1,H2,1,1),COLORRED;
A:=(3*CLOSE+LOW+OPEN+HIGH)/6;
D1:=(20*A+19*REF(A,1)+18*REF(A,2)+17*REF(A,3)+16*REF(A,4)+15*REF(A,5)+14*REF(A,6)
+13*REF(A,7)+12*REF(A,8)+11*REF(A,9)+10*REF(A,10)+9*REF(A,11)+8*REF(A,12)
+7*REF(A,13)+6*REF(A,14)+5*REF(A,15)+4*REF(A,16)+3*REF(A,17)+2*REF(A,18)+
REF(A,20))/211;
D2:=EMA(D1,2);
D3:=EMA(D2,2);
FK1:=EMA(D3,2);
买入:=CROSS(D1,FK1);
散户:=100*(HHV(HIGH,55)-CLOSE)/(HHV(HIGH,55)-LLV(LOW,55)); 
RSV:=(CLOSE-LLV(LOW,34))/(HHV(HIGH,34)-LLV(LOW,34))*100; 
K:=SMA(RSV,3,1); 
D:=SMA(K,3,1); 
J:=3*K-2*D; 
主力:=EMA(J,6);
金叉:=CROSS(主力,散户);
VAR1:=MA(C,5)>REF(MA(C,5),1) AND REF(C>O OR C<O,5) ; 
VAR2:=REF(MA(C,5)<REF(MA(C,5),1),1) AND REF(C>O OR C<O,5) AND REF(C>O OR C<O,7); 
VAR3:=C>O AND REF(C>O,1) AND REF(C<O,2) AND REF(O/C>1.02,2);
VAR4:=VAR1 AND VAR2 AND VAR3;
VAR5:=COUNT(VAR4,2)>0;
发现龙头:=金叉 AND VAR5 AND 买入 ;
DRAWTEXT(发现龙头,LOW*0.97,'▲发现龙头'),COLORCYAN;
STICKLINE(发现龙头,H,L,1,0),LINETHICK2,COLORWHITE;
STICKLINE(发现龙头,O,C,3,1),LINETHICK2,COLORWHITE;

{发现龙头副图}
A:=(3*CLOSE+LOW+OPEN+HIGH)/6;
D1:=(20*A+19*REF(A,1)+18*REF(A,2)+17*REF(A,3)+16*REF(A,4)+15*REF(A,5)+14*REF(A,6)
+13*REF(A,7)+12*REF(A,8)+11*REF(A,9)+10*REF(A,10)+9*REF(A,11)+8*REF(A,12)
+7*REF(A,13)+6*REF(A,14)+5*REF(A,15)+4*REF(A,16)+3*REF(A,17)+2*REF(A,18)+
REF(A,20))/211;
D2:=EMA(D1,2);
D3:=EMA(D2,2);
FK1:=EMA(D3,2);
买入:=CROSS(D1,FK1);
散户:=100*(HHV(HIGH,55)-CLOSE)/(HHV(HIGH,55)-LLV(LOW,55)); 
RSV:=(CLOSE-LLV(LOW,34))/(HHV(HIGH,34)-LLV(LOW,34))*100; 
K:=SMA(RSV,3,1); 
D:=SMA(K,3,1); 
J:=3*K-2*D; 
主力:=EMA(J,6);
金叉:=CROSS(主力,散户);
 
VAR1:=MA(C,5)>REF(MA(C,5),1) AND REF(C>O OR C<O,5) ; 
VAR2:=REF(MA(C,5)<REF(MA(C,5),1),1) AND REF(C>O OR C<O,5) AND REF(C>O OR C<O,7); 
VAR3:=C>O AND REF(C>O,1) AND REF(C<O,2) AND REF(O/C>1.02,2);
VAR4:=VAR1 AND VAR2 AND VAR3;
VAR5:=COUNT(VAR4,2)>0;
发现龙头:金叉 AND VAR5 AND 买入,COLORCYAN ;

{发现龙头选股}
A:=(3*CLOSE+LOW+OPEN+HIGH)/6;
D1:=(20*A+19*REF(A,1)+18*REF(A,2)+17*REF(A,3)+16*REF(A,4)+15*REF(A,5)+14*REF(A,6)
+13*REF(A,7)+12*REF(A,8)+11*REF(A,9)+10*REF(A,10)+9*REF(A,11)+8*REF(A,12)
+7*REF(A,13)+6*REF(A,14)+5*REF(A,15)+4*REF(A,16)+3*REF(A,17)+2*REF(A,18)+
REF(A,20))/211;
D2:=EMA(D1,2);
D3:=EMA(D2,2);
FK1:=EMA(D3,2);
买入:=CROSS(D1,FK1);
散户:=100*(HHV(HIGH,55)-CLOSE)/(HHV(HIGH,55)-LLV(LOW,55)); 
RSV:=(CLOSE-LLV(LOW,34))/(HHV(HIGH,34)-LLV(LOW,34))*100; 
K:=SMA(RSV,3,1); 
D:=SMA(K,3,1); 
J:=3*K-2*D; 
主力:=EMA(J,6);
金叉:=CROSS(主力,散户);
VAR1:=MA(C,5)>REF(MA(C,5),1) AND REF(C>O OR C<O,5) ; 
VAR2:=REF(MA(C,5)<REF(MA(C,5),1),1) AND REF(C>O OR C<O,5) AND REF(C>O OR C<O,7); 
VAR3:=C>O AND REF(C>O,1) AND REF(C<O,2) AND REF(O/C>1.02,2);
VAR4:=VAR1 AND VAR2 AND VAR3;
VAR5:=COUNT(VAR4,2)>0;
发现龙头:金叉 AND VAR5 AND 买入 ;




3、价值选股副图

{价值选股副图}

 
{公式名称:熟年网采价值}
{显示小数固定2位}
 
{画个大框}
DRAWRECTREL(0,0,999,980,0);
{画第一、二个表格}
DRAWRECTREL(50,1,250,200,0);
DRAWRECTREL(50,1,250,980,0);
DRAWRECTREL(50,1,90,980,0);
DRAWRECTREL(0,1,450,980,0);
{画第三个格}
DRAWRECTREL(0,1,500,980,0);
DRAWRECTREL(0,1,700,980,0);
 
DRAWTEXT_FIX(1,0.015,0.2,0,'成'),COLORRED;
DRAWTEXT_FIX(1,0.015,0.4,0,'长'),COLORRED;
DRAWTEXT_FIX(1,0.015,0.6,0,'性'),COLORRED;
 
 
DRAWTEXT_FIX(1,0.465,0.15,0,'财'),COLORRED;
DRAWTEXT_FIX(1,0.465,0.35,0,'务'),COLORRED;
DRAWTEXT_FIX(1,0.465,0.55,0,'风'),COLORRED;
DRAWTEXT_FIX(1,0.465,0.75,0,'险'),COLORRED;
 
 
{营收}
YS20181231:=FINONE(74,2018,1231)/100000000;
YS20171231:=FINONE(74,2017,1231)/100000000;
YS20161231:=FINONE(74,2016,1231)/100000000;
YS20151231:=FINONE(74,2015,1231)/100000000;
 
DRAWTEXT_FIX(1,0.05+0,0.05,0,'年度'),COLOR00FF80;
DRAWTEXT_FIX(1,0.05+0,0.25,0,'2018'),COLOR00FF80;
DRAWTEXT_FIX(1,0.05+0,0.42,0,'2017'),COLOR00FF80;
DRAWTEXT_FIX(1,0.05+0,0.59,0,'2016'),COLOR00FF80;
DRAWTEXT_FIX(1,0.05+0,0.76,0,'2015'),COLOR00FF80;
 
DRAWTEXT_FIX(1,0.05+0.05,0.05,0,'营收(亿元):'),COLORWHITE;
DRAWNUMBER_FIX(1,0.05+0.09,0.25,1,YS20181231),COLORWHITE;
DRAWNUMBER_FIX(1,0.05+0.09,0.42,1,YS20171231),COLORWHITE;
DRAWNUMBER_FIX(1,0.05+0.09,0.59,1,YS20161231),COLORWHITE;
DRAWNUMBER_FIX(1,0.05+0.09,0.76,1,YS20151231),COLORWHITE;
{毛利率}
DRAWTEXT_FIX(1,0.05+0.14,0.05,0,'毛利率%:'),COLORYELLOW;
DRAWNUMBER_FIX(1,0.05+0.145,0.25,0,FINONE(202,2018,1231)),COLORYELLOW;
DRAWNUMBER_FIX(1,0.05+0.145,0.42,0,FINONE(202,2017,1231)),COLORYELLOW;
DRAWNUMBER_FIX(1,0.05+0.145,0.59,0,FINONE(202,2016,1231)),COLORYELLOW;
DRAWNUMBER_FIX(1,0.05+0.145,0.76,0,FINONE(202,2015,1231)),COLORYELLOW;
 
净资产收益率:=FINANCE(30)/FINANCE(19),NODRAW;
DRAWTEXT_FIX(1,-0.04+0.3,0.4,0,'净资产收益率:'),COLORFF00FF;
DRAWNUMBER_FIX(1,-0.04+0.47,0.4,1,净资产收益率),COLORYELLOW;
 
利润TTM:=FINVALUE(276);
市盈率TTM:IF(FINVALUE(238)*100*REF(C,1)/利润TTM>=0,FINVALUE(238)*100*REF(C,1)/利润TTM/100,0),NODRAW;
DRAWTEXT_FIX(1,-0.04+0.3,0.6,0,'今日市盈率TTM:'),COLORFF00FF;
DRAWNUMBER_FIX(1,-0.04+0.47,0.6,1,CONST(市盈率TTM)),COLORYELLOW;
今日市盈率:=CONST(市盈率TTM),NODRAW;
 
负债率:=FINANCE(9),NODRAW;
总现金流亿:=FINANCE(26)/100000000,NODRAW;
经营现金流亿:=FINANCE(25)/100000000,NODRAW;
现金流通市值比:=FINANCE(26)/FINANCE(40)*100,NODRAW;{现金流占流通市值的比率};
每股经营现金流:=FINANCE(25)/FINANCE(1),NODRAW;
 
商誉数值:=FINVALUE(35)/100000000;{亿}
净资产:=FINANCE(19)/100000000,NODRAW;{亿}
商誉雷区:商誉数值/净资产*100,COLORWHITE,NODRAW;{大于30为高风险,低于30为低风险}
 
AD1:=FINANCE(42);
AD2:=DATETODAY(CONST(DATE));
AD3:=AD2-AD1;
XDATE:=DAYTODATE(AD3)+19000000;
上市日期:=STRCAT('',CON2STR(XDATE,0));
 
DRAWTEXT_FIX(1,0.52,0.15,0,'负债率%:'),COLORFF00FF;
DRAWTEXT_FIX(1,0.52,0.35,0,'总现金流(亿):'),COLORFF00FF;
DRAWTEXT_FIX(1,0.52,0.55,0,'经营现金流(亿):'),COLORFF00FF;
DRAWTEXT_FIX(1,0.52,0.75,0,'商誉净资产比:'),COLORFF00FF;
 
DRAWNUMBER_FIX(1,0.67,0.15,1,负债率),COLORYELLOW;
DRAWNUMBER_FIX(1,0.67,0.35,1,总现金流亿),COLORYELLOW;
DRAWNUMBER_FIX(1,0.67,0.55,1,经营现金流亿),COLORYELLOW;
DRAWNUMBER_FIX(1,0.67,0.75,1,商誉雷区),COLORYELLOW;
 
DRAWTEXT_FIX(1,0.72,0.35,0,'上市日期:'),COLORFF00FF;
DRAWTEXT_FIX(ISLASTBAR,0.82,0.35,0,上市日期),COLORYELLOW;
最新财报:=CON2STR(FINONE(0,0,0),0),NODRAW;
DRAWTEXT_FIX(1,0.72,0.55,0,'最新财报:'),COLORFF00FF;
DRAWTEXT_FIX(ISLASTBAR,0.831,0.55,0,最新财报),COLORYELLOW;

上一篇:通达信源码:金色60分钟,短线买卖,短线买进

下一篇:通达信源码:资金进出一目了然,猎杀黑马,追踪主力