通达信公式源码概况:
指标类别:通达信公式
授权方式: 免费版
指标评级: ★★★★★
指标分类: 策略
画线方法: 副图
一、通达信倍量柱三合一指标公式
DIFIF1:(EMA(CLOSE,12)-EMA(CLOSE,26))*100/EMA(CLOSE,26);DEAEA1:EMA(DIFIF1,9);MACD1:=2*(DIFIF1-DEAEA1),STICK;MACD2:=EMA(MACD1,3);STICKLINE(MACD1>MACD2ANDMACD1>0,0,MACD1,0,0),COLORRED;STICKLINE(MACD1>MACD2ANDMACD1<0,0,MACD1,0,0),COLORGREEN;STICKLINE(MACD1<MACD2,0,MACD1,0,0),COLORCBCBC0;STICKLINE(MACD1>=0ORMACD1<=0,0,0,50,1),COLORWHITE;MACD:MACD1,NODRAW,COLORMAGENTA;强:IF(DIFIF1>=DEAEA1,DIFIF1,DRAWNULL),COLORRED;弱:IF(DEAEA1>=DIFIF1,DEAEA1,DRAWNULL),COLORFF9900;DRAWICON(CROSS(DIFIF1,DEAEA1),DIFIF1+0.1,1);DRAWICON(CROSS(DEAEA1,DIFIF1),0.4,2);A1:=BARSLAST(REF(CROSS("MACD.DIF","MACD.DEA"),1));B1:=REF(C,A1+1)>CANDREF("MACD.DIF",A1+1)<"MACD.DIF"ANDCROSS("MACD.DIF","MACD.DEA");DRAWTEXT(B1>0,-0.8,'MACD底背'),COLORFF00FF;A2:=BARSLAST(REF(CROSS("KDJ.K","KDJ.D"),1));B2:=REF(C,A2+1)>CANDREF("KDJ.K",A2+1)<"KDJ.K"ANDCROSS("KDJ.K","KDJ.D");DRAWTEXT(B2,-0.6,'KDJ底离'),COLORYELLOW;{KDJ底背离};A3:=BARSLAST(REF(CROSS("RSI.RSI1","RSI.RSI2"),1));B3:=REF(C,A3+1)>CANDREF("RSI.RSI1",A3+1)<"RSI.RSI1"ANDCROSS("RSI.RSI1","RSI.RSI2");DRAWTEXT(B3>0,-0.3,'RSI底离'),COLORCYAN;{RSI底背离};C1:=BARSLAST(REF(CROSS("MACD.DEA","MACD.DIF"),1));D1:=REF(C,C1+1)<CANDREF("MACD.DIF",C1+1)>"MACD.DIF"ANDCROSS("MACD.DEA","MACD.DIF");DRAWTEXT(D1>0,0.4,'MACD顶离'),COLORBLUE;{MACD顶背离}C2:=BARSLAST(REF(CROSS("KDJ.D","KDJ.K"),1));D2:=REF(C,C2+1)<CANDREF("KDJ.K",C2+1)>"KDJ.K"ANDCROSS("KDJ.D","KDJ.K");DRAWTEXT(D2>0,0.6,'KDJ顶离'),COLORLIMAGENTA;{KDJ顶背离}C3:=BARSLAST(REF(CROSS("RSI.RSI2","RSI.RSI1"),1));D3:=REF(C,C3+1)<CANDREF("RSI.RSI1",C3+1)>"RSI.RSI1"ANDCROSS("RSI.RSI2","RSI.RSI1");DRAWTEXT(D3>0,0.8,'RSI顶离'),COLORGREEN;{RSI顶背离};DD:=C=HHV(C,180);EE:=DEAEA1<REF(DEAEA1,1)ANDREF(DEAEA1<REF(DEAEA1,1),1)=1;CC:=C>REF(C,1)ANDREF(C>REF(C,1),1)=1;上升背离:(CCANDEE)*DEAEA1,COLOR00FFFF;顶背离:(DDANDEEANDDEAEA1<HHV(DEAEA1,180))*DEAEA1,STICK,LINETHICK3,COLORGREEN;FF:=C=LLV(C,180);GG:=DEAEA1>REF(DEAEA1,1)ANDREF(DEAEA1>REF(DEAEA1,1),1)=1;LL:=C<REF(C,1)ANDREF(C<REF(C,1),1)=1;下降背离:(LLANDGG)*DEAEA1,COLORMAGENTA;底背离:(FFANDGGANDDEAEA1>LLV(DEAEA1,180))*DEAEA1,STICK,LINETHICK3,COLORRED;SHORT:=12;LONG:=26;MID:=9;DIF:=EMA(CLOSE,SHORT)-EMA(CLOSE,LONG);DEA:=EMA(DIF,MID);MACD9:=(DIF-DEA)*2;AK1:=DIF<0ANDDEA<0;AK2:=AK1!=REF(AK1,1)ANDAK1;AK3:=COUNT(CROSS(DIF,DEA),BARSLAST(AK2))=1ANDCROSS(DIF,DEA)ANDAK1;AK4:=COUNT(CROSS(DIF,DEA),BARSLAST(AK2))=2ANDCROSS(DIF,DEA)ANDAK1;AK5:=REF(DIF,BARSLAST(AK3))<=REF(DIF,BARSLAST(AK4));零下二金:AK4ANDAK5,LINETHICK2,COLOR38B0DE;BC1:=DIF>0ANDDEA>0;BC2:=BC1!=REF(BC1,1)ANDB1;BC3:=COUNT(CROSS(DIF,DEA),BARSLAST(BC2))=1ANDCROSS(DIF,DEA)ANDBC1;BC4:=COUNT(CROSS(DIF,DEA),BARSLAST(BC2))=2ANDCROSS(DIF,DEA)ANDBC1;BC5:=REF(DIF,BARSLAST(BC3))<=REF(DIF,BARSLAST(BC4));零上二金:BC4ANDBC5,LINETHICK2;T:=BARSLAST(CROSS(DIFIF1,DEAEA1)ANDDIFIF1<0);T1:=SUMBARS(T=0,2);T2:=SUMBARS(T=0,3);M:=BARSLAST(CROSS(0,MACD1));M1:=SUMBARS(M=0,2);M2:=SUMBARS(M=0,3);DA1:=REF(DIFIF1,BARSLAST(DIFIF1=LLV(DIFIF1,M+1)));DA2:=REF(DA1,T1-1);DA3:=REF(DA2,T1-1);LT:=BARSLAST(L=LLV(L,M+1));MT:=BARSLAST(DIFIF1=LLV(DIFIF1,M+1));L1:=REF(L,LT);L2:=REF(L1,T1-1);L3:=REF(L2,T1-1);XG:=T=0ANDL1<L2ANDL2<L3ANDDA1>DA2ANDDA2>DA3;
短趋势:((3*SMA((CLOSE-LLV(LOW,27))/(HHV(HIGH,27)-LLV(LOW,27))*100,5,1)-2*SMA(SMA((CLOSE-LLV(LOW,27))/(HHV(HIGH,27)-LLV(LOW,27))*100,5,1),3,1)-50)*1.032+50),colorred;
VAR12:=(2*CLOSE+HIGH+LOW+OPEN)/5;
VAR13:=LLV(LOW,34);
VAR14:=HHV(HIGH,34);
VAR15:=HHV(HIGH,90);
长趋势:EMA((VAR12-VAR13)/(VAR14-VAR13)*100,13),coloryellow;
VAR16:=CROSS(短趋势,长趋势)AND长趋势<25;
AB:=REF(长趋势,20);
BB:=REF(CLOSE,30);
VAR1:=HHV(HIGH,9)-LLV(LOW,9);
VAR2:=HHV(HIGH,9)-CLOSE;
VAR3:=CLOSE-LLV(LOW,9);
VAR4:=((VAR2)/(VAR1))*(100)-70;
VAR5:=((CLOSE-LLV(LOW,60))/(HHV(HIGH,60)-LLV(LOW,60)))*(100);
VAR6:=((2)*(CLOSE)+HIGH+LOW)/(4);
VAR7:=SMA(((VAR3)/(VAR1))*(100),3,1);
VAR8:=LLV(LOW,34);
VAR9:=SMA(VAR7,3,1)-SMA(VAR4,9,1);
VAR10:=IF((VAR9>100),VAR9-100,0);
VAR11:=HHV(HIGH,34);
B1:=EMA(((VAR6-VAR8)/(VAR11-VAR8))*(100),8);
主力持仓:EMA(B1,13),POINTDOT,colorred;
STICKLINE(B1-主力持仓>0,B1,主力持仓,6,0),COLOR0000FF;
STICKLINE(B1-主力持仓<0,B1,主力持仓,6,0),COLOR00FF00;
STICKLINE(VAR16,0,25,3,0),colorred;
判断底:SQRT(SQRT(SQRT(MA(1/(CLOSE/VAR1)*100,4)/10000)))*5;
底部:STICKLINE(短趋势<10AND判断底>0,0,5,6,1);
DRAWICON(VAR16AND判断底>0,60,1);
DRAWTEXT(COUNT(短趋势<10AND判断底>0,8)ANDVAR16,50,'买');
Lb=V/REF(ma(vol,5),1);
量比:Lb;
超倍量=BETWEEN(lb,5,30);
加倍量=BETWEEN(lb,3,5);
倍量=BETWEEN(lb,2,3);
M5:MA(VOL,5),LINETHICK1,colorblue;
M20:MA(VOL,20),LINETHICK1,colorred;
M60:MA(VOL,60),LINETHICK1,colormagenta;
stICKLINE(CLOSE<OOR(CLOSE==OPENANDCLOSE<CLOSE[1]),0,VOL,8,0),colorgreen;
STICKLINE(CLOSE>OOR(CLOSE==OPENANDCLOSE>=CLOSE[1]),0,VOL,8,1),colorred;
STICKLINE(超倍量,0,V,8,0),colorlimagenta;
STICKLINE(加倍量,0,V,8,0),coloryellow;
STICKLINE(倍量,0,VOL,8,0),colorred;
L1:=6;
BIAS:(CLOSE-MA(CLOSE,L1))/MA(CLOSE,L1)*100,NODRAW,COLORWHITE;
STICKLINE(BIAS,0,BIAS,2,0),COLORLIGRAY;
STICKLINE(BIAS>=0ANDBIAS<3,0,BIAS,2,0),COLORLIGRAY;
STICKLINE(BIAS>=3ANDBIAS<5,0,BIAS,2,0),COLORRED;
STICKLINE(BIAS>=5ANDBIAS<8,0,BIAS,2,0),COLORLIRED;
STICKLINE(BIAS>=8ANDBIAS<11,0,BIAS,2,0),COLORYELLOW;
STICKLINE(BIAS<=0ANDBIAS<-5,0,BIAS,2,0),COLORGRAY;
STICKLINE(BIAS<=-8,0,BIAS,2,0),COLORMAGENTA;
[源码注释]通达信公式动态翻译结果
输出XG:最低价<收盘价的250日简单移动平均 AND 收盘价>收盘价的250日简单移动平均
每日通达信公式解答:
编写要求:
5,10,20,30,60日多头排列的选股公式。
公式在线网解答:
XG:MA(C,5)>MA(C,10)ANDMA(C,10)>MA(C,20)ANDMA(C,20)>MA(C,30)ANDMA(C,30)>MA(C,60);
评论(0)