通达信指标公式源码概况:
指标类别: 通达信指标公式
授权方式: 免费版
指标评级: ★★★★★
指标分类: 策略
画线方法: 副图
RSV:=(CLOSE-LLV(LOW,7))/(HHV(HIGH,7)-LLV(LOW,7))*100;
短多:SMA(RSV,3,1),COLORRED,LINETHICK1;
短空:SMA(短多,3,1),COLORYELLOW,LINETHICK1;
RSV1:=(CLOSE-LLV(LOW,38))/(HHV(HIGH,38)-LLV(LOW,38))*100;
中多:SMA(RSV1,5,1),COLORFF00FF,LINETHICK1;
中空:SMA(中多,10,1),COLORGREEN,LINETHICK1;
多方风险线:85,COLORBLUE;
空方风险线:18,COLORWHITE;
STICKLINE(短多 短空,短多,短空,1,0),COLORRED;
STICKLINE(短多 =短空,短多,短空,1,0),COLORYELLOW;
STICKLINE(中多 中空,中多,中空,1,0),COLORFF00FF;
STICKLINE(中多 =中空,中多,中空,1,0),COLORGREEN;
N:=23;M:=8;
YYG:=(EMA(C,1)+EMA(C,2)+EMA(C,3)+EMA(C,4))/4;
QQM:=(EMA(C,3)+EMA(C,6)+EMA(C,12)+EMA(C,24))/4;
强弱分区:EMA(EMA((YYG-QQM),30),3)COLOR00FF33,STICK;
STICKLINE(强弱分区 0,强弱分区,0,2,1)COLORRED;
STICKLINE(强弱分区 0,强弱分区,0,2,1)COLOR0080FF;
买盘量:IF((YYG-QQM) =0,(YYG-QQM),0)COLORRED,LINETHICK1,COLORSTICK;
卖盘量:IF((YYG-QQM) 0,(YYG-QQM),0)COLORYELLOW,LINETHICK1,COLORSTICK;
STICKLINE(买盘量 REF(买盘量,1)AND买盘量 0,0,买盘量,0.1,0)COLORYELLOW;
STICKLINE(买盘量 REF(买盘量,1)AND买盘量 0,0,买盘量,0.1,0)COLORCC00CC;
STICKLINE(卖盘量 REF(卖盘量,1)AND卖盘量 0,0,卖盘量,0.1,0)COLORWHITE;
STICKLINE(卖盘量 REF(卖盘量,1)AND卖盘量 0,0,卖盘量,0.1,0)COLORCYAN;
DTM:=IF(OPEN =REF(OPEN,1),0,MAX((HIGH-OPEN),(OPEN-REF(OPEN,1))));
DBM:=IF(OPEN =REF(OPEN,1),0,MAX((OPEN-LOW),(OPEN-REF(OPEN,1))));
STM:=SUM(DTM,N);
SBM:=SUM(DBM,N);
ADTM:IF(STM SBM,(STM-SBM)/STM,IF(STM=SBM,0,(STM-SBM)/SBM)),COLORRED,LINETHICK2;
MAADTM:MA(ADTM,M),COLORBLUE,LINETHICK2;
N:=45;
VAR2:=(CLOSE-LLV(LOW,N))/(HHV(HIGH,N)-LLV(LOW,N))*100;
VAR3:=SMA(VAR2,5,1);
VAR4:=SMA(VAR3,3,1);
个股波:SMA(VAR4,3,1),COLORWHITE,LINETHICK3;
VAR22:=(INDEXC-LLV(INDEXL,N))/(HHV(INDEXH,N)-LLV(INDEXL,N))*100;
VAR33:=SMA(VAR22,5,1);
VAR44:=SMA(VAR33,3,1);
指数波:SMA(VAR44,3,1),COLORRED,LINETHICK5;
AA:=( 399300$CLOSE -LLV( 399300$LOW ,N))/(HHV( 399300$HIGH ,N)-LLV( 399300$LOW ,N))*100;
AA1:=SMA(AA,5,1);
AA2:=SMA(AA1,3,1);
沪深300:SMA(AA2,3,1),COLORMAGENTA,LINETHICK2;
BB:=( 399005$CLOSE -LLV( 399005$LOW ,N))/(HHV( 399005$HIGH ,N)-LLV( 399005$LOW ,N))*100;
BB1:=SMA(BB,5,1);
BB2:=SMA(BB1,3,1);
中小板指:SMA(BB2,3,1),COLORYELLOW,LINETHICK1;
CC:=( 399006$CLOSE -LLV( 399006$LOW ,N))/(HHV( 399006$HIGH ,N)-LLV( 399006$LOW ,N))*100;
CC1:=SMA(CC,5,1);
CC2:=SMA(CC1,3,1);
创业板指:SMA(CC2,3,1),COLORCYAN,LINETHICK1;
DD:=( 399305$CLOSE -LLV( 399305$LOW ,N))/(HHV( 399305$HIGH ,N)-LLV( 399305$LOW ,N))*100;
DD1:=SMA(DD,5,1);
DD2:=SMA(DD1,3,1);
基金:SMA(DD2,3,1),COLORLICYAN,LINETHICK1;
EE:=( 399190$CLOSE -LLV( 399190$LOW ,N))/(HHV( 399190$HIGH ,N)-LLV( 399190$LOW ,N))*100;
EE1:=SMA(EE,5,1);
EE2:=SMA(EE1,3,1);
金融行业:SMA(EE2,3,1),COLORGREEN,LINETHICK2;
FF:=( 399200$CLOSE -LLV( 399200$LOW ,N))/(HHV( 399200$HIGH ,N)-LLV( 399200$LOW ,N))*100;
FF1:=SMA(FF,5,1);
FF2:=SMA(FF1,3,1);
地产:SMA(FF2,3,1),COLORLIGREEN,LINETHICK1;
GG:=( 399110$CLOSE -LLV( 399110$LOW ,N))/(HHV( 399110$HIGH ,N)-LLV( 399110$LOW ,N))*100;
GG1:=SMA(GG,5,1);
GG2:=SMA(GG1,3,1);
农林牧渔:SMA(GG2,3,1),COLORLIGRAY,LINETHICK1;
HH:=( 399941$CLOSE -LLV( 399941$LOW ,N))/(HHV( 399941$HIGH ,N)-LLV( 399941$LOW ,N))*100;
HH1:=SMA(HH,5,1);
HH2:=SMA(HH1,3,1);
新能源:SMA(HH2,3,1),COLORBROWN,LINETHICK1;
II:=( 399137$CLOSE -LLV( 399137$LOW ,N))/(HHV( 399137$HIGH ,N)-LLV( 399137$LOW ,N))*100;
II1:=SMA(II,5,1);
II2:=SMA(II1,3,1);
有色金属:SMA(II2,3,1),COLORLIRED,LINETHICK1;
JJ:=( 399139$CLOSE -LLV( 399139$LOW ,N))/(HHV( 399139$HIGH ,N)-LLV( 399139$LOW ,N))*100;
JJ1:=SMA(JJ,5,1);
JJ2:=SMA(JJ1,3,1);
医药:SMA(JJ2,3,1),COLORLIMAGENTA,LINETHICK1;
A1:MA(C,1),LINETHICK2,COLOR0000FF;
A5:MA(C,5),LINETHICK1,COLORFFFFFF;
A10:EMA(MA(C,10),3),LINETHICK2,COLORFFFFFF;
A20:=MA(C,20),LINETHICK2,COLORFFFF00;
A60:=MA(C,60),LINETHICK2,COLORFF0000;
STICKLINE(A5 A10,A5,A10,1,1),COLOR0000FF;
STICKLINE(A5 =A10,A5,A10,1,1),COLOR00FF00;
SS:IF(A1 A5,A1,DRAWNULL),LINETHICK2,COLOR00FF00;
STICKLINE(A1 A5,A1,A5,1,1),COLOR0000FF;
STICKLINE(A1 =A5,A1,A5,1,0),COLOR00FF00;
买:DRAWICON(CROSS(A1,A5),A5-0.2,1);
卖:DRAWICON(CROSS(A5,A1),A5+0.2,2);
A1:=REF(HIGH,3)=HHV(HIGH,2*3+1);
B1:=FILTER(A1,3);
C1:=BACKSET(B1,3+1);
D1:=FILTER(C1,3);{高点}
A2:=REF(LOW,3)=LLV(LOW,2*3+1);
B2:=FILTER(A2,3);
C2:=BACKSET(B2,3+1);
D2:=FILTER(C2,3);{低点}
E1:=(REF(LLV(LOW,2*3),1)+REF(HHV(HIGH,2*3),1))/2;
E2:=(HIGH+LOW)/2;{高低点出现在同一K线上时可作取舍}
H1:=(D1ANDNOT(D2ANDE1 =E2))ORISLASTBARORBARSCOUNT(CLOSE)=1;
H2:=D1ANDNOT(D2ANDE1 =E2);
L1:=D2ANDNOT(D1ANDE1=E2);
X1:=REF(BARSLAST(H1),1)+1;
F1:=BACKSET(H1ANDCOUNT(L1,X1) 0,LLVBARS(IF(L1,LOW,10000),X1));
G1:=F1 REF(F1,1);
I1:=BACKSET(G1,2);
LD:=I1 REF(I1,1);{过滤后低点}
L2:=LDORISLASTBARORBARSCOUNT(CLOSE)=1;
X2:=REF(BARSLAST(L2),1)+1;
F2:=BACKSET(L2ANDCOUNT(H2,X2) 0,HHVBARS(IF(H2,HIGH,0),X2));
G2:=F2 REF(F2,1);
I2:=BACKSET(G2,2);
HD:=I2 REF(I2,1);{过滤后高点}
J1:=BACKSET(ISLASTBAR,MIN(BARSLAST(HD),BARSLAST(LD))+1);
J2:=J1 REF(J1,1);
A3:=H;B3:=REF(H,REF(BARSLAST(HD),1)+1) REF(H,REF(BARSLAST(HD),1)+2+REF(BARSLAST(HD),REF(BARSLAST(HD),1)+2));
D3:=A3ANDB3ANDHD;
E3:=BACKSET(D3,REF(BARSLAST(HD),1)+2);
HH:=E3 REF(E3,1);{找出全部长期高点}
A4:=L REF(L,REF(BARSLAST(LD),1)+1);
B4:=REF(L,REF(BARSLAST(LD),1)+1);D4:=A4ANDB4ANDLD;E4:=BACKSET(D4,REF(BARSLAST(LD),1)+2);LL:=E4 REF(E4,1);{找出全部长期低点}
DRAWICON(HH,H*1.01,8);
DRAWICON(LL,L*0.999,7);
H3:=HHORISLASTBARORBARSCOUNT(C)=1;{后面进行过滤,方法同前。只是不用考虑高低点出现在同一K线}
X3:=REF(BARSLAST(H3),1)+1;
F3:=BACKSET(H3ANDCOUNT(LL,X3) 0,LLVBARS(IF(LL,L,POW(10,20)),X3));
G3:=F3 REF(F3,1);
I3:=BACKSET(G3,2);
LZ:=I3 REF(I3,1);{长期低点,也可供引用}
L4:=LZORISLASTBARORBARSCOUNT(C)=1;
X4:=REF(BARSLAST(L4),1)+1;
F4:=BACKSET(L4ANDCOUNT(HH,X4) 0,HHVBARS(IF(HH,H,-POW(10,20)),X4));
G4:=F4 REF(F4,1);
I4:=BACKSET(G4,2);
HZ:=I4 REF(I4,1);{长期高点,也可供引用}
K1:=BACKSET(ISLASTBAR,MIN(BARSLAST(HZ),BARSLAST(LZ))+1);
K2:=K1 REF(K1,1);
UU:=BACKSET(ISLASTBAR,BARSLAST(LD)+1);
VV:=UU REF(UU,1);
WW:=BACKSET(VV,REF(BARSLAST(LD),1)+2);
XX:=WW REF(WW,1);
UU2:=BACKSET(ISLASTBAR,BARSLAST(HD)+1);
VV2:=UU2 REF(UU2,1);
WW2:=BACKSET(VV2,REF(BARSLAST(HD),1)+2);
XX2:=WW2 REF(WW2,1);
前一低:REF(L,BARSLAST(VV)),COLOR99FF66,LINETHICK1;
前二低:REF(L,BARSLAST(XX)),COLOR99FF66,LINETHICK1;
前一高:REF(H,BARSLAST(VV2)),COLORCYAN,LINETHICK1;
前二高:REF(H,BARSLAST(XX2)),COLORCYAN,LINETHICK1;
DRAWLINE(XX,L,VV,L,1),COLORMAGENTA,LINETHICK1;
DRAWLINE(XX2,H,VV2,H,1),COLORMAGENTA,LINETHICK1;
DRAWTEXT(CURRBARSCOUNT=5,前一低*0.995, 前一低 ),COLOR99FF66;
DRAWTEXT(CURRBARSCOUNT=5,前二低*0.995, 前二低 ),COLOR99FF66;
DRAWTEXT(CURRBARSCOUNT=1,前一高*1.01, 前一高 ),COLORCYAN;
DRAWTEXT(CURRBARSCOUNT=1,前二高*1.01, 前二高 ),COLORCYAN;