通达信指标公式源码概况:
指标类别: 通达信指标公式
授权方式: 免费版
指标评级: ★★★★★
指标分类: 策略
画线方法: 副图
一、庄家顶底指标公式
STICKLINE(C>0,90,95,10,0),COLOR408000;
STICKLINE(C>0,10,5,10,0),COLOR408000;
HDY:=EMA(100*(C-LLV(LOW,34))/(HHV(H,34)-LLV(LOW,34)),3);
DRAWBAND(HDY,RGB(255,000,139),10,RGB(255,255,71));
STICKLINE(HDY>90,100,98,2,1),COLORLIGREEN;
STICKLINE(HDY>95,100,98,2,0),COLORGREEN;
STICKLINE(HDY<10,0,2,2,1),COLORLIRED;
STICKLINE(HDY<5,0,2,2,0),COLORRED;
STICKLINE(C>0,90,10,10,0),COLOR000000;
风险值:HDY,COLORCYAN,LINETHICK2;
超高位区:=风险值>=95,COLORGREEN,NODRAW;
高位区:=风险值<95AND风险值>90,COLORLIGREEN,NODRAW;
低位区:=风险值<10AND风险值>5,COLORLIRED,NODRAW;
超低位区:=风险值<=5,COLORGREEN,NODRAW;
底背离:IF(C<REF(C,1)AND风险值>REF(风险值,1)AND风险值
<15,1,0),COLORMAGENTA,NODRAW;
STICKLINE(底背离,0,-2,2,0),COLORMAGENTA;
顶背离:IF(C>REF(C,1)AND风险值<REF(风险值,1)AND风险值>85,1,0),COLORBLUE,NODRAW;
STICKLINE(顶背离,100,102,2,0),COLORBLUE;
A:=风险值/REF(风险值,1)-1;
B:=风险值/REF(风险值,2)-1;
高位变盘:A>=-0.035ANDA<=0.035AND风险值>50{AND风险值
<70},NODRAW;
STICKLINE(高位变盘,50,52,2,0),COLORRED;
低位变盘:A>=-0.035ANDA<=0.035AND风险值<50{AND风险值>30},NODRAW;
STICKLINE(低位变盘,50,48,2,0),COLORGREEN;
危险:=高位变盘ANDC<REF(C,1);
STICKLINE(危险,52,53,1.6,0),COLORMAGENTA;
STICKLINE(危险,53,54,1.2,0),COLORMAGENTA;
STICKLINE(危险,54,55,0.8,0),COLORMAGENTA;
STICKLINE(危险,55,56,0.4,0),COLORMAGENTA;
STICKLINE(危险,56,57,0.2,0),COLORMAGENTA;
STICKLINE(危险,57,58,0.05,0),COLORMAGENTA;
A1:=CROSS(风险值,20)ANDCROSS(风险值,35);
A2:=CROSS(风险值,35)ANDCROSS(风险值,50);
A3:=CROSS(风险值,50)ANDCROSS(风险值,65);
A4:=CROSS(风险值,65)ANDCROSS(风险值,80);
急拉:=A1ORA2ORA3ORA4;
DRAWTEXT(急拉,风险值,'↑急拉,注意'),COLORRED;
A5:=CROSS(20,风险值)ANDCROSS(35,风险值);
A6:=CROSS(35,风险值)ANDCROSS(50,风险值);
A7:=CROSS(50,风险值)ANDCROSS(65,风险值);
A8:=CROSS(65,风险值)ANDCROSS(80,风险值);
重挫:=A5ORA6ORA7ORA8;
DRAWTEXT(重挫,风险值,'↓重挫,注意'),COLORYELLOW;
中轴线:50,COLORRED,DOTLINE;
DRAWTEXT(ISLASTBAR,100,'超高位区'),COLORMAGENTA;
DRAWTEXT(ISLASTBAR,95,'高位区'),COLORLIMAGENTA;
DRAWTEXT(ISLASTBAR,88,'高缓冲区'),COLORLIRED;
DRAWTEXT(ISLASTBAR,82.5,'80风险线'),COLORRED;
DRAWTEXT(ISLASTBAR,52.5,'50中轴线'),COLORWHITE;
DRAWTEXT(ISLASTBAR,22.5,'20安全线'),COLORGREEN;
DRAWTEXT(ISLASTBAR,10,'低位区'),COLORLIGREEN;
DRAWTEXT(ISLASTBAR,5,'超低位区'),COLORLIBLUE;
DRAWTEXT(ISLASTBAR,18,'低缓冲区'),COLORBLUE;
DRAWICON(CROSS(风险值,50),50,1);
火焰山底:
EMA(IF(LOW<=VARE,(VARD+VARF*2)/2,0),3)/618*VAR10,COLORYEL
LOW;
今量:=火焰山底;
stICKLINE(火焰山底>0,0,今量*1.2,3,0),COLOR00EEFF;
STICKLINE(火焰山底>0,0,今量*0.8,3,0),COLOR00BBFF;
VAR6:=(2*CLOSE+HIGH+LOW)/4;
VAR8:=LLV(LOW,35);
VARB:=HHV(HIGH,35);
BB:=EMA((VAR6-VAR8)/(VARB-VAR8)*100,9);
金盆聚宝指标:EMA(0.667*REF(BB,1)+0.333*BB,2);
GC1:BB,POINTDOT,COLOR0000A8;
RSV1:=(CLOSE-LLV(LOW,35))/(HHV(HIGH,35)-LLV(LOW,35))*100;
K1:=SMA(RSV1,13,1);
D1:=SMA(K1,13,1);
GC2:EMA(D1,3),POINTDOT,COLORYELLOW;
STICKLINE((BB-金盆聚宝指标>0),BB,金盆聚宝指标,6,0),COLOR0000A8;
STICKLINE((BB-金盆聚宝指标>0),BB,金盆聚宝指标,5,0),COLOR0000C0;
STICKLINE((BB-金盆聚宝指标>0),BB,金盆聚宝指标,4,0),COLOR0000E0;
STICKLINE((BB-金盆聚宝指标>0),BB,金盆聚宝指标,3,0),COLOR0000F0;
STICKLINE((BB-金盆聚宝指标>0),BB,金盆聚宝指标,2,0),COLOR0000D0;
STICKLINE((BB-金盆聚宝指标>0),BB,金盆聚宝指标,1,0),COLOR8080FF;
STICKLINE((BB-金盆聚宝指标<0),BB,金盆聚宝指标,6,0),COLORFFFFFF;
STICKLINE((BB-金盆聚宝指标<0),BB,金盆聚宝指标,5,0),COLORFFFFFF;
STICKLINE((BB-金盆聚宝指标<0),BB,金盆聚宝指标,4,0),COLORFFFFFF;
STICKLINE((BB-金盆聚宝指标<0),BB,金盆聚宝指标,3,0),COLORFFFFFF;
STICKLINE(EMA(D1,3)>REF(EMA(D1,3),1),EMA(D1,3),REF(EMA(D1,3),1),8,0),COLOR
RED;
STICKLINE(EMA(D1,3)>REF(EMA(D1,3),1),EMA(D1,3),REF(EMA(D1,3),1),7,0),COLOR
1029FF;
STICKLINE(EMA(D1,3)>REF(EMA(D1,3),1),EMA(D1,3),REF(EMA(D1,3),1),6,0),COLOR
1040FF;
STICKLINE(EMA(D1,3)>REF(EMA(D1,3),1),EMA(D1,3),REF(EMA(D1,3),1),5,0),COLOR
1083FF;
STICKLINE(EMA(D1,3)>REF(EMA(D1,3),1),EMA(D1,3),REF(EMA(D1,3),1),4,0),COLOR
10ABFF;
DRAWTEXT(FILTER(CROSS(BB,金盆聚宝指标)ANDBB<30AND金盆聚宝指
标>REF(金盆聚宝指标,1)ANDBB>=金盆聚宝指标,5),35,'减空');
DRAWICON(FILTER(CROSS(BB,金盆聚宝指标)ANDBB<30AND金盆聚宝指
标>REF(金盆聚宝指标,1)ANDBB>=金盆聚宝指标,5),31,4);
DRAWTEXT(FILTER(CROSS(BB,金盆聚宝指标)ANDBB<30AND金盆聚宝指
标>REF(金盆聚宝指标,1)ANDBB<=金盆聚宝指标,5),35,'追多');
DRAWICON(FILTER(CROSS(BB,金盆聚宝指标)ANDBB<30AND金盆聚宝指
标>REF(金盆聚宝指标,1)ANDBB<=金盆聚宝指标,5),31,4);
DRAWTEXT(FILTER(BB<REF(BB,1)ANDBB>55ANDBB>REF(BB,4)AND
C>MA(C,15),7)ANDBB>金盆聚宝指标,55,'减多');
DRAWICON(FILTER(BB<REF(BB,1)ANDBB>55ANDBB>REF(BB,4)AND
C>MA(C,15),7)ANDBB>金盆聚宝指标,59,5);
DRAWTEXT(FILTER(BB<REF(BB,1)ANDBB>92.5ANDBB>REF(BB,4)AND
C>MA(C,15),7)ANDBB<金盆聚宝指标,55,'追空');
DRAWICON(FILTER(BB<REF(BB,1)ANDBB>92.5ANDBB>REF(BB,4)AND
C>MA(C,15),7)ANDBB<金盆聚宝指标,59,5);
GC3:LLV(BB,198),POINTDOT,COLORGREEN;
GC4:HHV(BB,188),POINTDOT,COLORGREEN;
DRAWTEXT(FILTER(GC4>REF(GC4,1),7),GC4-7,'将见顶');
DRAWICON(FILTER(GC4>REF(GC4,1),7),GC4,13);
CC:=(BB-金盆聚宝指标<0.3)AND(BB<25)ANDC<MA(C,13)*0.98ANDC>REF(C,1);
DD:=FILTER(CC,10);
DRAWTEXT(DD,15,'还有一跌');
DRAWICON(DD,19,9);
GG:=(BB-金盆聚宝指标<0.6)AND(BB<40)ANDC<MA(C,13)*0.996ANDC>REF(C,1);
HH:=FILTER(GG,10);
DRAWTEXT(HH,25,'逃底点'),COLOR43D0FA;
DRAWICON(HH,20,10);
EE:=(BB-金盆聚宝指标>0.55)AND(BB>70)ANDC>MA(C,13)*0.96ANDC<REF(C,1);
FF:=FILTER(EE,10);
DRAWTEXT(FF,70,'逃高点'),COLOR43D0FA;
DRAWICON(FF,75,8);
DRAWTEXT(FILTER(GC3>REF(GC3,1),5)ANDBB<40AND金盆聚宝指标>REF(金盆聚
宝指标,1),GC3+6,'将见底');
DRAWICON(FILTER(GC3>REF(GC3,1),5)ANDBB<40AND金盆聚宝指标>REF(金盆
聚宝指标,1),GC3,11);{顶底王}
VAR1:=LLV(LOW,34);
VAR2:=HHV(HIGH,30);
VAR3:=REF(CLOSE,1);
VAR4:=EMA((CLOSE-VA
R1)/(VAR2-VAR1),3)*10
0;主力:=SMA(MAX(CLOSE-V
AR3,0),7,1)/SMA(ABS(C
LOSE-VAR3),7,1)*100,C
OLORRED;
CC:主力;
二、最精准的顶底指标公式
SHORT:=5;
LONG:=10;
M:=10;
DDD:(MA(CLOSE,SHORT)-MA(CLOSE,LONG)),NODRAW;
AMA:MA(DDD,M);
DRAWCOLORLINE(DDD>=REF(DDD,1),DDD,COLORRED,COLORGREEN);
CON1:=CROSS(DDD,AMA);
CON2:=CROSSDOWN(DDD,AMA);
DRAWICON(CON1,DDD,'ICO4'),VALIGN0;
DRAWICON(CON2,DDD,'ICO5'),VALIGN2;
CON1,SOUND('A');
CON2,SOUND('B');
DIFF:EMA(CLOSE,36)-EMA(CLOSE,78);
DEA:EMA(DIFF,27);
MACD:2*(DIFF-DEA),NODRAW;
JC:=CROSS(DIFF,DEA);
SC:=CROSSDOWN(DIFF,DEA);
N1:=BARSLAST(JC)+1;
N2:=BARSLAST(SC)+1;
HH:=BACKSET(REFX(SC,1),HHVBARS(MACD,N1));
LL:=BACKSET(REFX(JC,1),LLVBARS(MACD,N2));
STICKLINE1(MACD>0&&NOT(HH=1),0,MACD,0,0),RGB(128,0,0);
STICKLINE1(MACD>0&&HH,0,MACD,0,0),COLORLIGHTGREEN;
STICKLINE1(MACD<0&&NOT(LL=1),0,MACD,0,0),COLORLIGHTGREEN;
STICKLINE1(MACD<0&&LL,0,MACD,0,0),RGB(128,0,0);
DRAWCOLORLINE(MACD>0,DIFF,COLORRED,COLORCYAN);
DRAWCOLORLINE(MACD>0,DEA,COLORRED,COLORCYAN);
DIFF1:EMA(CLOSE,3)-EMA(CLOSE,5),RGB(0,128,255);
DEA1:EMA(DIFF,2),RGB(0,128,255);
MACD1:2*(DIFF1-DEA1),NODRAW;
重心线:(H+L+O+C*3)/6;
NX:=(3*CLOSE+LOW+OPEN+HIGH)/6;
牛线:(20*NX+19*REF(NX,1)+18*REF(NX,2)+17*REF(NX,3)+16*REF(NX,4)
+15*REF(NX,5)+14*REF(NX,6)+13*REF(NX,7)+12*REF(NX,8)+11*REF(NX,
9)+10*REF(NX,10)+9*REF(NX,11)+8*REF(NX,12)+7*REF(NX,13)+6*REF(N
X,14)+5*REF(NX,15)+4*REF(NX,16)+3*REF(NX,17)+2*REF(NX,18)+REF(N
X,20))/210;
牛熊线:MA(牛线,6),COLORGREEN,LINETHICK2;
顶:=bbi+3*stD(BBI,13),COLOR004AFF;
底:=BBI-3*STD(BBI,13),COLOR67FF00;
KU1:=IF(HIGH=HHV(HIGH,3),1,0);
kd1:=IF(LOW=LLV(LOW,3),1,0);
UL:=IF(REF(KU1,2)=1ANDREF(KU1,1)=0
ANDKU1=0,REF(HIGH,2),REF(HIGH,2+BArslAST(REF(KU1,2)=1
ANDREF(KU1,1)=0ANDKU1=0)));
DL:=IF(REF(KD1,2)=1ANDREF(KD1,1)=0
ANDKD1=0,REF(LOW,2),REF(LOW,2+BARSLAST(REF(KD1,2)=1
ANDREF(KD1,1)=0ANDKD1=0)));
HV:=H>ULANDH>REF(H,1);
LV:=L<DLANDL<REF(L,1);
GP:=BARSLAST(HV);
DP:=BARSLAST(LV);
IP:=IF(GP=0,DP,GP)>3;
HHV1:=HVANDIPANDH>=HHV(H,BARSLAST(LV));
LV1:=LVANDIPANDL<=LLV(L,BARSLAST(HV));
V00:=HIGH<REF(HIGH,1)ANDLOW<REF(LOW,1);
V01:=HIGH<REF(HIGH,1)ANDLOW>REF(LOW,1);
V02:=HIGH>REF(HIGH,1)ANDLOW<REF(LOW,1);
V03:=HIGH>REF(HIGH,1)ANDLOW>REF(LOW,1);
V04:=REF(HIGH,2)<HIGHANDREF(LOW,2)<LOW
ANDREF(HIGH,2)>REF(HIGH,1)ANDREF(LOW,2)<REF(LOW,1);
V1:=COUNT(V00,6)>=3ANDCOUNT(V01ORV02,5)=0AND
LLVBARS(LOW,6)=1ANDHHVBARS(HIGH,6)>=5ANDV03;
V2:=COUNT(V00,7)>=3ANDCOUNT(V01ORV02,6)=1AND
LLVBARS(LOW,7)=2ANDHHVBARS(HIGH,7)>=6ANDV04;
V3:=COUNT(V00,7)>=3ANDCOUNT(V01ORV02,6)=1AND
LLVBARS(LOW,7)=1ANDHHVBARS(HIGH,7)>=6ANDV03;
V4:=COUNT(V00,8)>=3ANDCOUNT(V01ORV02,7)<=2AND
LLVBARS(LOW,8)=2ANDHHVBARS(HIGH,8)>=7ANDV04;
V5:=COUNT(V00,8)>=3ANDCOUNT(V01ORV02,7)<=2AND
LLVBARS(LOW,8)=1ANDHHVBARS(HIGH,8)>=7ANDV03;
V6:=COUNT(V00,9)>=3ANDCOUNT(V01ORV02,8)<=3AND
LLVBARS(LOW,9)=2ANDHHVBARS(HIGH,9)>=8ANDV04;
V7:=COUNT(V00,9)>=3ANDCOUNT(V01ORV02,8)<=3AND
LLVBARS(LOW,9)=1ANDHHVBARS(HIGH,9)>=8ANDV03;
V8:=COUNT(V00,10)>=3ANDCOUNT(V01ORV02,9)<=4AND
LLVBARS(LOW,10)=2ANDHHVBARS(HIGH,10)>=9ANDV04;
V9:=COUNT(V00,10)>=3ANDCOUNT(V01ORV02,9)<=4AND
LLVBARS(LOW,10)=1ANDHHVBARS(HIGH,10)>=9ANDV03;
V10:=COUNT(V00,11)>=3ANDCOUNT(V01ORV02,10)<=5AND
LLVBARS(LOW,11)=2ANDHHVBARS(HIGH,11)>=10ANDV04;
XG:=V1ORV2ORV3ORV4ORV5ORV6ORV7ORV8ORV9ORV10;
HV00:=HIGH>REF(HIGH,1)ANDLOW>REF(LOW,1);
HV01:=HIGH<REF(HIGH,1)ANDLOW>REF(LOW,1);
HV02:=HIGH>REF(HIGH,1)ANDLOW<REF(LOW,1);
HV03:=HIGH<REF(HIGH,1)ANDLOW<REF(LOW,1);
HV04:=REF(HIGH,2)>HIGHANDREF(LOW,2)>LOWAND
REF(HIGH,2)>REF(HIGH,1)ANDREF(LOW,2)<REF(LOW,1);
HV1:=COUNT(HV00,6)>=3ANDCOUNT(HV01ORHV02,5)=0AND
HHVBARS(HIGH,6)=1ANDLLVBARS(LOW,6)>=5ANDHV03;
HV2:=COUNT(HV00,7)>=3ANDCOUNT(HV01ORHV02,6)=1AND
HHVBARS(HIGH,7)=2ANDLLVBARS(LOW,7)>=6ANDHV04;
HV3:=COUNT(HV00,7)>=3ANDCOUNT(HV01ORHV02,6)=1AND
HHVBARS(HIGH,7)=1ANDLLVBARS(LOW,7)>=6ANDHV03;
HV4:=COUNT(HV00,8)>=3ANDCOUNT(HV01ORHV02,7)<=2AND
[源码注释]通达信公式动态翻译结果
VA1赋值:1日前的(最低价+开盘价+收盘价+最高价)/4
VA2赋值:最低价-VA1的绝对值的13日[1日权重]移动平均/最低价-VA1和0的较大值的10日[1日权重]移动平均
VA3赋值:VA2的10日指数移动平均
VA4赋值:33日内最低价的最低值
VA5赋值:如果最低价<=VA4,返回VA3,否则返回0的3日指数移动平均
AA赋值:18日内VA5的最高值>100
BB赋值:上次VA5>1日前的VA5距今天数
TT赋值:BB+1
HH赋值:TT日前的最高价,线宽为3
XG赋值:收盘价上穿TT日前的最高价
HJ赋值:(收盘价+HH)/2
HK赋值:(收盘价+HJ)/2
HL赋值:(收盘价+HK)/2
HG赋值:HL的3日简单移动平均
HF赋值:如果HG>1日前的HG,返回HG*1.008,否则返回HG*0.993
HG5赋值:HG的5日简单移动平均
HG5A赋值:HG5的10日简单移动平均
输出天线:HF,画洋红色,线宽为2
输出地线:HG,画黄色,线宽为2
当满足条件天线上穿地线时,在天线*1位置画7号图标
当满足条件地线上穿天线时,在天线*1位置画8号图标
推荐阅读:顶底趋势线指标公式
N:=3;
A1:=REF(H,N)=HHV(H,2*N+1);
B1:=FILTER(A1,N);
C1:=BACKSET(B1,N+1);
D1:=FILTER(C1,N);
{高点}
A2:=REF(L,N)=LLV(L,2*N+1);
B2:=FILTER(A2,N);
C2:=BACKSET(B2,N+1);
D2:=FILTER(C2,N);
{低点}
E1:=(REF(LLV(L,2*N),1)+REF(HHV(H,2*N),1))/2;
E2:=(H+L)/2;
{高低点出现在同一K线上时可作取舍}
H1:=(D1ANDNOT(D2ANDE1>=E2))ORISLASTBARORBARSCOUNT(C)=1;
L1:=(D2ANDNOT(D1ANDE1<E2));
H2:=D1ANDNOT(D2ANDE1>=E2);
X1:=REF(BARSLAST(H1),1)+1;
F1:=BACKSET(H1ANDCOUNT(L1,X1)>0,LLVBARS(IF(L1,L,10000),X1));
G1:=F1>REF(F1,1);
I1:=BACKSET(G1,2);
LD:=I1>REF(I1,1),LINETHICK0;
{过滤后低点}
L2:=LDORISLASTBARORBARSCOUNT(C)=1;
X2:=REF(BARSLAST(L2),1)+1;
F2:=BACKSET(L2ANDCOUNT(H2,X2)>0,HHVBARS(IF(H2,H,0),X2));
G2:=F2>REF(F2,1);
I2:=BACKSET(G2,2);
HD:=I2>REF(I2,1),LINETHICK0;
{过滤后高点}
R1:=BACKSET(ISLASTBAR,BARSLAST(HD)+1);
S1:=R1>REF(R1,1);
{前一高}
T1:=BACKSET(ISLASTBAR,BARSLAST(LD)+1);
U1:=T1>REF(T1,1);
{前一低}
R2:=BACKSET(S1,REF(BARSLAST(HD),1)+2);
S2:=R2>REF(R2,1);
{前二高}
T2:=BACKSET(U1,REF(BARSLAST(LD),1)+2);
U2:=T2>REF(T2,1);
{前二低}
T3:=BACKSET(U2,REF(BARSLAST(LD),1)+2);
U3:=T3>REF(T3,1);
{前三低}
T4:=BACKSET(U3,REF(BARSLAST(LD),1)+2);
U4:=T4>REF(T4,1);
{前四低}
R3:=BACKSET(S2,REF(BARSLAST(HD),1)+2);
S3:=R3>REF(R3,1);
{前三高}
R4:=BACKSET(S3,REF(BARSLAST(HD),1)+2);
S4:=R4>REF(R4,1);
{前四高}
★压力1:DRAWLINE(S2,H,S1,H,1),COLORMAGENTA,LINETHICK1;
★支撑1:DRAWLINE(U2,L,U1,L,1),COLOR8FBC8F,LINETHICK1;
★压力2:DRAWLINE(S3,H,S2,H,1),COLORFF8000;
★支撑2:DRAWLINE(U3,L,U2,L,1),COLOR99CC32;
★压力3:DRAWLINE(S4,H,S3,H,1),COLOR0000FF;
★支撑3:DRAWLINE(U4,L,U3,L,1),COLOR00FF7F;
DRAWICON(S2,H*1.01,10);
DRAWICON(S3,H*1.01,10);
DRAWNUMBER(S2,H*1.02,H),COLORCFB53B;
DRAWNUMBER(S1,H*1.02,H),COLORCFB53B;
DRAWNUMBER(S3,H*1.02,H),COLORCFB53B;
DRAWICON(U1,L*0.99,11);
DRAWICON(U2,L*0.99,11);
DRAWICON(U3,L*0.99,11);
DRAWICON(U4,L*0.99,11);
DRAWNUMBER(U1,L*0.98,L),COLORCYAN;
DRAWNUMBER(U2,L*0.98,L),COLORCYAN;
DRAWNUMBER(U3,L*0.98,L),COLORCYAN;
DRAWNUMBER(U4,L*0.98,L),COLORCYAN;
评论(0)