通达信公式源码概况:
指标类别:通达信公式
授权方式: 免费版
指标评级: ★★★★★
指标分类: 策略
画线方法: 副图
VAR1:=REF((LOW+OPEN+CLOSE+HIGH)4,1);
VAR2:=SMA(ABS(LOW-VAR1),13,1)SMA(MAX(LOW-VAR1,0),10,1);
VAR3:=EMA(VAR2,10);
VAR4:=LLV(LOW,33);
VAR5:=EMA(IF(LOW =VAR4,VAR3,0),3);
进场:IF(VAR5 REF(VAR5,1),VAR5,0),COLORRED,NODRAW;
STICKLINE(VAR5 REF(VAR5,1),0,VAR5,3,0),COLORRED;
洗盘:IF(VAR5 REF(VAR5,1),VAR5,0),COLORGREEN,NODRAW;
STICKLINE(VAR5 REF(VAR5,1),0,VAR5,3,0),COLORGREEN;
坐标线:0;20;50;80;100;
龙腾四海:100-100*(HHV(HIGH,5*N)-CLOSE)(HHV(HIGH,5*N)-LLV(LOW,5*N)),colorwhite;
海面:20,colorgreen;
海天分界线:50,coloryellow;
天际:80,colorred;
LOWV:=LLV(LOW,PM);
HIGHV:=HHV(HIGH,PM);
RSV:=EMA((CLOSE-LOWV)(HIGHV-LOWV)*100,3);
K:EMA(RSV,3);
D:MA(K,3);
多日滞后K值
AK1:=REF(K,PD);
AK2:=REF(K,(PD+1));
AK3:=REF(K,(PD+2));
AK4:=REF(K,(PD+3));
买入条件1:K指标值
BUY1:(AK1-AK2+50+KATC);
计算,判断上行趋势
AMT:=MA(CLOSE,PT);
多日滞后趋势均线
AT1:=REF(AMT,PD);
AT2:=REF(AMT,(PD+1));
买入条件2:趋势均线
BUY2:(AT1-AT2)AT2;
均线计算,判断上行趋势
AMH:=MA(CLOSE,PH);
多日滞后趋势均线
AH1:=REF(AMH,PD);
AH2:=REF(AMH,(PD+1));
买入条件2:趋势均线
BUY3:(AH1-AH2)AH2;
上述三个买入条件的标志
ASP=100;
STICKLINE(BUY1 (50+KATC),ASP,ASP+5,1,0),colorred,Linethick2;
STICKLINE(BUY1 (50+KATC),ASP,ASP+5,1,0),colorgreen,Linethick2;
STICKLINE(BUY2 0,ASP+5,ASP+10,1,0),colorblue,Linethick2;
STICKLINE(BUY3 0,ASP+10,ASP+10+BUY3*1000,1,0),coloryellow,Linethick2;
结合在KD图形中的标志
STICKLINE(K D,50,50+K-D,2,0),colorred;
STICKLINE(D K,50-(D-K),50,2,0),colorgreen;
顶部和底部区域划分线
顶区域:TOP,colorgreen;
中轴线:50,colorred;
底区域:BOTTOM,coloryellow;
DRAWICON(CROSS(K,D)ANDK =50,12,11),colorred;
DRAWICON(CROSS(D,K)ANDK =80,88,4),colorgreen;
A1:=BARSLAST(REF(CROSS(K,D),1));
底:REF(CLOSE,A1+1) CLOSEANDK REF(K,A1+1)ANDCROSS(K,D);
DRAWLINE(A1=0,D,底背离,D,0),colorred,LINETHICK1;
A2:=BARSLAST(REF(CROSS(D,K),1));
顶背离:REF(CLOSE,A2+1) CLOSEANDREF(D,A2+1) DANDCROSS(D,K);
DRAWLINE(A2=0,D,顶背离,D,0),colorgreen,LINETHICK1;
DRAWTEXT(底背离 0,D-5, 加仓 ),colorred;
DRAWTEXT(顶背离 0,D-5, 减仓 ),colorgreen;
DRAWTEXT(CROSS(K,D)AND(D 8),30, 买 ),colorred;
STICKLINE(CROSS(K,D)AND(D 8)=1,3,20,8,0),colorred;
DRAWTEXT(CROSS(D,K)AND(D 85),70, 卖 ),colorgreen;
STICKLINE(CROSS(D,K)AND(D 85)=1,85,70,8,0),colorgreen
MACD
AMK:=1000;
DIFF:=(EMA(CLOSE,9)-EMA(CLOSE,17))*AMKCLOSE;
DEA:=EMA(DIFF,8),colorred;
MACD:=(DIFF-DEA);
STICKLINE(MACD =0,MACD,0,4,1),colorred;
STICKLINE(MACD 0,MACD,0,4,1),colorgreen;
STICKLINE(MACD REF(MACD,1)ANDMACD 0,0,MACD,4,0),coloryellow;
STICKLINE(MACD REF(MACD,1)ANDMACD 0,0,MACD,4,0),colormagenta;
X1:IF(diff 0,diff,0),COLOR0000FF,LINETHICK2;
X2:IF(diff 0,0,diff),colormagenta,LINETHICK1;
X3:IF(diff dea,diff,dea),COLOR00ff00,linethick1;
X4:IF(diff dea,dea,dea),linethick1,COLORffbb11;
低位:=CROSS(DIFF,DEA)ANDDIFF -0.1;
STICKLINE(低位金叉,DEA*0.86,DEA*0.66,6,0),coloryellow;
DRAWTEXT(低位金叉,dea*0.86, 低位金叉 ),coloryellow;
JCCOUNT:=COUNT(CROSS(DIFF,DEA),BARSLAST(DEA =0));
二次金叉:=CROSS(DIFF,DEA)ANDDEA 0ANDCOUNT(JCCOUNT=2,21)=1;
STICKLINE(二次金叉,DEA*0.96,DEA*0.76,6,0),ColorFF00FF;
DRAWICON(二次金叉,dea*1.1, BUY
DRAWTEXT(二次金叉,DEA*0.96, 二次金叉 ),ColorFF00FF;
A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));
底背离:=REF(CLOSE,A1+1) CLOSEANDDIFF REF(DIFF,A1+1)ANDCROSS(DIFF,DEA);
STICKLINE(底背离,DEA*1.09,DEA*0.86,6,0),Color00FF00;
DRAWLINE(A1=0,DEA,底背离,DEA,0),colorred,linethick1;
DRAWTEXT(底背离,DEA*1.09, 底背离 ),Color6600FF;
A2:=BARSLAST(REF(CROSS(DEA,DIFF),1));
顶背离:=REF(CLOSE,A2+1) CLOSEANDREF(DIFF,A2+1) DIFFANDCROSS(DEA,DIFF);
DRAWLINE(A2=0,DEA,顶背离,DEA,0),colorgreen,linethick1;
DRAWTEXT(顶背离,DEA*1.2, 顶背离 ),Color00FF00;
VR
LC:=REF(CLOSE,1);
AVR:SUM(IF(CLOSE LC,VOL,0),M1)SUM(IF(CLOSE =LC,VOL,0),M1)*20,colorred,Linethick2;
MA5:=MA(C,5);
MA21:=MA(C,21);
MA5 MA21ANDO MA5ANDC MA21ANDVREF(V,1) 3;
左侧交易与右侧交易的过程以及成败
公式解读:
编写条件:
KDJ指标距今最近金叉时的公式。
编写方法:
REF(V/FINANCE(7)*10000,BArslAst(crOSS( kdj.K , kdJ.D )));