指标是做波段、做趋势的利器,分享给大家,值得学习研究
 

通达信挖洞捕副图源码

昨收:=DYNAINFO(3);

HH:=DYNAINFO(5);

LL:=DYNAINFO(6);

FK:=MAX(HH-昨收,昨收-LL)*0.1;

ZS:=昨收-FK*3.2;

Q1:=昨收-FK*3.22;

Q2:=昨收-1*FK*3.22;

Q3:=昨收-5*FK*3.2;

{时间大额设置}

TJ:=FILTER(C,239)>0,NODRAW;

TJJ:=SUM(TJ,0),NODRAW;

TJA:=CONST(TJJ),NODRAW;

C1:=CLOSE;

V1:=TIME;

A1:=COUNT(BARSCOUNT(C)=1 AND TIME<102000 ,0 );

T:=IF(V1<130000,(FLOOR(V1/10000)-9.5)*60+(FLOOR(V1/100)-100*FLOOR(V1/10000)),

(FLOOR(V1/10000)-11)*60+(FLOOR(V1/100)-100*FLOOR(V1/10000))),NODRAW;

TTA:=90;

KP30:=T<240;

KPGD:=H=HHV(H,0) AND KP30;

GDSJ:=BARSLAST(KPGD);

RCC:=DYNAINFO(3);

S2:=SMA(C,3,1);

S6:=SMA(C,5,1);

DK:=4*(S2-S6);

KK:=1;

成交额:=AMOUNT,NODRAW;

VV2:=SUM(AMOUNT,T),NODRAW;

VV3:=VV2/T;

SS:=IF(CAPITAL>150000000,0.3,IF(CAPITAL>20000000,0.5,IF(CAPITAL>10000000,0.8,IF(CAPITAL<200000,5,IF(CAPITAL<1000000,3,

IF(CAPITAL<5000000,1.5,1)))))),NODRAW;

VV5:=(REF(VV3,T-1)/CEILING(REF(VV3,T-1)/CAPITAL *10000+0.1))*SS,NODRAW;

大额线:=IF(REF(VV3,T)=REF(VV3,T-1),VV5,REF(VV3,T)),NODRAW;

起算量:大额线*100,COLOR00FFFF,NODRAW;

初正1:=IF(T=1 AND DYNAINFO(4)>=DYNAINFO(3),VV2,0);

初负1:=IF(T=1 AND DYNAINFO(4)<DYNAINFO(3),VV2,0);

初正:=CONST(SUM(IF(初正1>=大额线 AND T=1,初正1,0),T)),NODRAW;

初负:=CONST(SUM(IF(初负1>=大额线 AND T=1,初负1,0),T)),NODRAW;

初正2:=CONST(SUM(IF(初正1<大额线 AND T=1,初正1,0),T)),NODRAW;

初负2:=CONST(SUM(IF(初负1<大额线 AND T=1,初负1,0),T)),NODRAW;

T00:=IF(C1>REF(C1,1),0.9,-0.9);

T01:=IF(C1<REF(C1,1),-0.9,0.9);

T02:=T00+T01,NODRAW;

TT1:=BARSLAST(CROSS(T02,+1.5)),NODRAW;

TT2:=BARSLAST(CROSS(-1.5,T02)),NODRAW;

TT:=IF(T02=1.8,1,IF(T02=-1.8,-1,0));

正V1:=IF(TT=1 OR (TT=0 AND TT1<TT2),成交额,0),NODRAW;

负V1:=IF(TT=-1 OR (TT=0 AND TT1>TT2),成交额,0),NODRAW;

正总1:=初正1+SUM(正V1,T),NODRAW,COLOR0000FF;

负总1:=初负1+SUM(负V1,T),NODRAW,COLOR00FF00;

正V:=IF(正V1>=大额线,正V1,0);

负V:=IF(负V1>=大额线,负V1,0);

正V2:=IF(正V1<大额线,正V1,0);

负V2:=IF(负V1<大额线,负V1,0);

正总:=初正+SUM(正V,T),NODRAW,COLOR0000FF;

负总:=初负+SUM(负V,T),NODRAW,COLOR00FF00;

正总2:=初正2+SUM(正V2,T),NODRAW,COLOR0000FF;

负总2:=初负2+SUM(负V2,T),NODRAW,COLOR00FF00;

大差%:(正总-负总)/(正总+负总)*100,COLOR00FF00,NODRAW;

小差%:(正总2-负总2)/(正总2+负总2)*100,COLOR00FF00,NODRAW;

JSQ:=IF((Q2+Q3)/2*1.042<RCC,RCC,(Q2+Q3)/2*1.042);

DRAWBAND(JSQ,RGB(50,50,50),(Q2+Q3)/2*0.99,DRAWNULL);

Q4:=IF(大差%>=0,JSQ,(Q2+Q3)/2*0.99),NODRAW;

Q5:=IF(大差%>=0,(Q2+Q3)/2*0.99,JSQ),NODRAW;

DRAWBAND(Q4,RGB(100,100,100),Q5,RGB(50,50,50));

STICKLINE(CROSS(大差%,-0.999),(Q2+Q3)/2*0.99,JSQ,10,0),COLOR777777;

STICKLINE(CROSS(-0.999,大差%),(Q2+Q3)/2*0.99,JSQ,10,0),COLOR777777;

{强弱界定  家公式网 .COM}

MMA30:=EMA(CLOSE,30)-(Q2+Q3)/2*0.01;

强弱界定:=EMA(CLOSE,900)-(Q2+Q3)/2*0.01;

DRAWBAND(MMA30,RGB(200,100,0),强弱界定,RGB(0,150,150));

DRAWICON(CROSS(MMA30,强弱界定),H,1);

{金龙喜舞}

日时转换:=IF(PERIOD=5,120,240);

QZS:=(EMA(CLOSE,10)+EMA(CLOSE,32))/2-(Q2+Q3)/2*0.01;

VAR1:=(EMA(CLOSE,30)+EMA(CLOSE,72))/2-(Q2+Q3)/2*0.01;

VAR2:=(EMA(VOL,10)+EMA(VOL,32))/2-(Q2+Q3)/2*0.01;

VAR3:=(VAR1+VAR2)/2;

VAR4:=EMA(VAR3,30);

VAR5:=EMA(VAR3,60);

VAR6:=EVERY(VAR1>REF(VAR1,1),5) AND EVERY(VAR4>REF(VAR4,1),5);

DRAWBAND(VAR1,RGB(150,30,30),EMA(VAR1,60),RGB(0,110,30));

牵引线:=VAR1,COLORYELLOW;

强弱线:=EMA(VAR1,日时转换),POINTDOT,COLORWHITE;

趋势关注:=IF(CROSS(VAR1,EMA(VAR1,60)) AND VAR6,1,0),NODRAW,COLORRED;

量价关注:=IF(CROSS(VAR3,VAR5) AND VAR6,1,0),NODRAW,COLORWHITE;

冲击量:=IF(VAR3>VAR5 AND VAR6,1,0),NODRAW,COLORYELLOW;

强势区:=IF(VAR1>强弱线,1,DRAWNULL),NODRAW,COLORRED;

止损区:=IF(VAR1<强弱线,1,DRAWNULL),NODRAW,COLORGREEN;

STICKLINE(QZS>VAR1,QZS,VAR1,1,0),COLORFF00FF;

STICKLINE(冲击量=1,QZS,VAR1,1,0),COLORYELLOW;

DRAWICON(趋势关注=1,EMA(VAR1,60),13);

DRAWTEXT(量价关注=1,EMA(VAR1,60),’L0V’),COLORWHITE;

 

{分时MACD}

DIF:=(EMA(CLOSE,13) – EMA(CLOSE,24));

DEA:=(EMA(DIF,6));

MACD:=5*(DIF-DEA);

STICKLINE(DK>0,RCC*KK,RCC*KK+DK,0,1),COLORRED;

STICKLINE(DK<0,RCC*KK,RCC*KK+DK,0,1),COLORCYAN;

STICKLINE(DK>0,RCC*KK,RCC*KK+DK,0,1),COLORRED;

{多头MACD}

DIFF:=EMA(CLOSE,240)-EMA(CLOSE,240)*100;

DEAA:=EMA(DIFF,18);

多头MACD:=(-3*(DIFF-DEAA))*20,NODRAW;

ZD:=HHV(多头MACD,0);

ZX:=LLV(多头MACD,0);

CZ:=(Q2-Q3)/6;

FDM:=MAX(ABS(ZD),ABS(ZX))*1.5;

RB:=(Q2+Q3)/2*0.99+2*(Q2-Q3)/4/FDM*多头MACD;

STICKLINE(多头MACD>0,RB,(Q2+Q3)/2*0.99,2,1),LINETHICK1,COLOR00AAFF;

STICKLINE(多头MACD<0,RB,(Q2+Q3)/2*0.99,2,1),LINETHICK1,COLOR00AA00;

{火焰山}

EEEE:=(RCC-ZS)/3;

FVAR1:=REF(LOW,1);

FVAR2:=SMA(ABS(LOW-FVAR1),13,1)/SMA(MAX(LOW-FVAR1,0),13,1);

FVAR3:=EMA(FVAR2,13);

FVAR4:=LLV(LOW,34);

FVAR51:=EMA(IF(LOW<=FVAR4,FVAR3,0),3);

FVAR5:=IF(FVAR51>20,20,FVAR51);

主力进场:STICKLINE(FVAR5>REF(FVAR5,1),(Q2+Q3)/2,(Q2+Q3)/2+FVAR5*EEEE,10,0 ),COLORRED;

STICKLINE(FVAR5<REF(FVAR5,1),(Q2+Q3)/2,(Q2+Q3)/2+FVAR5*EEEE,5,1),COLORGREEN;

{庄迹}

FVAR6:=100-3*SMA((CLOSE-LLV(LOW,75))/(HHV(HIGH,75)-LLV(LOW,75))*100,20,1)+2*SMA(SMA((CLOSE-

LLV(LOW,75))/(HHV(HIGH,75)-LLV(LOW,75))*100,20,1),15,1);

FVAR8:=TJA<4 AND  COUNT(((FVAR6<REF(FVAR6,1) AND VOL>REF(VOL,1) AND CLOSE>REF(CLOSE,1) AND CLOSE<DYNAINFO(3)*1.02)),30)=1;

DRAWTEXT(FVAR8 AND COUNT(FVAR8,30)=1,(Q2+Q3)/2*0.99,’★迹’),COLORFFFFFF;

{横盘突破}

 

YY:=SMA(VOL,30,1);

量1:=(YY-LLV(LLV(YY,1),30))/(HHV(HHV(YY,1),30)-LLV(LLV(YY,1),30));

量:=(YY-LLV(LLV(YY,1),30))/(HHV(HHV(YY,1),30)-LLV(LLV(YY,1),30))>0.92;

短横:=((HHV(CLOSE,TTA)-LLV(CLOSE,TTA))/CLOSE)<0.01;

横后上涨:=(CLOSE/DYNAINFO(3))<1.03  AND 短横 AND 量  AND CROSS(C,(MA(C*V,TTA)/MA(V,TTA) + AVEDEV(C,TTA)*2));

上涨:=T>90 AND (FILTER((CROSS(横后上涨,0) AND 量 AND T>60 OR (T>60  AND

CLOSE<DYNAINFO(3)*1.03  AND (量1<0.5 OR 量1=1) AND

BARSLAST(CROSS(C,(MA(C*V,TTA)/MA(V,TTA) + AVEDEV(C,TTA)*2)))<3

AND CROSS(C,MA(HHV(C,TTA),1)))),30));

STICKLINE(TJA<4  AND 上涨,(Q2+Q3)/2,(Q2+Q3)/2*1.035,10,0),COLOR0000FF;

DRAWTEXT(TJA<4 AND 上涨,(Q2+Q3)/2*1.035,’★横’),COLORRED;

 

{DIF金叉以及KD金叉}

JCCOUNT:=COUNT(CROSS(DIF,DEA),BARSLAST(DEA>=0));

二次金叉:=CROSS(DIF,DEA) AND DEA<0 AND COUNT(JCCOUNT=2,21)=1;

STICKLINE(TJA<4 AND 二次金叉,(Q2+Q3)/2,(Q2+Q3)/2*1.01,10,0),COLORFF00FF;

DRAWTEXT(TJA<4 AND 二次金叉,(Q2+Q3)/2*1.01,’ 二金’),COLORYELLOW;

HHH:=MA(CLOSE,10);

GGG:=MA(CLOSE,12);

下:=EMA((MA(LOW,3) * 0.96),30);

决战:STICKLINE((TJA<4 OR TJA=3 AND TJJ>1) AND (CROSS(DIF,DEA) AND (下 – REF(下,1)) > 0 AND MACD > REF(MACD,1) AND DIF < 0),(Q2+Q3)/2,(Q2+Q3)/2*1.01,10,0),COLOR0000FF;

DRAWTEXT((TJA<4 OR TJA=3 AND TJJ>1) AND (CROSS(DIF,DEA) AND (下 – REF(下,1)) > 0 AND MACD > REF(MACD,1) AND DIF < 0),(Q2+Q3)/2*1.03,’DIF金叉’),COLORFFFFFF;

RSV:=((CLOSE-LLV(LOW,240))/(HHV(HIGH,240)-LLV(LOW,240))*200-100);

K:=SMA(SMA(RSV,18,1),3,1);

D:=MA(EMA(K,18),3);

短买:=(CROSS(K,D) AND K>0 AND 量  AND  CLOSE<DYNAINFO(3)*1.03);

JCC:=COUNT(CROSS(K,D),BARSLAST(D>=0));

K二金:=(CROSS(K,D) AND DEA<0 AND COUNT(JCC=2,21)=1);

DRAWTEXT(TJA<4 AND 短买,(Q2+Q3)/2*1.035,’短买’),COLORFFFF00;

DRAWTEXT(TJA<4 AND K二金,(Q2+Q3)/2*1.035,’K二金’),COLORFFEE00;

 

{冲高过顶}

顶高:REF(H,GDSJ),COLORFFFFFF,POINTDOT,LINETHICK1;

过顶:=IF(CROSS(C,顶高),1,0),COLOR00FF00,POINTDOT,NODRAW;

冲高:=IF(FILTER(CROSS(C,顶高*1.01),15),1,0),COLOR00FFFF,POINTDOT,NODRAW;

DRAWTEXT(过顶,顶高*1.005,’↑’),COLOR00FF00;

DRAWTEXT(冲高,顶高*1.005,’☆’),COLOR00FFFF;

 

{盘龙驸凤}

RCC11:=IF((RCC*KK+大差%/100)<(Q2+Q3)/2*0.96,(Q2+Q3)/2*0.96-((Q2+Q3)/2*0.96-(RCC*KK+大差%/100))*0.1,

IF((RCC*KK+大差%/100)>(Q2+Q3)/2*1.07 AND (Q2+Q3)/2*1.04>=RCC*KK ,

(Q2+Q3)/2*1.07+((RCC*KK+大差%/100)-(Q2+Q3)/2*1.04)*0.1,(RCC*KK+大差%/100))),NODRAW;

RCC1:=IF(RCC*KK>(Q2+Q3)/2*1.04 AND RCC11>RCC*KK,

(RCC11-RCC*KK)*0.2+RCC*KK,RCC11);

{RCC1:=(RCC*KK+大差%/100);}

 

盘龙:IF(T>5 AND 正总!=0 AND 负总!=0,RCC1,DRAWNULL),COLOR00FF00,LINETHICK2;

RCC22:=IF((RCC*KK+小差%/100)<(Q2+Q3)/2,(Q2+Q3)/2-((Q2+Q3)/2-(RCC*KK+小差%/100))*0.1,

IF((RCC*KK+小差%/100)>(Q2+Q3)/2*1.04 AND (Q2+Q3)/2*1.04>=RCC*KK ,

(Q2+Q3)/2*1.04+((RCC*KK+小差%/100)-(Q2+Q3)/2*1.04)*0.1,(RCC*KK+小差%/100)));

RCC2:=IF(RCC*KK>(Q2+Q3)/2*1.04 AND RCC22>RCC*KK,

(RCC22-RCC*KK)*0.2+RCC*KK,RCC22);

望喜:IF(T>5 AND 正总1!=0 AND 负总1!=0,RCC2,DRAWNULL),COLORFFFF00,LINETHICK1;

STICKLINE(FILTER(C,239)>0,(Q2+Q3)/2*0.99,JSQ,0.5,0),COLORWHITE;

EMA(VAR1,日时转换),POINTDOT,COLORWHITE;

 

通达信挖洞捕蝉主图源码

DIF:=EMA(CLOSE,12)-EMA(CLOSE,26);

DEA:=EMA(DIF,9);

MACD:=(DIF-DEA)*2;

DRAWBAND(MA(CLOSE,60),RGB(200,80,80),MA(CLOSE,120),RGB(0,0,115));

DRAWBAND(MA(CLOSE,N1),RGB(100,100,80),MA(CLOSE,N2),RGB(0,200,215));

MA1:MA(CLOSE,N1),LINETHICK3;

MA2:MA(CLOSE,N2),LINETHICK3;

MA55:MA(CLOSE,55),LINETHICK2,COLORGREEN;

MA24:MA(C,24),LINETHICK2,COLORBLUE;

MA360:MA(C,360),LINETHICK2,COLORYELLOW;

DRAWKLINE(HIGH,OPEN,LOW,CLOSE);

STICKLINE(DIF>REF(DIF,1),MA1,MA2,0.1,1),COLORMAGENTA;

STICKLINE(DIF<REF(DIF,1) OR MACD<REF(MACD,1),MA1,MA2,0.1,1),COLORGREEN;

PMA:MA(C,N1),COLORWHITE,LINETHICK3;

IF(PMA>REF(PMA,1),PMA,DRAWNULL),COLORRED,LINETHICK3;

IF(PMA<REF(PMA,1),PMA,DRAWNULL),COLORGREEN,LINETHICK3;

RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;

K:=SMA(RSV,9,1);

D:=SMA(K,9,1);

J:=3*K-2*D;

STICKLINE(CROSS(DIF,DEA) AND CROSS(K,D) AND CROSS(MA1,MA2),C,C,1,1);

DRAWICON(MA2>REF(MA2,1),MA2,1);

DRAWICON(MA2<REF(MA2,1),MA2,2);

 


声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。