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

通达信源码:划线主图,峰哥分时起爆,逃顶绿箭

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

1、划线主图

{新趋势筹码峰+60天内最高低点黄金分割主图}
通达信公式 主图 源码 测试图)
 
DA:=100;
HI:=REFDATE(HHV(H,DA),DATE);
LO:=REFDATE(LLV(L,DA),DATE);
C1:=IF(CURRBARSCOUNT<=DA,C,DRAWNULL);
GZ:=EXP(LN(HI/LO)/10); 
LH1:=SUM(IF(C1>=(HI/GZ),V,0),DA);
LH2:=SUM(IF(C1>=(HI/POW(GZ,2)) AND C1<(HI/GZ),V,0),DA);
LH3:=SUM(IF(C1>=(HI/POW(GZ,3)) AND C1<(HI/POW(GZ,2)),V,0),DA);
LH4:=SUM(IF(C1>=(HI/POW(GZ,4)) AND C1<(HI/POW(GZ,3)),V,0),DA);
LH5:=SUM(IF(C1>=(HI/POW(GZ,5)) AND C1<(HI/POW(GZ,4)),V,0),DA);
LH6:=SUM(IF(C1>=(HI/POW(GZ,6)) AND C1<(HI/POW(GZ,5)),V,0),DA);
LH7:=SUM(IF(C1>=(HI/POW(GZ,7)) AND C1<(HI/POW(GZ,6)),V,0),DA);
LH8:=SUM(IF(C1>=(HI/POW(GZ,8)) AND C1<(HI/POW(GZ,7)),V,0),DA);
LH9:=SUM(IF(C1>=(LO*GZ) AND C1<LO*POW(GZ,2),V,0),DA);
LH10:=SUM(IF(C1>=LO AND C1<LO*GZ,V,0),DA);
L1:=REFDATE(HHV(LH1,DA),DATE);
L2:=REFDATE(HHV(LH2,DA),DATE);
L3:=REFDATE(HHV(LH3,DA),DATE);
L4:=REFDATE(HHV(LH4,DA),DATE);
L5:=REFDATE(HHV(LH5,DA),DATE);
L6:=REFDATE(HHV(LH6,DA),DATE);
L7:=REFDATE(HHV(LH7,DA),DATE);
L8:=REFDATE(HHV(LH8,DA),DATE);
L9:=REFDATE(HHV(LH9,DA),DATE);
L10:=REFDATE(HHV(LH10,DA),DATE);
SS:=(L1+L2+L3+L4+L5+L6+L7+L8+L9+L10);
STICKLINE(CEILING(DA*L1/SS)*3>=CURRBARSCOUNT,HI*0.98,HI/GZ,9,0),COLOR3C3C3A;
STICKLINE(CEILING(DA*L2/SS)*3>=CURRBARSCOUNT,HI/POW(GZ,1)*0.98,HI/POW(GZ,2),9,0),COLOR3C3C3A;
STICKLINE(CEILING(DA*L3/SS)*3>=CURRBARSCOUNT,HI/POW(GZ,2)*0.98,HI/POW(GZ,3),9,0),COLOR3C3C3A;
STICKLINE(CEILING(DA*L4/SS)*3>=CURRBARSCOUNT,HI/POW(GZ,3)*0.98,HI/POW(GZ,4),9,0),COLOR7C7C3A;
STICKLINE(CEILING(DA*L5/SS)*3>=CURRBARSCOUNT,HI/POW(GZ,4)*0.98,HI/POW(GZ,5),9,0),COLOR3C3C3A;
STICKLINE(CEILING(DA*L6/SS)*3>=CURRBARSCOUNT,HI/POW(GZ,5)*0.98,HI/POW(GZ,6),9,0),COLOR3C3C3A;
STICKLINE(CEILING(DA*L7/SS)*3>=CURRBARSCOUNT,HI/POW(GZ,6)*0.98,HI/POW(GZ,7),9,0),COLOR3C3C3A;
STICKLINE(CEILING(DA*L8/SS)*3>=CURRBARSCOUNT,LO*POW(GZ,2),LO*POW(GZ,3)*0.98,9,0),COLOR3C3C3A;
STICKLINE(CEILING(DA*L9/SS)*3>=CURRBARSCOUNT,LO*POW(GZ,1),LO*POW(GZ,2)*0.98,9,0),COLOR3C3C3A;
STICKLINE(CEILING(DA*L10/SS)*3>=CURRBARSCOUNT,LO,LO*POW(GZ,1)*0.98,9,0),COLOR3C3C3A;
{HD LD ZIG}
HD:=FILTER(BACKSET(FILTER(REF(H,5)=HHV(H,13),5),5+1),6);{高点}
LD:=FILTER(BACKSET(FILTER(REF(L,5)=LLV(L,21),6),6),5);{低点}
DRAWLINE(LD,L,HD,H,0),COLORRED,LINETHICK2;
DRAWLINE(HD,H,LD,L,0),COLORGREEN;
{A B }
J1:=BACKSET(CURRBARSCOUNT=2 ,MIN(BARSLAST(HD),BARSLAST(LD))+1);
J2:=J1>REF(J1,1);
DRAWLINE(J2,IF(HD,H,L),CURRBARSCOUNT=2 ,IF(BARSLAST(HD)>BARSLAST(LD),H,L),1),COLORYELLOW,LINETHICK3;
DRAWLINE(J2,IF(LD,H,L),CURRBARSCOUNT=2 ,IF(BARSLAST(LD)>BARSLAST(HD),H,L),1),COLORGREEN,LINETHICK3;
{60天内最高低点黄金分割}
CURR:CURRBARSCOUNT,NODRAW;
GTT:=CONST(BARSLAST(CONST(FINDHIGH(H,0,60,1))=H))+1;
SX跌H:CONST(IF(GTT=1,H,REF(H,GTT-1))),COLORGREEN;
DTT:=CONST(BARSLAST(CONST(FINDLOW(L,0,60,1))=L))+1;
SX涨L:CONST(IF(DTT=1,L,REF(L,DTT-1))),COLORGREEN;
X191:IF(CURRBARSCOUNT<=50,SX跌H-(SX跌H-SX涨L)*0.191,DRAWNULL),COLORGREEN,LINETHICK1;
DRAWTEXT(CURR=50,(X191)*1.015,STRCAT(STRCAT('0.806   ',CON2STR(X191,3)),'元')),COLORGREEN;
X382:IF(CURR<=50,SX跌H-(SX跌H-SX涨L)*0.382,DRAWNULL),COLORGREEN,LINETHICK1;
DRAWTEXT(CURR=50,(X382)*1.015,STRCAT(STRCAT('0.618%    ',CON2STR(X382,3)),'元')),COLORGREEN;
X500:IF(CURR<=50,SX跌H-(SX跌H-SX涨L)*0.500,DRAWNULL),COLORGREEN,LINETHICK3;
DRAWTEXT(CURR=50,(X500)*1.015,STRCAT(STRCAT('0.500%    ',CON2STR(X500,3)),'元')),COLORGREEN;
X618:IF(CURR<=50,SX跌H-(SX跌H-SX涨L)*0.618,DRAWNULL),COLORGREEN,LINETHICK1;
DRAWTEXT(CURR=50,(X618)*1.015,STRCAT(STRCAT('0.382  ',CON2STR(X618,3)),'元')),COLORGREEN;
X809:IF(CURR<=50,SX跌H-(SX跌H-SX涨L)*0.809,DRAWNULL),COLORGREEN,LINETHICK1;
DRAWTEXT(CURR=50,(X809)*1.015,STRCAT(STRCAT('0.191%    ',CON2STR(X809,3)),'元')),COLORGREEN;
STICKLINE(CURR=51,SX涨L,SX跌H,1,0),COLORGREEN;
DRAWTEXT(CURR=50,SX跌H*1.008,'60天内黄金分割最高点'),COLORGREEN;
DRAWTEXT(CURR=50,SX涨L*1.008,'60天内黄金分割最低点'),COLORGREEN;
{60日KX}
AAA:=CURRBARSCOUNT<=60;
STICKLINE(AAA AND C>=O,C,O,3.4,0),COLOR0000AA;
STICKLINE(AAA AND C>=O,C,O,3.0,0),COLOR0000BB ;
STICKLINE(AAA AND C>=O,C,O,2.4,0),COLOR0000CC;
STICKLINE(AAA AND C>=O,C,O,2.0,0),COLOR0000DD ;
STICKLINE(AAA AND C>=O,C,O,1.6,0),COLOR0000EE;
STICKLINE(AAA AND C>=O,C,O,1.2,0),COLOR0000FF;
STICKLINE(AAA AND C>=O,C,O,0.6,0),COLOR0000FF;
STICKLINE(AAA AND C>=O,H,L,0,0),COLORRED;
STICKLINE(AAA AND C<=O,C,O,3.4,0),COLORAAAA00;
STICKLINE(AAA AND C<=O,C,O,3.0,0),COLORBBBB00;
STICKLINE(AAA AND C<=O,C,O,2.4,0),COLORCCCC00;
STICKLINE(AAA AND C<=O,C,O,2.0,0),COLORDDDD00;
STICKLINE(AAA AND C<=O,C,O,1.6,0),COLOREEEE00;
STICKLINE(AAA AND C<=O,C,O,1.2,0),COLORFFFF00;
STICKLINE(AAA AND C<=O,C,O,0.6,0),COLORFFFF00;
STICKLINE(AAA AND C<=O,H,L,0,0),COLORFFFF00;



2、峰哥分时起爆

DRAWGBK(C>0, RGB(0,10,10),RGB(88,0,0),0,'11',0);

 
NN:=2400;
HD:=HHV(V,NN);
LD:=LLV(V,NN);
最高:=CONST(HD),NODRAW;
最低:=CONST(LD),NODRAW;
HLMAX:=最高;
HLMIN:=最低;
HLMN1:=(HLMAX+HLMIN)/2;
HLMN2:=HLMAX-HLMIN;
HLMN3:=(100-0)/2*1.3;
HLMN4:=(100-0)/1*1.3;
中间价轴:=(50-HLMN3)*HLMN2/HLMN4+HLMN1;
轴差:=最高-最低;
拉升量:=IF(C>REF(C,1),VOL,0);
打压量:=IF(C<REF(C,1),VOL,0);
昨拉升最高值:CONST(FINDHIGH(拉升量,FROMOPEN,240,1)),LINETHICK1,COLORMAGENTA;
昨打压最高值:=CONST(FINDHIGH(打压量,FROMOPEN,240,1)),LINETHICK1,COLORCYAN,NODRAW;
今拉升最高值:=CONST(REF(HHV(拉升量,FROMOPEN),0)),COLORRED;
今打压最高值:CONST(REF(HHV(打压量,FROMOPEN),0)),COLORCYAN,NODRAW;
攻击力度:今拉升最高值/昨拉升最高值,NODRAW;
量能均线:=SUM(V,FROMOPEN)/FROMOPEN;
量:=VOL,VOLSTICK;
五日量:=MA(量,5),COLORWHITE;
TT:=BARSCOUNT(C);{取得有效收盘价}
均价黄:=SUM(C*V,TT)/SUM(V,TT);{分时均线的取值}
量两步:=MA(V,5)>REF(MA(V,5),1) AND REF(MA(V,5),1)>REF(MA(V,5),2);
价两步:= C>=REF(C,1) AND REF(C,1)>REF(C,2);
价上岗量破5:=C>均价黄 AND V>MA(V,5);
量起爆:=V>=REF(V,1)*1;
价创新高:=C>=HHV(C,0);
量创新高:=V>=HHV(V,0);
对昨日涨幅:=(C/DYNAINFO(3)-1)*100<=2.50;{涨幅控制2个点以内}
每日一点:=量两步 AND 价两步 AND 价上岗量破5 AND 量起爆 AND 价创新高 AND 量创新高 AND 对昨日涨幅;
{计算收益、已爆分钟}
VV:=BARSSINCE(每日一点)+1;
首次起爆价:=REF(C,VV-1),NODRAW;
起爆收益:(DYNAINFO(7)-首次起爆价)/首次起爆价*100,NODRAW;
流通盘:=CAPITAL*100/100000000,NODRAW;
起爆时间:=REF(TIME/10000,VV),NODRAW;
已爆分钟:=VV-1,NODRAW;
STICKLINE(C>REF(C,1) AND V>=今打压最高值,0,V,0,0),COLORRED;
STICKLINE(C<REF(C,1) AND V>=今拉升最高值,0,V,0,0),COLORGREEN;
DRAWICON(C<REF(C,1) AND V>=今拉升最高值,V,2);
STICKLINE(C>REF(C,1) AND (V>昨拉升最高值 OR V>昨打压最高值),0,V,0,0),COLOR0000FF;
STICKLINE(C>REF(C,1) AND V>=2*昨拉升最高值 AND V<5*昨拉升最高值,昨拉升最高值,V,0,0),COLORFF00FF;
STICKLINE(C>REF(C,1) AND V>=5*昨拉升最高值,0,V,0,0),COLORMAGENTA;
STICKLINE(每日一点,最低+轴差*0.8,0,1,0),COLORMAGENTA;
DRAWICON(每日一点,V,1),COLORRED;
DRAWTEXT(每日一点,最低+轴差*0.8,'∠起爆'),COLORMAGENTA;
TA:=BARSLAST(TIME=100000);
TC:=REF(HHV(C,0),TA+1);
TV:=REF(HHV(V,0),TA+1);
ZF:=TC/DYNAINFO(3)<1.05;
XG1:=CROSS(C,TC) AND V>TV AND ZF,COLORWHITE;
TA1:=BARSLAST(TIME=110000);
CC1:=REF(HHV(C,0),TA1+1);
VV1:=REF(HHV(V,0),TA1+1);
ZF1:=CC1/DYNAINFO(3)<1.05;
XG2:=CROSS(C,CC1) AND V>VV1 AND ZF1,COLORYELLOW;
突破:=XG1 OR XG2,COLORRED;
VT:=BARSSINCE(突破)+1;
首次突破价:=REF(C,VT-1),NODRAW;
突破收益:(DYNAINFO(7)-首次突破价)/首次突破价*100,NODRAW;
STICKLINE(突破,V,0,1,0),COLORRED;
DRAWICON(突破=1,V,17);
DRAWTEXT(突破=1,最低+轴差*0.65,'☆突破'),COLORRED;
DRAWICON(FILTER(CROSS(拉升量,昨拉升最高值),30),V,1);
DRAWTEXT(FILTER(CROSS(拉升量,昨拉升最高值),30),最低+轴差*0.50,'★攻击'),COLORYELLOW;
DRAWICON(FILTER(CROSS(拉升量,今打压最高值),30),V,1);
DRAWTEXT(FILTER(CROSS(拉升量,今打压最高值),30),最低+轴差*0.35,'★攻击'),COLORMAGENTA;
大单买:SUM(IF(C>REF(C,1) AND V>4000,V/5,0),0),COLORRED,LINETHICK3;
大单卖:SUM(IF(C<REF(C,1) AND V>4000,V/5,0),0),COLORGREEN,LINETHICK3;
买单总:=SUM(IF(C>REF(C,1),V/5,0),0);
卖单总:=SUM(IF(C<REF(C,1),V/5,0),0);
小单买:买单总-大单买,COLORLIRED,DOTLINE;
小单卖:卖单总-大单卖,COLORLIBLUE,DOTLINE;
量极值:=CONST(VOL);
大单买量:=SUM(IF(C>REF(C,1) AND V>4000,V/1000,0),0),NODRAW;
大单卖量:=SUM(IF(C<REF(C,1) AND V>4000,V/1000,0),0),NODRAW;
买单总量:=SUM(IF(C>REF(C,1),V/1000,0),0),NODRAW;
卖单总量:=SUM(IF(C<REF(C,1),V/1000,0),0),NODRAW;
小单买量:=买单总量-大单买量,NODRAW;
小单卖量:=卖单总量-大单卖量,NODRAW;
大宗进:=大单买量,NODRAW;
大宗出:=大单卖量,NODRAW;
非大宗进:=小单买量,NODRAW;
非大宗出:=小单卖量,NODRAW;
主力净流入:=大单买量-大单卖量,COLORRED,NODRAW;
散户净流入:=小单买量-小单卖量,COLORRED,NODRAW;
净流入:=买单总量-卖单总量,COLORRED,NODRAW;
均价:=SUM(V*C,0)/SUM(V,0),COLORYELLOW;
DRAWTEXT_FIX(1,0.000,0.00,0,STRCAT(STRCAT('主力 ',CON2STR(主力净流入,0)),'万')),COLORMAGENTA;
DRAWTEXT_FIX(1,0.000,0.2,0,STRCAT(STRCAT('散户 ',CON2STR(散户净流入,0)),'万')),COLORCYAN;
DRAWTEXT_FIX(1,0.125,0.00,0,STRCAT(STRCAT('净流入 ',CON2STR(净流入,0)),'万')),COLORYELLOW;
 
地:=EMA(均价,50)/0.97,LINETHICK2,COLORGREEN;
买单次数:=COUNT(V>4000 AND C>REF(C,1),0);
黄次数:=COUNT(V>DYNAINFO(16)*10 AND C>REF(C,1),0),COLORYELLOW,NODRAW;
DRAWICON(买单次数>REF(买单次数,1) AND 黄次数>REF(黄次数,1) AND CROSS(C,地),大单买,7);
DRAWICON(小单买量>小单卖量 AND 大单买量>小单买量 AND 小单卖量>大单卖量,大单买,41);
BGTYU:=IF(DATE>=1130107,1,0);
GHYJKU:=BETWEEN((DCLOSE*BGTYU)/(SUM(AMOUNT,BARSCOUNT((DCLOSE*BGTYU)))/SUM(VOL*100,BARSCOUNT((DCLOSE*BGTYU)))),1.05,0.95);
VBNH:=IF(GHYJKU=0,MA((DCLOSE*BGTYU),BARSCOUNT((DCLOSE*BGTYU))),(SUM(AMOUNT,BARSCOUNT((DCLOSE*BGTYU)))/SUM(VOL*100,BARSCOUNT((DCLOSE*BGTYU)))));
DRAWTEXT(CROSS(EXPMA((DCLOSE/VBNH),120),1.0029),小单买,'↖可买'),COLORWHITE;
DRAWICON(CROSS(EXPMA((DCLOSE/VBNH),120),1.0029),小单买,25);
DRAWTEXT(CROSS(EXPMA((DCLOSE/VBNH),120),1.004),小单卖,'↖转强'),COLORMAGENTA;
DRAWICON(CROSS(EXPMA((DCLOSE/VBNH),120),1.004),小单卖,13);
DRAWICON(CROSS(EXPMA((DCLOSE/VBNH),20),1.02),小单买,1);
 
吃定:=(EXPMA(CLOSE,500)-REF(EXPMA(CLOSE,500),1))/REF(EXPMA(CLOSE,500),1)*100, COLORSTICK;
主力:=EXPMA( (EXPMA(CLOSE,500)-REF(EXPMA(CLOSE,500),1))/REF(EXPMA(CLOSE,500),1)*100,120)-0.0004,LINETHICK5,COLORMAGENTA;
散户:=EXPMA( (EXPMA(CLOSE,500)-REF(EXPMA(CLOSE,500),1))/REF(EXPMA(CLOSE,500),1)*100,200),LINETHICK5,COLORGREEN;
DRAWICON(CROSS(EXPMA(吃定,120)-0.0004,EXPMA(吃定,200)),小单买,13); 
DRAWTEXT(CROSS(EXPMA(吃定,120)-0.0004,EXPMA(吃定,200)),小单买,'↖金叉'),COLORRED;
DRAWICON(CROSS(EXPMA(吃定,120)-0.0004,EXPMA(吃定,200)),小单买,13); 
Q:=BETWEEN(C/(SUM(AMOUNT,BARSCOUNT(C))/SUM(VOL*100,BARSCOUNT(C))),1.05,0.95);
Q2:=IF(Q=0,MA(C,BARSCOUNT(C)),(SUM(AMOUNT,BARSCOUNT(C))/SUM(VOL*100,BARSCOUNT(C))));
STICKLINE(CROSS((C/Q2),1.03),1.01,1.02,1.0,0), , COLORYELLOW;
DRAWICON(CROSS((C/Q2),1.03),小单买,1);




3、逃顶绿箭

波段类公式( 顶尖财经 股票学院: http://58188.com )

顶区:90,COLORFFFF00,LINETHICK1;
底区:18,COLOR208FFF,LINETHICK1;
0;
TJ1:=(C-LLV(LOW,18))/(HHV(HIGH,18)-LLV(LOW,18))*100;
TJF:=SMA(TJ1,13,8);
TJFF:=SMA(TJ1,13,4);
DRAWBAND(TJF,RGB(1020,0,0),TJFF,RGB(800,100,50));
中线:45,COLOR555555;
AR1:=(CLOSE-LLV(LOW,120))/(HHV(HIGH,120)-LLV(LOW,120))*100;
AR2:=SMA(AR1,3,1);
AR3:=SMA(AR2,3,1);
AR4:=SMA(AR3,3,1);
MMCD:=3*(AR3-AR4);
STICKLINE(MMCD>0,MMCD+45,45,0.0,0),COLORYELLOW;
STICKLINE(MMCD<0,MMCD+45,45,0.0,0),COLORGREEN;
DRAWTEXT(ISLASTBAR AND TJF>REF(TJF,1),TJF,' '),COLOR0000FF;
DRAWTEXT(ISLASTBAR AND TJF<REF(TJF,1),TJF,' '),COLORCYAN;
DRAWTEXT(ISLASTBAR,顶区,''),COLORFFFF00;
DRAWTEXT(ISLASTBAR,底区,''),COLOR208FFF;
DRAWICON(CROSS(TJF,89),TJF,2);
AL:=(EMA(CLOSE,8)-EMA(CLOSE,55))*10;
TRK:=EMA(EMA(CLOSE,13),13);
MTQ:=(TRK-REF(TRK,1))/REF(TRK,1)*1000;
VX1:=(C-DYNAINFO(11))/DYNAINFO(11)<-0.005;
VX2:=(C-DYNAINFO(11))/DYNAINFO(11)<-0.03;
VX3:=MTQ>REF(MTQ,1) AND MTQ<-0.2;
VX4:=CROSS(AL,EMA(AL,3)) AND AL<-0.3;
VX5:=FILTER(VX1 AND VX3 AND VX4,13);
VX6:=FILTER(VX2 AND VX3 AND VX4,13);
逃顶:CROSS(TJF,89);

上一篇:通达信源码:确认成妖,分时突破抓板指标,主导动能

下一篇:通达信公式下载:弘音院系统,金山米线,金山钓鱼