通达信指标公式源码概况:
指标类别: 通达信指标公式
授权方式: 免费版
指标评级: ★★★★★
指标分类: 策略
画线方法: 副图
通达信量化交易系统指标公式源码
X:=C;
X1:=(MA(X,3)+MA(X,5)+MA(X,8)+MA(X,13))/4;
X3:=X1+5*SLOPE( X1, 3);
X4:=EMA(X3,2);
X5:=EMA(X4,2);
X6:=(X3+X4+X5)/3;
X0:=(MA(X6,3)+MA(X6,5)+MA(X6,8)+MA(X6,13))/4;
J1:=X0+3*STD(X0,10);
J2:=X0-3*STD(X0,10);
UO:=MA(X,20);
UO1:=UO + 2*STD(X,20);
UO2:=UO - 2*STD(X,20);
PO1:=(MA(X,3)+MA(X,5)+MA(X,8)+MA(X,13))/4;
PO2:=PO1+3*STD(PO1,10);
PO3:=PO1-3*STD(PO1,10);
C1:=REF(C,1);
C2:=HHV(C1,2);
C3:=LLV(C1,2);
ET:=HHV(C1,2);
ET1:=REF(ET,1);
XB:=LLV(C1,2);
XB1:=REF(XB,1);
M:=BARSLAST(CXB AND C1=XB1);
M1:=REF(M,1);
NN:=BARSLAST(CET AND C1=ET1);
N1:=REF(NN,1);
M2:=BARSLAST(M-NN0 AND M1=N1)+1;
N2:=BARSLAST(NN-M0 AND N1=M1)+1;
ET2:=HHV(ET,M2);
XB2:=LLV(XB,N2);
A:=IF(M-NN0 AND M1=N1,1,IF(NN-M0 AND N1=M1,0,2));
STICKLINE(M-NN0,C,ET2,6,1),COLOR0099FF;
STICKLINE(M-NN0,C,XB2,6,0),COLORCYAN;
STICKLINE(A=1,C,C2,6,1),COLOR0099FF;
STICKLINE(A=1,C2,XB2,6,0),COLORCYAN;
STICKLINE(A=0,C3,C,6,0),COLOR0099FF;
STICKLINE(A=0,C3,ET2,6,1),COLOR0099FF;
OPP1: (J1+UO1)/2,COLORFF9966;
OPP2: (J2+UO2)/2,COLORRED;
OPP3: (OPP1+OPP2)/2,COLOR500500;
长期乖离率:(CLOSE-MA(CLOSE,55))/MA(CLOSE,55)*100,COLORYELLOW,STICK,LINETHICK3;
IF(长期乖离率=0,长期乖离率,0),COLORWHITE,STICK,LINETHICK3;
中期乖离率:(CLOSE-MA(CLOSE,34))/MA(CLOSE,34)*100,COLORFF00FF,STICK,LINETHICK3;
IF(中期乖离率=0,中期乖离率,0),COLORFFFF33,STICK,LINETHICK3;
短期乖离率:(CLOSE-MA(CLOSE,13))/MA(CLOSE,13)*100,COLORRED,STICK,LINETHICK3;
IF(短期乖离率=0,短期乖离率,0),COLORBLUE,STICK,LINETHICK3;
VAR2:=REF(HIGH,1)*1.1;{{昨日最高价*系数}
VAR3:=HIGH*1.1;{当日最高价*系数}
VAR4:=(VAR3*VOL+VAR2*(CAPITAL-VOL))/CAPITAL;
VAR5:=REF(LOW,1)*0.9; {昨日最低价*系数}
VAR6:=LOW*0.9;{当日最低价*系数}
VAR7:=(VAR6*VOL+VAR5*(CAPITAL-VOL))/CAPITAL;
VAR8:=EMA(VAR7,30);{求30日VAR7的移动平均}
VAR9:=EMA(VAR4,30);{求30日VAR4的移动平均}
VAR10:=VAR9-2;
VAR11:=IF(CLOSE=VAR8,VAR10,VAR9);
VAR12:=VAR11*2.5;
VAR13:=VAR10*2.5;
STICKLINE(VAR12=VAR13,中期乖离率,0,4,1),COLOR66FF99;
上通道:MA(短期乖离率,20)+1.618*STD(长期乖离率,20),COLOR0099FF,LINETHICK2;
下通道:MA(短期乖离率,20)-1.618*STD(长期乖离率,20),COLOR0099FF,LINETHICK2;
生命轨迹:短期乖离率,COLOR00FF00;
M1:=5;
M2:=10 ;
M3 := 20;
M4 := 60;
M5:=120 ;
M6 := 250 ;
N := 20 ;
M :=32;
P1 := 80 ;
P2 := 100;
MA5:MA(CLOSE,M1);
MA10:MA(CLOSE,M2);
MA20:MA(CLOSE,M3);
MA60:MA(CLOSE,M4);
MA120:MA(CLOSE,M5);
MA250:MA(CLOSE,M6);
MAA30:MA(C,30),COLORRED;
KS:IF(MA10MAA30,MA10,MAA30),COLORBLUE;
A3:=(C-LLV(L,9))/(HHV(H,9)-LLV(L,9))*100;
A4:=SMA(A3,3,1);
A5:=SMA(A4,3,1);
A6:=3*A4-2*A5;
A7:=C-REF(C,1);
A8:=100*EMA(EMA(A7,6),6)/EMA(EMA(ABS(A7),6),6);
买:=LLV(A8,2)=LLV(A8,7) AND COUNT(A80,2) AND CROSS(A8,MA(A8,2));
DRAWTEXT(FILTER(买=1,5),LOW-0.05, #39;买进 #39;),COLORYELLOW;
STICKLINE(买,OPEN,CLOSE,2,0),COLORYELLOW;
NN:=150;
高11:=REFDATE(HHV(H,NN),DATE);
低11:=REFDATE(LLV(L,NN),DATE);
H11:=高11-(高11-低11)*0.191;
H12:=高11-(高11-低11)*0.382;
H13:=高11-(高11-低11)*0.5;
H14:=高11-(高11-低11)*0.618;
H15:=高11-(高11-低11)*0.809;
DRAWTEXT(CURRBARSCOUNT=1,高11, #39;高 #39;),COLORGREEN;
DRAWTEXT(CURRBARSCOUNT=1,H11, #39;809 #39;),COLORGREEN;
DRAWTEXT(CURRBARSCOUNT=1,H12, #39;618 #39;),COLORGREEN;
DRAWTEXT(CURRBARSCOUNT=1,H13, #39;中 #39;),COLORGREEN;
DRAWTEXT(CURRBARSCOUNT=1,H14, #39;382 #39;),COLORGREEN;
DRAWTEXT(CURRBARSCOUNT=1,H15, #39;191 #39;),COLORGREEN;
DRAWTEXT(CURRBARSCOUNT=1,低11, #39;低 #39;),COLORGREEN;
STICKLINE(CURRBARSCOUNT=13,高11,高11,100,-2),COLORGREEN,LINETHICK2;
STICKLINE(CURRBARSCOUNT=13,H11,H11,100,-1),COLORGREEN,LINETHICK2;
STICKLINE(CURRBARSCOUNT=13,H12,H12,100,-1),COLORGREEN,LINETHICK2;
STICKLINE(CURRBARSCOUNT=13,H13,H13,100,-1),COLORGREEN,LINETHICK2;
STICKLINE(CURRBARSCOUNT=13,H14,H14,100,-1),COLORGREEN,LINETHICK2;
STICKLINE(CURRBARSCOUNT=13,H15,H15,100,-1),COLORGREEN,LINETHICK2;
STICKLINE(CURRBARSCOUNT=13,低11,低11,100,-1),COLORGREEN,LINETHICK2;
N33:=10;
T1:=CONST(HHVBARS(V,N33));
T0:IF(CURRBARSCOUNT=N33+7,CONST(IF(T1=0,C,REF(C,T1))),DRAWNULL);
IF(CURRBARSCOUNT=T1+1,T0,DRAWNULL),COLORMAGENTA;
DRAWTEXT(ISLASTBAR,T0, #39; 平台 #39;);
公式解读:
通达信程序化交易公式var1:0;
Var2:=REF(C,1);
Var3:=SMA(ABS(C-Var2),2,1)/SMA(MAX(C-Var2,0),2,1)*100;
Var4:=EMA(IF(C*1.2,Var3*10,Var3/10),3);
Var5:=HHV(C,18);
Var6:=LLV(C,28);
Var7:=IF(HHV(C,120),1,0);
Var8:=EMA(IF(CVar5,(Var4+Var6*2)/2,0),3)/618*Var7;
VAR9:IF(0-Var8-4,0,0-VAR8);
STICKLINE(0-VAR8,0,VAR9,6,1) , COLORffaaff;
: EMA(CLOSE,7)-EMA(CLOSE,21);
见顶: EMA(黑马,7), COLORSTICK;
Var1:=CLOSE/REF(LLV(LOW,35),5)1;
思考: IF(Var1,0.5,0), STICK;
魔法: IF(TROUGHBARS(3,15,1)=0 AND HIGHLOW+0.01,1,-1);
精灵: IF(PEAKBARS(3,15,1)=1,1,2);
骚动: (EMA(WINNER(CLOSE),7)-EMA(WINNER(CLOSE),35))*5;
争脱: EMA(CLOSE/REF(HHV(CLOSE,7),50),1);
CG:MA(C,21),COLOR00ff00,linethick2;
FL:HHV(CG,3),colorcyan,linethick2;
FS:CG-(FL-CG),colorred,linethick2;
TY:=C;
A1:=REF(TY,10)=HHV(TY,2*10+1); B1:=FILTER(A1,10);
C1:=BACKSET(B1,10+1); HD:=FILTER(C1,10);
A2:=REF(TY,10)=LLV(TY,2*10+1); B2:=FILTER(A2,10);
C2:=BACKSET(B2,10+1); LD:=FILTER(C2,10);
A:=REF(C,BARSLAST(HD));
Z:=REF(L,BARSLAST(LD));
T1:=BARSLAST(HD)BARSLAST(LD) AND NOT(HD) ;
T2:=BARSLAST(HD)BARSLAST(LD) AND NOT(LD);
前期头部:IF(T1,A,A),COLORff00ff,LINETHICK2,POINTDOT;
前期底部:IF(T2,Z,Z),colorwhite,LINETHICK2,POINTDOT;
上收:=C; 上开:=O;上高:=H; 上低:=L;
止赢逃命:MA(REF(HHV(上收,21),1),21),CIRCLEDOT,COLOR00ffff,Linethick0;
全仓杀入:MA(REF(LLV(上收,30),1),21),CIRCLEDOT,colorred ,LINETHICK0 ;
明日提示:EMA(CLOSE,3.5),colorwhite;
STICKLINE(C 全仓杀入 AND C=O,C,O,6,0),COLOR00ffff;
STICKLINE(C止赢逃命 AND CO,C,O,6,0),colorred;
STICKLINE(C全仓杀入 AND C=O,C,O,6,0),COLOR00ffff;
STICKLINE(C 全仓杀入 AND C=O,H,L,2,0),COLOR00ffff;
STICKLINE(C 全仓杀入 AND CO,C,H,1,0),COLOR00ffff;
STICKLINE(C 全仓杀入 AND CO,O,L,3,0),colorred;
STICKLINE(C 全仓杀入 AND C=O,C,L,3,0),COLORff00ff;
STICKLINE(C全仓杀入 AND CO,C,O,6,2),colorred,linethick3;
STICKLINE(C止赢逃命 AND C=O,C,O,6,2),COLOR00ff00,linethick2; STICKLINE(MA(C,60)=REF(MA(C,60),12),MA(C,60),MA(C,60),6,4),COLORff00ff,LINETHICK4;
STICKLINE(MA(C,60)REF(MA(C,62),12),MA(C,60),MA(C,60),6,4),COLOR00ff00,LINETHICK4;
DRAWTEXT(CROSS(明日买卖提示,止赢逃命) ,明日买卖提示-0.1, #39;------追涨 #39;),colorred;
DRAWTEXT(CROSS(止赢逃命,明日买卖提示) ,止赢逃命+0.2, #39;-减仓- #39;),color00ffff;
DRAWTEXT(CROSS(明日买卖提示,全仓杀入) ,明日买卖提示-0.1, #39;买进------- #39;),colorffff00;