通达信指标公式源码概况:
指标类别: 通达信指标公式
授权方式: 免费版
指标评级: ★★★★★
指标分类: 策略
画线方法: 副图
一、量线主图指标公式
HHJSJDA:=(3*CLOSE+OPEN+LOW+HIGH)/6;
HHJSJDB:
(20*HHJSJDA+19*REF(HHJSJDA,1)+18*REF(HHJSJDA,2)+17*REF(HHJSJDA,3)+16*REF(HHJSJDA,4)+15*REF(HHJSJDA,5)+14*REF(HHJSJDA,6)
+13*REF(HHJSJDA,7)+12*REF(HHJSJDA,8)+11*REF(HHJSJDA,9)+10*REF(HHJSJDA,10)+9*REF(HHJSJDA,11)+8*REF(HHJSJDA,12)
+7*REF(HHJSJDA,13)+6*REF(HHJSJDA,14)+5*REF(HHJSJDA,15)+4*REF(HHJSJDA,16)+3*REF(HHJSJDA,17)+2*REF(HHJSJDA,18)+
REF(HHJSJDA,20))/210,COLORYELLOW;
HHJSJDC:MA(HHJSJDB,5),COLORRED;
总额:=AMOUNT;
买1:=IF(O=CAND(C-REF(C,1))/REF(C,1)*100>9.8,AMOUNT,AMOUNT/((H-L)*2-ABS(O-C))*(C-L));
买%:=买1/AMOUNT*100;
流⼊1:=AMOUNT*买%/10000000000;
流出1:=AMOUNT/100000000-流⼊1;
净流:=(流⼊1-流出1);
总额3:=SUM(AMOUNT,3);
流⼊3:=SUM(流⼊1,3);
流出3:=SUM(流出1,3);
净流3:=SUM(流⼊1-流出1,3);
总额5:=SUM(AMOUNT,5);
流⼊5:=SUM(流⼊1,5);
流出5:=SUM(流出1,5);
净流5:=SUM(流⼊1-流出1,5);
总额10:=SUM(AMOUNT,10);
流⼊10:=SUM(流⼊1,10);
流出10:=SUM(流出1,10);
净流10:=SUM(流⼊1-流出1,10);
画:=CONST(FINDHIGH(总额10,0,190,1));
DRAWTEXT_FIX(1,0.11,0.12,0,净流(亿):),COLOR8080FF,LINETHICK1;
DRAWTEXT_FIX(1,0.18,0.1,0,1⽇),COLOR8080FF,LINETHICK1;
DRAWTEXT_FIX(1,0.23,0.1,0,3⽇),COLOR8080FF,LINETHICK1;
DRAWTEXT_FIX(1,0.28,0.1,0,5⽇),COLOR8080FF,LINETHICK1;
DRAWTEXT_FIX(1,0.33,0.1,0,10⽇),COLOR8080FF,LINETHICK1;
DRAWNUMBER_FIX(1,0.18,0.15,0,CONST((净流))),COLORYELLOW;
DRAWNUMBER_FIX(1,0.23,0.15,0,CONST((净流3))),COLORYELLOW;
DRAWNUMBER_FIX(1,0.28,0.15,0,CONST((净流5))),COLORYELLOW;
DRAWNUMBER_FIX(1,0.33,0.15,0,CONST((净流10))),COLORYELLOW;
Z1A:=STRCAT(HYBLOCK,);
Z2A:=STRCAT(Z1A,FGBLOCK);
Z3A:=STRCAT(Z2A,DYBLOCK);
Z4A:=STRCAT(Z3A,);
DRAWTEXT_FIX(ISLASTBAR,0.25,0.98,0,STRCAT(Z4A,GNBLOCK)),COLORCYAN;
MA1:=MA(C,1);
MA2:=MA(C,2);
MA3:=MA(C,3);
MA4:=MA(C,5);
MA52:=MA(C,8);
MA62:=MA(C,13);
短线:MA((MA1+MA2+MA3+MA4+MA52+MA62)/6,5),COLORMAGENTA,LINETHICK2;
TT2:=DMA((((HIGH+LOW)+(CLOSE*2))/4.15),0.9);
TT1:=REF(EMA(TT2,3),1);
RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
K:=SMA(RSV,3,1);
D:=SMA(K,3,1);
J:=3*K-2*D;
LC:=REF(CLOSE,1);
RSI:=((SMA(MAX((CLOSE-LC),0),3,1)/SMA(ABS((CLOSE-LC)),3,1))*100);
FF:=EMA(CLOSE,3);
AA1:=AMOUNT/VOL;
BB1:=L<AA1*0.9;
CC1:=(C-REF(C,1))/REF(C,1)*100>1.2;
DD1:=L<MA(C,5)*0.921;
EE1:=VOL<MA(V,5)*1.5;
FF1:=BB1ANDCC1ANDDD1ANDEE1;
F:=100*(C-REF(C,1))/REF(C,1);
P1:=IF(C<REF(O,1)ANDF<0,1,0);
P2:=IF(C<REF(O,2)ANDF<0,1,0);
TT3:=P1=0ANDREF(P1,1)=1ANDP2=0ANDREF(P2,1)=1;
TT4:=P1=1ANDREF(P1,1)=0ANDP2=1ANDREF(P2,1)=0;
Z1:=MA(C,13);
ZX:=REF(Z1,13/2+1);
DRAWTEXT(CROSS(CLOSE,TT1)ANDJ<55,LOW,买),COLORRED;
DRAWTEXT(CROSS(CLOSE,TT1)ANDJ<55,LOW,买),COLORRED;
STICKLINE(TT3,OPEN,CLOSE,3,0),COLORFF00FF;
A1:=EMA(C,14)COLORWHITE,LINETHICK1;
A1X:=(A1-REF(A1,1))/REF(A1,1)*100,NODRAW;
STICKLINE(CROSS(A1X,0),C,O,2,0)COLORYELLOW;
STICKLINE(CROSS(0,A1X),C,O,2,0)COLORGREEN;
AZ:=BARSCOUNT(CLOSE);
AH:=HHV(HIGH,144);
AL:=LLV(LOW,144);
B0:=(AH-AL)/34;
BL1:=HIGH+B0;
BL2:=LOW-B0;
STICKLINE((AZ+0)/34=FLOOR((AZ+0)/34),BL2,BL2-2*B0,2,0),COLORFFFFFF;
DRAWTEXT((AZ+0)/34=FLOOR((AZ+0)/34),BL2-4*B0,窗),COLORFFFFFF;
VAR3:=REF(C,1)=LLV(C,4)ANDC>=REF(C,2)ORREF(C,2)=LLV(C,4)ANDREF(C,1)<=REF(C,3)ANDREF(C,2)<REF(C,4)ANDC>=REF(C,1);
STICKLINE(VAR3,O,(O+C)/2,2.5,0),COLOR00BB00;
STICKLINE(VAR3,O,(O+C)/2,0.2,0),COLOR00FF00;
MTM:=C-REF(C,1);
DX:=100*EMA(EMA(MTM,6),6)/EMA(EMA(ABS(MTM),6),6);
买:=LLV(DX,2)=LLV(DX,7)ANDCOUNT(DX<0,2)ANDCROSS(DX,MA(DX,2));
买线:=EMA(CLOSE,2);
卖线:=EMA(SLOPE(CLOSE,32)*20+CLOSE,56),LINETHICK0;
BU:=CROSS(买线,卖线);
SEL:=CROSS(卖线,买线);
DRAWTEXT(BU,LOW*0.989,点),COLORYELLOW,LINETHICK3;
STICKLINE(CROSS(买线,卖线),OPEN,CLOSE,2,0),COLORYELLOW;
A7:=C-REF(C,1);
A8:=100*EMA(EMA(A7,6),6)/EMA(EMA(ABS(A7),6),6);
买3:=LLV(A8,2)=LLV(A8,7)ANDCOUNT(A8<0,2)ANDCROSS(A8,MA(A8,2));
DRAWTEXT(FILTER(买3=1,5),LOW-0.15,进),COLORYELLOW;
STICKLINE(买3,OPEN,CLOSE,2,0),COLORYELLOW;
天使:=EMA(C,2);
魔⿁:=EMA(SLOPE(C,9)*20+C,40);
买5:=CROSS(天使,魔⿁);
DRAWTEXT(买5,LOW*0.97,⽜),COLORMAGENTA;
STICKLINE(CROSS(天使,魔⿁),OPEN,CLOSE,2,0),COLORYELLOW;
AA:=CROSS(MA(C,5),MA(C,21))ANDCROSS(MA(C,5),MA(C,34))ANDCROSS(MA(C,5),MA(C,55));
BB:=MA(C,55)>MA(C,13)ANDCROSS(MA(C,13),MA(C,34))ANDMA(C,34)>MA(C,21)ANDABS(MA(C,55)-MA(C,21))/MA(C,21)<0.05;
CC:=MA(C,34)>MA(C,5)ANDCROSS(MA(C,5),MA(C,21))ANDMA(C,21)>MA(C,13);
DD:=ABS((MA(C,5)-MA(C,13))+(MA(C,13)-MA(C,21))+(MA(C,21)-MA(C,34)))<0.02ANDMA(C,5)>REF(MA(C,5),1)ANDMA(C,13)>REF(MA(C,13),1);
EE:=MA(C,21)>MA(C,5)ANDCROSS(MA(C,5),MA(C,13))ANDMA(C,13)>MA(C,55)ANDABS(MA(C,21)-MA(C,55))/MA(C,55)<0.05;
FFF:=AAORBBORCCORDDOREE;
探测:=FFFANDFILTER(FFF,8);
DRAWTEXT(探测,L*0.978,●),COLORRED;
STICKLINE(探测,O,C,3,0),LINETHICK2,COLORWHITE;
MA5:MA(C,5),LINETHICK1,COLORGREEN;
MA14:MA(C,14),LINETHICK1,COLORGREEN;
MA21:MA(C,21),LINETHICK1,COLORGREEN;
MA55:MA(C,55),LINETHICK1,COLORGREEN;
MA89:MA(C,89),LINETHICK1,COLORGREEN;
IF(MA5>REF(MA5,1),MA5,DRAWNULL),LINETHICK1,COLORRED;
IF(MA14>REF(MA14,1),MA14,DRAWNULL),LINETHICK1,COLORRED;
IF(MA21>REF(MA21,1),MA21,DRAWNULL),LINETHICK1,COLORRED;
IF(MA55>REF(MA55,1),MA55,DRAWNULL),LINETHICK1,COLORRED;
IF(MA89>REF(MA89,1),MA89,DRAWNULL),LINETHICK2,COLORRED;
二、精准线主图指标公式
BN:=20;
C2:XMA(C,2),COLORWHITE;
MA10:MA(C2,10),COLORYELLOW;
MA20:MA(C2,BN),COLORGREEN;
MA60:MA(C2,60),COLORBLUE;
{布林线信号}
BOLL:=MA20;
UPPER:BOLL+1.618*STD(C2,BN),COLORGREEN;
LOWER:BOLL-1.618*STD(C2,BN),COLORGREEN;
DRAWICON(CROSS(C2,LOWER),L*0.97,7);{买信号B}
DRAWICON(CROSS(UPPER,C2),H*1.03,8);{卖信号S};
{精准线}
N:=3;
L0:=0.00;{点位差参数}{底精准线}
L1:=ABS(L-REF(L,1))<=L0;
L2:=ABS(L-REF(L,2))<=L0;
L3:=ABS(L-REF(L,3))<=L0;
L4:=ABS(L-REF(L,4))<=L0;
L5:=ABS(L-REF(L,5))<=L0;
精准线首次:=L1ORL2ORL3ORL4ORL5;
精准左:=FILTER(精准线首次,N);
天数:=BARSLAST(精准左);
LTS:=REF(L,天数);
精准右:=ABS(L-LTS)<=L0;
STICKLINE(精准左,L,L,50,-1),COLORMAGENTA;
DRAWLINE(精准左,L,精准右,LTS,1),COLORMAGENTA;
{顶精准线}
G1:=ABS(H-REF(H,1))<=L0;
G2:=ABS(H-REF(H,2))<=L0;
G3:=ABS(H-REF(H,3))<=L0;
G4:=ABS(H-REF(H,4))<=L0;
G5:=ABS(H-REF(H,5))<=L0;
精准线首次1:=G1ORG2ORG3ORG4ORG5;
精准左1:=FILTER(精准线首次1,N);
天数1:=BARSLAST(精准左1);
GTS:=REF(L,天数1);
精准右1:=ABS(H-GTS)<=L0;
STICKLINE(精准左1,H,H,50,-1),COLORGREEN;
N:=3;
L0:=0.00;{点位差参数}
L1:=ABS(L-REF(L,1))<=L0;
L2:=ABS(L-REF(L,2))<=L0;
L3:=ABS(L-REF(L,3))<=L0;
L4:=ABS(L-REF(L,4))<=L0;
L5:=ABS(L-REF(L,5))<=L0;
L6:=ABS(L-REF(L,6))<=L0;
L7:=ABS(L-REF(L,7))<=L0;
L8:=ABS(L-REF(L,8))<=L0;
精准线首次:=L1ORL2ORL3ORL4ORL5ORL6ORL7ORL8;
精准左:=FILTER(精准线首次,N);
天数:=BARSLAST(精准左);
LTS:=REF(L,天数);
精准右:=ABS(L-LTS)<=L0;
STICKLINE(精准左,L,L,50O0,-1),COL0RGREEN;
G1:=ABS(H-REF(H,1))<=L0;
G2:=ABS(H-REF(H,2))<=L0;
G3:=ABS(H-REF(H,3))<=L0;
G4:=ABS(H-REF(H,4))<=L0;
G5:=ABS(H-REF(H,5))<=L0;
G6:=ABS(H-REF(H,6))<=L0;
G7:=ABS(H-REF(H,7))<=L0;
G8:=ABS(H-REF(H,8))<=L0;
精准线1首次:=G1ORG2ORG3ORG4ORG5ORG6ORG7ORG8;
精准左1:=FILTER(精准线1首次,N);
天数1:=BARSLAST(精准左1);
GTS:=REF(L,天数1);
精准右1:=ABS(H-GTS)<=L0;
STICKLINE(精准左1,H,H,5000,-1),COL0RBLUE;
[源码注释]通达信公式动态翻译结果
X_1赋值:KDJ的K[取周线数据]上穿KDJ的D[取周线数据]
X_2赋值:随机指标KD的K[取周线数据](9,3,3)
X_3赋值:随机指标KD的D[取周线数据](9,3,3)
X_4赋值:X_2上穿X_3ANDREF(X_3,1)<30的13日过滤
X_5赋值:X_2上穿X_3ANDREF(X_3,1)>30的13日过滤
X_6赋值:X_4
X_7赋值:平滑异同平均的DIF[取周线数据](12,26,9)
X_8赋值:平滑异同平均的DEA[取周线数据](12,26,9)
X_9赋值:10
X_10赋值:5
X_11赋值:X_7上穿X_8ANDREF(X_8,1)<0的13日过滤
X_12赋值:X_11
X_13赋值:(X_9日内最高价的最高值-收盘价)/(X_9日内最高价的最高值-X_9日内最低价的最低值)*200-125
X_14赋值:X_13的X_10日[1日权重]移动平均+15
X_15赋值:(收盘价-X_9日内最低价的最低值)/(X_9日内最高价的最高值-X_9日内最低价的最低值)*200-105
X_16赋值:X_15的X_10日[1日权重]移动平均+15
X_17赋值:X_16上穿X_14
X_18赋值:X_12 AND X_11 AND X_1
当满足条件X_18时,在1和0位置之间画柱状线,宽度为3,0不为0则画空心柱.,画红色
当满足条件X_18时,在2和1位置之间画柱状线,宽度为2,0不为0则画空心柱.,画绿色
当满足条件X_18时,在3和2位置之间画柱状线,宽度为1,0不为0则画空心柱.,画洋红色
当满足条件X_18时,在2.5位置书写文字,画黄色
推荐阅读:量价主图指标公式
M:MA(C,10);
N:=30;
T1:=BARSLAST(H=HHV(H,N));
T2:=BARSLAST(L=LLV(L,N));
T3:=BARSLAST(VOL=HHV(VOL,N));
T4:=BARSLAST(VOL=LLV(VOL,N));
HH:=HHV(IF(T1=0,H,-999),3);
LL:=LLV(IF(T2=0,L,999),3);
VH:=HHV(IF(T3=0,VOL,-999),3);
VL:=LLV(IF(T4=0,VOL,9999999999),3);
H1:=FINDHIGH(HH,0,N,1);
H2:=FINDHIGH(HH,0,N,2);
H3:=FINDHIGH(HH,0,N,3);
L1:=FINDLOW(LL,0,N,1);
L2:=FINDLOW(LL,0,N,2);
L3:=FINDLOW(LL,0,N,3);
VH1:=FINDHIGH(VH,0,N,1);
VH2:=FINDHIGH(VH,0,N,2);
VH3:=FINDHIGH(VH,0,N,3);
VL1:=FINDLOW(VL,0,N,1);
VL2:=FINDLOW(VL,0,N,2);
VL3:=FINDLOW(VL,0,N,3);
PH:=(H1+H2+H3)/3;
PL:=(L1+L2+L3)/3;
PVH:=(VH1+VH2+VH3)/3;
PVL:=(VL1+VL2+VL3)/3;
TJ:=PH/PL;
TJ1:=PVH/PVL>1.5;
TJ2:=C>(PH+PL)/2ANDC>MA(C,10);
XG:=CROSS(RANGE(TJ,1.2,1.3)ANDTJ1,0.5);
STICKLINE(XG,C,O,2,0),COLORYELLOW;
STICKLINE(XG,H,L,0,0),COLORYELLOW;
DRAWICON(XG,L*0.95,1);
N:=30;
T1:=BARSLAST(H=HHV(H,N));
T2:=BARSLAST(L=LLV(L,N));
T3:=BARSLAST(VOL=HHV(VOL,N));
T4:=BARSLAST(VOL=LLV(VOL,N));
HH:=HHV(IF(T1=0,H,-999),3);
LL:=LLV(IF(T2=0,L,999),3);
VH:=HHV(IF(T3=0,VOL,-999),3);
VL:=LLV(IF(T4=0,VOL,9999999999),3);
H1:=FINDHIGH(HH,0,N,1);
H2:=FINDHIGH(HH,0,N,2);
H3:=FINDHIGH(HH,0,N,3);
L1:=FINDLOW(LL,0,N,1);
L2:=FINDLOW(LL,0,N,2);
L3:=FINDLOW(LL,0,N,3);
VH1:=FINDHIGH(VH,0,N,1);
VH2:=FINDHIGH(VH,0,N,2);
VH3:=FINDHIGH(VH,0,N,3);
VL1:=FINDLOW(VL,0,N,1);
VL2:=FINDLOW(VL,0,N,2);
VL3:=FINDLOW(VL,0,N,3);
PH:=(H1+H2+H3)/3;
PL:=(L1+L2+L3)/3;
PVH:=(VH1+VH2+VH3)/3;
PVL:=(VL1+VL2+VL3)/3;
TJ:=PH/PL;
TJ1:=PVH/PVL>1.5;
TJ2:=C>(PH+PL)/2ANDC>MA(C,10);
XG:CROSS(RANGE(TJ,1.2,1.3)ANDTJ1ANDTJ2,0.5);
XG1:CROSS(RANGE(TJ,1.2,1.3)ANDTJ1,0.5);
N:=30;
T1:=BARSLAST(H=HHV(H,N));
T2:=BARSLAST(L=LLV(L,N));
T3:=BARSLAST(VOL=HHV(VOL,N));
T4:=BARSLAST(VOL=LLV(VOL,N));
HH:=HHV(IF(T1=0,H,-999),3);
LL:=LLV(IF(T2=0,L,999),3);
VH:=HHV(IF(T3=0,VOL,-999),3);
VL:=LLV(IF(T4=0,VOL,9999999999),3);
H1:=FINDHIGH(HH,0,N,1);
H2:=FINDHIGH(HH,0,N,2);
H3:=FINDHIGH(HH,0,N,3);
L1:=FINDLOW(LL,0,N,1);
L2:=FINDLOW(LL,0,N,2);
L3:=FINDLOW(LL,0,N,3);
VH1:=FINDHIGH(VH,0,N,1);
VH2:=FINDHIGH(VH,0,N,2);
VH3:=FINDHIGH(VH,0,N,3);
VL1:=FINDLOW(VL,0,N,1);
VL2:=FINDLOW(VL,0,N,2);
VL3:=FINDLOW(VL,0,N,3);
PH:=(H1+H2+H3)/3;
PL:=(L1+L2+L3)/3;
PVH:=(VH1+VH2+VH3)/3;
PVL:=(VL1+VL2+VL3)/3;
TJ:=PH/PL;
TJ1:=PVH/PVL>1.5;
TJ2:=C>(PH+PL)/2ANDC>MA(C,10);
XG:CROSS(RANGE(TJ,1.2,1.3)ANDTJ1,0.5);
N:=30;
T1:=BARSLAST(H=HHV(H,N));
T2:=BARSLAST(L=LLV(L,N));
T3:=BARSLAST(VOL=HHV(VOL,N));
T4:=BARSLAST(VOL=LLV(VOL,N));
HH:=HHV(IF(T1=0,H,-999),3);
LL:=LLV(IF(T2=0,L,999),3);
VH:=HHV(IF(T3=0,VOL,-999),3);
VL:=LLV(IF(T4=0,VOL,9999999999),3);
H1:=FINDHIGH(HH,0,N,1);
H2:=FINDHIGH(HH,0,N,2);
H3:=FINDHIGH(HH,0,N,3);
L1:=FINDLOW(LL,0,N,1);
L2:=FINDLOW(LL,0,N,2);
L3:=FINDLOW(LL,0,N,3);
VH1:=FINDHIGH(VH,0,N,1);
VH2:=FINDHIGH(VH,0,N,2);
VH3:=FINDHIGH(VH,0,N,3);
VL1:=FINDLOW(VL,0,N,1);
VL2:=FINDLOW(VL,0,N,2);
VL3:=FINDLOW(VL,0,N,3);
评论(0)