通达信公式源码概况:
指标类别:通达信公式
授权方式: 免费版
指标评级: ★★★★★
指标分类: 策略
画线方法: 副图
白色:SMA(HIGH,21,2)*1.05,COLORWHITE;
黄色:SMA(LOW,21,2)*0.95,COLORYELLOW;
粉色:SMA(LOW,5,1),COLORMAGENTA;
绿色:SMA(CLOSE,2,1),COLORGREEN;
买入:IF(CROSS(绿色,粉色),白色*1.05,粉色),,COLORMAGENTA;
虎虎:IF(CROSS(绿色,白色),白色*1.10,黄色),,COLORYELLOW;
STICKLINE((CLOSE-REF(CLOSE,1))REF(CLOSE,1) =比例,REF(CLOSE,1),CLOSE,1,0),coloryellow,Linethick3;
STICKLINE((REF(CLOSE,1)-CLOSE)REF(CLOSE,1) =涨停比例,REF(CLOSE,1),CLOSE,1,0),colorblue,Linethick3;
分析
AVOL_RISE:=IF(CLOSE OPEN,VOL,0);
AVOL_FALL:=IF(CLOSE OPEN,VOL,0);
RVOL_SUM:MA(SUM(AVOL_RISE,DAYS)MA(VOL,DAYS)*CLOSEDAYS+CLOSE2,4),colorred,LINETHICK2;
FVOL_SUM:MA(SUM(AVOL_FALL,DAYS)MA(VOL,DAYS)*CLOSEDAYS+CLOSE2,4),colorgreen,LINETHICK2;
成交均价分析
RAM:=IF(CLOSE =REF(CLOSE,1),AMOUNT,0);
FAM:=IF(CLOSE REF(CLOSE,1),AMOUNT,0);
RVOL:=IF(CLOSE =REF(CLOSE,1),VOL,0);
FVOL:=IF(CLOSE REF(CLOSE,1),VOL,0);
升:=SUM(RAM,TT)SUM(RVOL,TT),colorred,LINETHICK2;
跌成本:=SUM(FAM,TT)SUM(FVOL,TT),colorgreen,LINETHICK2;
*****成本
TT:=BARSCOUNT(C);
TT:=FROMOPEN;
T1:=20;
CB:=SUM(AMOUNT,TT)SUM(VOL,TT),colorblue,LINETHICK5;
CB20:=SUM(AMOUNT,T1)SUM(VOL,T1),coloryellow,LINETHICK3;
*****涨跌停统计,强势逻辑
RDAY:=COUNT(CLOSE REF(CLOSE,1)*1.095,20);
FDAY:=COUNT(CLOSE REF(CLOSE,1)*0.905,20);
STICKLINE(1,0,RDAY,1,0),colorred;
STICKLINE(1,0,-FDAY,1,0),colorgreen;
STICKLINE(MINUTE==59ANDHOUR==14,0,CLOSE,1,0),colorligray;
CBZL:(CB2-REF(CB2,1))REF(CB2,1)*500;
GJZL:(CLOSE-REF(CLOSE,1))REF(CLOSE,1)*500;
*****涨跌成本对比
:=MA(CLOSE,N3),coloryellow,LINETHICK3;
STICKLINE(成本1 均线,均线,成本1,2,0),colorred;
STICKLINE(成本1 均线,均线,成本1,2,0),colorgreen;
STICKLINE(升成本 跌成本,成本,(升成本-跌成本)*2+成本,2,0),colorred;
STICKLINE(升成本 跌成本,成本,(升成本-跌成本)*2+成本,2,0),colorgreen;
IF(k =0)
RETURN0;
MA$1:MA(CLOSE,N1),colorwhite,LINETHICK1;
IF(k =1)
RETURN0;
MA$2:MA(CLOSE,N2),coloryellow,LINETHICK1;
IF(k =2)
RETURN0;
MA$3:MA(CLOSE,N3),colormagenta,LINETHICK1;
IF(k =3)
RETURN0;
MA$4:MA(CLOSE,N4),colorgreen,LINETHICK1;
IF(k =4)
RETURN0;
MA$5:MA(CLOSE,N5),colorcyan,LINETHICK1;
IF(k =5)
RETURN0;
MA$6:MA(CLOSE,N6);
IF(k =6)
RETURN0;
MA$7:MA(CLOSE,N7);
IF(k =7)
RETURN0;
MA$8:MA(CLOSE,N8);
主升浪:120,coloryellow;
AMH:=MA(CLOSE,PH);均线龙头值
AMS:=MA(CLOSE,10);
AH1:=REF(AMH,0);
AH2:=REF(AMH,1);
AM1:=REF(AMS,0);
AM2:=REF(AMS,1);
BUY3:=(AH1-AH2)AH2;均线速度
BUY31:=REF(BUY3,1);
BUY4:=(AM1-AM2)AM2;
KDJ
LOWV:=LLV(LOW,PM);
HIGHV:=HHV(HIGH,PM);
PN:=3;
RSV:=EMA((CLOSE-LOWV)(HIGHV-LOWV)*100,PN);
K:EMA(RSV,PN),colorwhite,LINETHICK2;
D:MA(K,PN),colorgray,LINETHICK1;
AK1:=REF(K,PD);
AK2:=REF(K,PD+1);
AK3:=REF(K,PD+2);
tj: jxm30.tj ()#minute60;
DPTJ:INDEXDATA( 1A0001 , amp;XGDPVM.tj)#day;
买入条件1:K指标值
BUY1:((AK1-AK2)*2+50);
BUY11:=REF(BUY1,1);
BUY12:=REF(BUY1,2);
STICKLINE(BUY1 50,50,BUY1,2,0),colorred,Linethick1;结合在KD图形中的标志
STICKLINE(BUY1 50,BUY1,50,2,0),colorgreen,Linethick1;
准备撤退
DRAWICON(BUY1 50ANDBUY1 BUY11ANDBUY11 BUY12,BUY1,2);
准备进攻
DRAWICON(BUY1 50ANDBUY1 BUY11ANDBUY11 BUY12,BUY1,1);
均线计算,判断上行趋势
AMT:=MA(CLOSE,PT);
.12269
AMK:=500;
DIFF:=(EMA(CLOSE,4)-EMA(CLOSE,20))*AMKCLOSE;
DEA:=EMA(DIFF,8),colorred;
MACD:=(DIFF-DEA);
STICKLINE(MACD =0,MACD,0,2,0),colorred;MACD指标指示
STICKLINE(MACD 0,MACD,0,2,0),colorgreen;
STICKLINE(MACD REF(MACD,1)ANDMACD 0,0,MACD,2,0),coloryellow;
STICKLINE(MACD REF(MACD,1)ANDMACD 0,0,MACD,2,0),colormagenta;
建仓指标
ASP:=100;
STICKLINE(BUY1 =50,ASP,ASP+10,2,0),colorred;SKDJ建仓信号
STICKLINE(BUY1 50,ASP,ASP+10,2,0),colorgreen;
STICKLINE(BUY3 =0,ASP+10,ASP+10+BUY3*1000,2,0),colorwhite;
STICKLINE(BUY3 0,ASP,ASP+BUY3*1000,2,0),colorblue;
HTIME:=HOUR;
MTIME:=MINUTE;
BUYTIME:IF(AK1 AK2ANDHTIME==15,ASP+5,ASP),coloryellow,LINETHICK2;
SELLTIME:IF(AK1 AK2ANDAK2 AK3,ASP+5,ASP+10),coloryellow,LINETHICK2;
顶部和底部区域划分线
顶区域:TOP,colorgreen;
中轴线:50,colorred,LINETHICK2;
底区域:BOTTOM,coloryellow;
RSV:=(CLOSE-LLV(LOW,9))(HHV(HIGH,9)-LLV(LOW,9))*100;
K:=SMA(RSV,3,1),COLORWHITE;
D:=SMA(K,3,1),COLORYELLOW;
J:=3*K-2*D,COLORFF00FF;
A:=250;
DIFF:=(EMA(CLOSE,12)-EMA(CLOSE,26));
DEA:=EMA(DIFF,9),COLORBLUE,LINETHICK0;
MACD:=2*(DIFF-DEA);
MM:=IF(MACD 0,MACD,0);
JJ:=MM REF(MM,1);
ZZ:=REF(JJ,1)=1;
准备:=(JJANDZZ)*DEA;
STICKLINE(准备=DEA,1,-1,2,1),COLORFFFF00;
JH:=HHV(MAX(K,MAX(D,J)),A);
DH:=HHV(MAX(DIFF,DEA),A);
SH:=INTPART(JHDH)2;
DIFF50:=SH*DIFF+50,COLORFFFF00;
DEA50:=SH*DEA+50,COLORBLUE;
STICKLINE(DIFF50 DEA50,0,1.5*(DIFF50-DEA50),0,0),COLORRED;
STICKLINE(DIFF50 DEA50,0,1.5*(DIFF50-DEA50),0,0),COLORFFFF00;
红柱:IF(1.5*(DIFF50-DEA50) REF(1.5*(DIFF50-DEA50),1),1.5*(DIFF50-DEA50),0),
STICK,COLORLICYAN;
绿柱:IF(1.5*(DIFF50-DEA50) REF(1.5*(DIFF50-DEA50),1),
1.5*(DIFF50-DEA50),0),STICK,COLORGREEN;
缩头:=IF(1.5*(DIFF50-DEA50) 0ANDREF(1.5*(DIFF50-DEA50),1) REF(1.5*(DIFF50-DEA50),2)AND1.5*(DIFF50-DEA50) REF(1.5*(DIFF50-DEA50),1),1,0);
缩脚:=IF(1.5*(DIFF50-DEA50) 0ANDREF(1.5*(DIFF50-DEA50),1) REF(1.5*(DIFF50-DEA50),2)AND1.5*(DIFF50-DEA50) REF(1.5*(DIFF50-DEA50),1),1,0);
杀多:=IF(1.5*(DIFF50-DEA50) 0ANDREF(1.5*(DIFF50-DEA50),1) REF(1.5*(DIFF50-DEA50),2)AND1.5*(DIFF50-DEA50) REF(1.5*(DIFF50-DEA50),1),1,0);
诱空:=IF(1.5*(DIFF50-DEA50) 0ANDREF(1.5*(DIFF50-DEA50),1) REF(1.5*(DIFF50-DEA50),2)AND1.5*(DIFF50-DEA50) REF(1.5*(DIFF50-DEA50),1),1,0);
公式解读:
编写条件:
MACD的DIF线创30日新高的选股公式。
编写方法:
XG: macd.DIF =HHV( MacD.DIF ,30);