通达信指标公式源码概况:

指标类别: 通达信指标公式

授权方式: 免费版

指标评级: ★★★★★

指标分类: 策略

画线方法: 副图

通达信量化交易主图指标公式  

均价线:=AMOUNT/V/100;  

C2:=REF(C,1);  

涨停:=IF(REF(C,1)*1.1-C0.01,1,0);  

STICKLINE(涨停,OPEN,CLOSE,6,0),colorred;  

STICKLINE(涨停,OPEN,CLOSE,6,0),coloryellow;  

STICKLINE(涨停,H,L,0,0),coloryellow;  

DRAWTEXT(均价线AND涨停,H*0.98,'┄┄┄┄┄'),colorgreen;  

DRAWTEXT((O+C)/2AND涨停,(O+C)/2,'┄┄┄┄┄'),colormagenta;  

DRAWTEXT(涨停,L,'┄┄┄┄┄'),colorgray;  

MA13:MA(C,13),colorgray;  

MA21:=MA(C,21),colorwhite;  

MA30:=MA(C,30);  

PARTLINE(MA30,MA30=MA30[1]ANDMA30=MA30[3],RGB(255,0,0),MA30=MA30[1],RGB(0,255,0)),linethick2;  

支撑线:((MA(CLOSE,3)+MA(CLOSE,6)+MA(CLOSE,12)+MA(CLOSE,24))/4),colormagenta;  

LC:=REF(CLOSE,1);  

操作线:=SMA(MAX(CLOSE-LC,0),2,1)/SMA(ABS(CLOSE-LC),2,1)*100;  

趋势线:=SMA(MAX(CLOSE-LC,0),14,1)/SMA(ABS(CLOSE-LC),14,1)*100;  

震仓线:=45;  

震仓线2:=50;  

逃命线:=80;  

抄底线:=20;  

绝底线:=5;  

PP2:=操作线震仓线2ANDREF(操作线,1)震仓线2;  

PP:=操作线震仓线ANDREF(操作线,1)震仓线;  

PP3:=操作线抄底线ANDREF(操作线,1)抄底线;  

HH:=COUNT(涨停,13)=1;  

STICKLINE(PP2ANDHH,OPEN,CLOSE,4.8,0),colorblue;  

STICKLINE(PPANDHH,OPEN,CLOSE,4.8,0),colorblue;  

STICKLINE(PP3ANDHH,OPEN,CLOSE,4.8,0),colorblue;  

A:=SMA(L,4,3);  

STICKLINE(AANDREF(PP,1)ANDHH,A*0.9999,A*0.996,14,0),colorgreen;  

DRAWICON(AANDREF(PP,1)ANDHH,L*0.98,'buy');  

STICKLINE(AANDREF(PP3,1)ANDHH,A*0.9999,A*0.996,14,0),colorgreen;  

DRAWICON(AANDREF(PP3,1)ANDHH,L*0.98,'buy');  

HD:=COUNT(涨停,21)=1;

A1:=SMA(H,4,3);  

STICKLINE(A1ANDHD,A1,A1*1.001,10,0),colorwhite;  

MA5:MA(C,5),colorblue;  

MA10:MA(C,10),colormagenta;  

MA20:MA(C,20),colorred;  

MA60:MA(C,60),colorgreen;  

MA120:MA(C,120),coloryellow;  

XL1:=((LLV(LOW,3)=LLV(LOW,60))AND((CLOSE/REF(CLOSE,1))=1.04));  

DRAWTEXT(FILTER(((XL10)ANDLOW),5),L*0.975,'洼底'),colorliblue;  

DIFF1:=EMA(CLOSE,12)-EMA(CLOSE,27);  

DEA1:=EMA(DIFF1,9);  

A1:=BARSLAST(REF(CROSS(DIFF1,DEA1),1));  

背离:=REF(CLOSE,A1+1)CLOSEANDDIFF1REF(DIFF1,A1+1)ANDCROSS(DIFF1,DEA1);  

DRAWTEXT(底背离,L*0.99,'底背离'),colormagenta;  

A2:=BARSLAST(REF(CROSS(DEA1,DIFF1),1));  

顶背离:=REF(CLOSE,A2+1)CLOSEANDREF(DIFF1,A2+1)DIFF1ANDCROSS(DEA1,DIFF1);  

DRAWTEXT(顶背离,H*1.01,'顶背离'),,coloryellow;  

MACD:=2*(DIFF1-DEA1);  

多转空:=((((LLV(MACD,4)0)AND(MACDREF(MACD,1)))AND(REF(MACD,1)REF(MACD,2)))AND(REF(MACD,2)REF(MACD,3)));  

空转多:=((((HHV(MACD,4)0)AND(MACDREF(MACD,1)))AND(REF(MACD,1)REF(MACD,2)))AND(REF(MACD,2)REF(MACD,3)));  

DRAWICON(多转空,H*1.01,8);  

DRAWICON(空转多,L*0.99,7);  

MTM:=C-REF(C,1);  

DX:=100*EMA(EMA(MTM,6),6)/EMA(EMA(ABS(MTM),6),6);  

BBUY:=IF(LLV(DX,2)=LLV(DX,7)ANDCOUNT(DX0,2)ANDCROSS(DX,MA(DX,2)),1,0);  

BBSY:=IF(HHV(DX,2)=HHV(DX,7)ANDCOUNT(DX50,2)ANDCROSS(MA(DX,2),DX),1,0);  

BBBUY:=FILTER(BBUY=1,5);  

DRAWTEXT(FILTER(BBSY=1,1),HIGH*1.015,'亢');  

FFQ2:=(CLOSE-LLV(LOW,20))/(HHV(HIGH,20)-LLV(LOW,20))*100;  

FFQ3:=SMA(FFQ2,9,1);  

FFQ4:=SMA(FFQ3,3,1);  

FFAAB:=3*FFQ3-2*FFQ4;  

FFQ81:=BARSLAST(LLV(LOW,50)=LOW);  

FFQ8:=BARSLAST(HHV(HIGH,FFQ81)=HIGH);  

FFQ10:=(CLOSE-REF(OPEN,FFQ8))/REF(OPEN,FFQ8)*100;  

FFA1:=EMA(FFQ3,3);  

FFA2:=EMA(FFA1,3);  

FFA3:=EMA(FFA2,3);  

FFA4:=EMA(FFA3,3);  

FFA:=EMA(FFA4,3);  

FFQTTMM:=CROSS(FFA1,FFAAB)ANDREF(FFAAB,1)80;  

DRAWTEXT(FFQTTMM,HIGH*1.016,'悔'),colorgreen;  

GLL5:=(CLOSE-MA(CLOSE,5))/MA(CLOSE,5)=-0.10;  

DRAWTEXT(GLL5,LOW*0.98,'0510'),colorblue;  

GLL10:=(CLOSE-MA(CLOSE,10))/MA(CLOSE,10)=-0.15;  

DRAWTEXT(GLL10,LOW*0.97,'1015'),colormagenta;  

GLL20:=(CLOSE-MA(CLOSE,20))/MA(CLOSE,20)=-0.20;  

DRAWTEXT(GLL20,LOW*0.96,'2020'),colorred;  

GLLZ5:=(CLOSE-MA(CLOSE,5))/MA(CLOSE,5)=0.10;  

DRAWTEXT(GLLZ5,HIGH*1.02,'0510'),colorblue;  

GLLZ10:=(CLOSE-MA(CLOSE,10))/MA(CLOSE,10)=0.15;  

DRAWTEXT(GLLZ10,HIGH*1.03,'1015'),colormagenta;  

GLLZ20:=(CLOSE-MA(CLOSE,20))/MA(CLOSE,20)=0.20;  

DRAWTEXT(GLLZ20,HIGH*1.04,'2020'),colorred;  

DRAWTEXT_FIX(ISLASTBAR,0.37,0.90,0,'①长平短升,黄金交叉,价突破②长升短平,回测不破,价突破③长升短跌,小跌破,价突破');  

DRAWTEXT_FIX(ISLASTBAR,0.37,0.95,0,'①长平短跌,死亡交叉,价跌破②长跌短平,弹不过,价跌破③长跌短升,小突破,价跌破');  

image.png

  

通达信量价之王主图指标公式  

OBV:=EMA(SUM(IF(CREF(C,1),VOL,IF(CREF(C,1),-V,0)),0)/1000,2);  

obve:=EMA(OBV,3);  

DIFF:=(EMA(obve,12)-EMA(obve,26));  

bbDIFF:=DIFF-REF(DIFF,1);  

DEA:=EMA(DIFF,9);  

bbDEA:=DEA-REF(DEA,1);  

MACD:2*(DIFF-DEA);  

PARTLINE(IF(C,0,0),0,colorwhite);  

STICKLINE(DIFF=REF(DIFF,1)ANDDEAREF(DEA,1),DIFF,dea,8,0),LINETHICK4,Color0089FF;//{橙}  

//DRAWTEXT(DIFF=REF(DIFF,1)ANDDEAREF(DEA,1),L*0.98,介入);  

STICKLINE(DIFFDEA,DIFF,DEA,8,0),Color0089FF;//{橙–加宽}  

STICKLINE(DIFFREF(DIFF,1)ANDDEAREF(DEA,1),DIFF,DEA,8,0),LINETHICK4,colorblue;//{蓝}  

STICKLINE(DIFFDEA,DIFF,DEA,8,0),colorblue;//{蓝–加宽}  

STICKLINE(DIFF=REF(DIFF,1)ANDDEAREF(DEA,1),DIFF,DEA,8,0),LINETHICK4,Color00C500;//{绿}  

STICKLINE(DIFFREF(DIFF,1)ANDDEAREF(DEA,1),DIFF,DEA,8,0),LINETHICK4,coloryellow;//{黄}  

STICKLINE(MACDREF(MACD,1)ANDMACD0,0,MACD,2,0),colorred;  

STICKLINE(MACDREF(MACD,1)ANDMACD0,0,MACD,2,0),coloryellow;  

STICKLINE(MACDREF(MACD,1)ANDMACD0,0,MACD,2,0),colorgreen;  

STICKLINE(MACDREF(MACD,1)ANDMACD0,0,MACD,2,0),COLOR0099FF;  

IF(C,2*(DEA-DIFF),MACD),LINETHICK2,colorgray;//{加速线}  

M1:=18;N:=3;  

MA2:=MA(C,M1);  

MAVOL18:=MA(V,M1);  

价向上:=IF(COUNT(MA2=REF(MA2,1),N)=n,1,0);  

量向上:=IF(COUNT(MAVOL18=REF(MAVOL18,1),N)=n,1,0);  

价向下:=IF(COUNT(MA2REF(MA2,1),N)=n,1,0);  

量向下:=IF(COUNT(MAVOL18REF(MAVOL18,1),N)=n,1,0);  

多头:IF((价向上+量向上)1,1,0);  

空头:IF((价向下+量向下)1,1,0);  

价下1:IF((量向上+价向下)1,1,0);  

量下2:IF((量向下+价向上)1,1,0);  

VAR1:=(VOL/(((HIGH-LOW)*2)-ABS((CLOSE-OPEN))));  

买盘:=IF((CLOSEOPEN),(VAR1*(HIGH-LOW)),IF((CLOSEOPEN),(VAR1*((HIGH-OPEN)+(CLOSE-LOW))),(VOL/2)));  

卖盘:=IF((CLOSEOPEN),(0-(VAR1*((HIGH-CLOSE)+(OPEN-LOW)))),IF((CLOSEOPEN),(0-(VAR1*(HIGH-LOW))),(0-(VOL/2))));  

买卖差:=(买盘+卖盘);  

STICKLINE((买卖差0),0,买卖差,5,0),COLOR33FF33;  

JX1:=BARSSINCE(买盘);  

JY1:=IF(((121JX1)AND(JX10)),JX1,120);  

JY2:=IF(((4JX1)AND(JX10)),JX1,3);  

VAR30:=MA(VOL,JY2);  

神比:=(买盘/VAR30);  

鬼比:=(卖盘/VAR30);  

VAR2:=(HIGH-LOW);  

VAR3:=ABS((OPEN-CLOSE));  

VAR4:=(HIGH-IF((CLOSEOPEN),CLOSE,OPEN));  

VAR5:=(IF((CLOSEOPEN),OPEN,CLOSE)-LOW);  

VAR6:=((VAR3/VAR2)*VOL);  

VAR7:=((VAR4/VAR2)*VOL);  

VAR8:=((VAR5/VAR2)*VOL);  

VAR9:=IF(((VOL/CAPITAL)0.001),1,EXP(ABS(LOG(((VOL/CAPITAL)*100)))));  

VARA:=(((CLOSE-MA(CLOSE,5))/MA(CLOSE,5))*100);  

VARB:=(((MA(CLOSE,5)MA(CLOSE,10))AND(MA(CLOSE,10)MA(CLOSE,30)))AND(MA(CLOSE,30)MA(CLOSE,60)));VARC:=((MA(CLOSE,5)MA(CLOSE,10))AND(MA(CLOSE,10)MA(CLOSE,30)));  

VARD:=REF(CLOSE,1);  

VARE:=((SMA(MAX((CLOSE-VARD),0),6,1)/SMA(ABS((CLOSE-VARD)),6,1))*100);  

DRAWTEXT(((DATE700101)ANDCROSS(84,VARE)),HIGH,'■卖出'),COLORF2A3A4;  

VAR40:=((IF((((VAR6=VAR7)AND(VAR6=VAR8))AND(CLOSEOPEN)),VAR6,买盘)+买盘)/2);  

VAR41:=((IF(((VAR7VAR6)AND(VAR7VAR8)),VAR7,买盘)+买盘)/2);  

VAR42:=((IF(((VAR8VAR6)AND(VAR8VAR7)),VAR8,买盘)+买盘)/2);  

VAR50:=((IF((((VAR6=VAR7)AND(VAR6=VAR8))AND(CLOSEOPEN)),VAR6,卖盘)+卖盘)/2);  

三日上攻:=MA((((VAR40+VAR41)+VAR42)/3),JY2);  

三日下攻:=MA(VAR50,JY2);  

多头:STICKLINE((CLOSEMA(CLOSE,30)),0,VOL,5,1),COLOR0000FF;  

空头:STICKLINE((CLOSEMA(CLOSE,30)),0,VOL,5,1),COLOR00FF00;  

STICKLINE((((VAR6=VAR7)AND(VAR6=VAR8))AND(CLOSEOPEN)),0,VAR6,4,0),COLOR00FFFF;  

STICKLINE((((VAR6=VAR7)AND(VAR6=VAR8))AND(CLOSEOPEN)),0,VAR6,4,0),COLORFF0000;  

STICKLINE(((VAR8VAR6)AND(VAR8VAR7)),0,VAR8,4,0),COLORFFFFFF;  

STICKLINE(((VAR7VAR6)AND(VAR7VAR8)),0,VAR7,4,0),COLORFF00FF;  

STICKLINE((VOL(MA(VOL,5)*2.5)),0,VOL,2,0);  

STICKLINE((买盘0),买盘,0,2,0),COLOR0000FF;  

上攻均量:=MA(买盘,JY1);  

下攻均量:=MA(卖盘,JY1);  

DRAWTEXT(((((((((VAR7VAR6)AND(VARA2))AND(VAR9VAR8))AND(CLOSEMA(CLOSE,5)))AND(CLOSEMA(CLOSE,30)))AND(HIGHMA(CLOSE,60)))AND(VOLMA(VOL,5)))AND(VAR7=MA(VOL,5))),VOL,'出货');  

DRAWTEXT(((((((VAR8VAR6)AND(VAR8VAR7))AND(VARA(0-2)))AND(CLOSEMA(CLOSE,30)))AND(VAR8(MA(VOL,5)/2)))AND(MA(VOL,5)MA(VOL,10))),VOL,'低进');  

DRAWTEXT((((((VAR6(MA(VOL,5)*2))AND(VAR6=VAR7))AND(VAR6=VAR8))AND(CLOSEOPEN))OR((VOL(MA(VOL,5)*3))ANDVARB)),VOL,'强势');  

hsl:=DYNAINFO(37);  

DRAWTEXT((((VOL/REF((SUM(VOL,5)/5),1))=2)AND(hsl1)),(VOL*1.1),'量变'),COLOR00FFFF;  

MA1:MA(VOL,5),colorwhite;  

MA2:MA(VOL,10),coloryellow;  

MA3:MA(VOL,20),colorff00ff;  

低进:IF(((((((VAR8VAR6)AND(VAR8VAR7))AND(VARA(0-2)))AND(CLOSEMA(CLOSE,30)))AND(VAR8(MA(VOL,5)/2)))AND(MA(VOL,5)MA(VOL,10))),1,0);  

强势:IF((((((VAR6(MA(VOL,5)*2))AND(VAR6=VAR7))AND(VAR6=VAR8))AND(CLOSEOPEN))OR((VOL(MA(VOL,5)*3))ANDVARB)),1,0);  

量变:IF((((VOL/REF((SUM(VOL,5)/5),1))=2)AND(hsl1)),1,0);  

image.png

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