通达信指标公式源码概况:
指标类别: 通达信指标公式
授权方式: 免费版
指标评级: ★★★★★
指标分类: 策略
画线方法: 副图
一、通达信高量柱自动画线指标公式
RSI:SMA(MAX(C-REF(C,1),0),8,1)/SMA(ABS(C-REF(C,1)),8,1)*100,COLORWHITE;
A1:=REF(RSI,2)=HHV(RSI,2*2+1);
B1:=FILTER(A1,2);
C1:=BACKSET(B1,2+1);
D1:=FILTER(C1,2);{高}
A2:=REF(RSI,2)=LLV(RSI,2*2+1);
B2:=FILTER(A2,2);
C2:=BACKSET(B2,2+1);
D2:=FILTER(C2,2);{低}
H1:=(D1ANDNOT(D2))ORBARSTATUS=2ORBARSCOUNT(C)=1;
L1:=(D2ANDNOT(D1));
H2:=D1ANDNOT(D2);
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);{过滤后低点}
L2:=LDORBARSTATUS=2ORBARSCOUNT(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);{过滤后高点}
R1:=BACKSET(BARSTATUS=2,BARSLAST(HD)+1);
S1:=R1>REF(R1,1);{前一高}
R2:=BACKSET(S1,REF(BARSLAST(HD),1)+2);
S2:=R2>REF(R2,1);{前二高}
R3:=BACKSET(S2,REF(BARSLAST(HD),1)+2);
S3:=R3>REF(R3,1);{前三高}
T1:=BACKSET(BARSTATUS=2,BARSLAST(LD)+1);
U1:=T1>REF(T1,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);{前三低}
{—————–【图解模板】———————}
压一:DRAWLINE(S2,RSI,S1,RSI,1),COLOR00B5B9,COLORRED;{压力1}
压二:DRAWLINE(S3,RSI,S2,RSI,1),COLOR009AFF;{压力2}
撑一:DRAWLINE(U2,RSI,U1,RSI,1),COLORFF68FF;{支撑1}
撑二:DRAWLINE(U3,RSI,U2,RSI,1),COLORFFC800;{支撑2}
DRAWLINE(U2,RSI,0,0,3),POINTDOT,COLORFFAFFF;{启动直线}
20,COLORGRAY;
50,COLORGRAY;
80,COLORGRAY;
IF(C,RSI,DRAWNULL),COLORWHITE;
说明:任何公式都不是铁板一块,需要进行判断,有经验的根据自己的经验进行判断股价走
势,没有经验的多看少动,待到有经验了再行判断不迟。
日线图:
VAR3:=(CLOSE-MA(CLOSE,6))/MA(CLOSE,6)*100;
VAR4:=(CLOSE-MA(CLOSE,24))/MA(CLOSE,24)*100;
VAR5:=(CLOSE-MA(CLOSE,32))/MA(CLOSE,32)*100;
VAR6:=(VAR3+VAR4+VAR5)/3;
VAR7:=EMA(VAR6,5);
指标:EMA(EMA(VAR3,5),5)*3,COLORSTICK;
VAR8:=IF(VAR6<=-20,10,0);
VAR9:=HHV(VAR8,10);
STICKLINE(VAR8=10,20,10,5,0),COLOR6666FF;
VARA:=IF(VAR9
CROSS(MA(CLOSE,3),MA(CLOSE,5)),20,0);
K:EMA(VAR7,5)*2,COLORFF00FF;
D:EMA(K,5),COLORWHITE;
J:K*3-D*2,COLORYELLOW;
AND
VARB:=BETWEEN(CLOSE,MA(CLOSE,3),MA(CLOSE,5))
J>10;
换手:VOL/CAPITAL*100,COLORGREEN;
AND
DRAWTEXT(VARA=20,15,'底部'),LINETHICK1,COLORWHITE;
STICKLINE((VARA=20),0,10,5,0),COLORWHITE;
VARC:=(ZIG(3,5)>REF(ZIG(3,5),1))
(REF(ZIG(3,5),1)<=REF(ZIG(3,5),2))AND(REF(ZIG
(3,5),2)<=REF(ZIG(3,5),3));
VARD:=(ZIG(3,5)<REF(ZIG(3,5),1))
(REF(ZIG(3,5),1)>=REF(ZIG(3,5),2))AND(REF(ZIG
(3,5),2)>=REF(ZIG(3,5),3));
STICKLINE((VARC=1),(-14),0,4,0),COLOR0000FF;
DRAWTEXT((VARC=1),(-14),'买'),COLOR0000FF;
STICKLINE((VARD=1),14,0,4,0),COLOR00FF00;
DRAWTEXT((VARD=1),18,'卖'),COLOR00FF00;
VARE:=MA(100*(CLOSE-LLV(CLOSE,34))/(HHV(HIGH,34)-
LLV(LOW,34)),5)-20;
VARF:=100-3*SMA((CLOSE-LLV(LOW,75))/(HHV(HIGH,75)-
LLV(LOW,75))*100,20,1)+2*SMA(SMA
((CLOSE-LLV(LOW,75))/(HHV(HIGH,75)-
LLV(LOW,75))*100,20,1),15,1);
VAR10:=100-3*SMA((OPEN-LLV(LOW,75))/(HHV(HIGH,75)-
LLV(LOW,75))*100,20,1)+2*SMA(SMA
((OPEN-LLV(LOW,75))/(HHV(HIGH,75)-
LLV(LOW,75))*100,20,1),15,1);
VAR11:=VARF<REF(VAR10,1)ANDVOL>REF(VOL,1)AND
CLOSE>REF(CLOSE,1);
DRAWTEXT(VAR11ANDCOUNT(VAR11,30)=1,15,'大资金活动
'),LINETHICK1,COLORFF00FF;
STICKLINE(VAR11AND
AND
AND
COUNT(VAR11,30)=1,1,10,5,0),COLORFF00FF;
VAR12:=(HIGH+LOW+CLOSE)/3;
VAR13:=(VAR12-MA(VAR12,14))/(0.015*AVEDEV(VAR12,14));
VAR14:=(VAR12-MA(VAR12,70))/(0.015*AVEDEV(VAR12,70));
VAR15:=IF(VAR13>=150ANDVAR13<200AND
VAR14>=150ANDVAR14<200,10,0);
VAR16:=IF(VAR13<=-150ANDVAR13>-200ANDVAR14<=-
150ANDVAR14>-200,-10,VAR15);
VAR17:=(CLOSE-MA(CLOSE,13))/MA(CLOSE,13)*100;
VAR18:=100-ABS(VAR17);
VAR19:=IF(VAR18<90,VAR18,100);
VAR1A:=IF(VARE>0,VARE,0);
VAR1B:=IF(VAR14>=200ANDVAR13>=150,15,IF(VAR14<=-
200ANDVAR13<=-150,-15,VAR16))+60;
VAR1C:=VAR1A>48ANDVAR1B>60ANDVAR19<100;
DRAWTEXT(VAR1CANDCOUNT(VAR1C,30)=1,15,'大笔出货
'),LINETHICK1,COLORFFCC66;
STICKLINE(VAR1C
COUNT(VAR1C,30)=1,0,10,5,0),COLORFFCC66;
二、通达信30天最高量柱自动画线
HIGHN:=10;LOWN:=10;HIGHDISPLAY:=0;LOWDISPLAY:=0;ZGDISPLAY:=0;MADISPLA
Y:=0;
AA:=REF(H,HIGHN)=HHV(H,2*HIGHN+1);
QY:=BACKSET(AA,HIGHN+1);
CC:=FILTER(QY,HIGHN)ANDH=HHV(H,HIGHN+1);
DRAWICON(CC,H*1.02,2);
DDD:=BARSLAST(CC);
GDTS:=IF(CC,CURRBARSCOUNT,0);
DINGBU:=IF(DDD,REF(H,DDD),H);{顶部}
DINGBUTS:=IF(DDD,REF(GDTS,DDD),GDTS);
DINGBU1:=REF(DINGBU,DDD+1);
GDCS1:=CONST(DINGBUTS);
DINGBUTS1:=REF(DINGBUTS,DDD+1);
GDCS2:=CONST(DINGBUTS1);
DINGBU2:=REF(DINGBU1,DDD+1);
MM:=IF(CURRBARSCOUNT>GDCS2,0,1);
高点压力:DRAWLINE(CURRBARSCOUNT=GDCS2,H,CURRBARSCOUNT=GDCS1,H,1)
COLORGREEN,LINETHICK2;
DRAWLINE(CURRBARSCOUNT=GDCS2,H,ISLASTBAR,REF(H,GDCS2-1),1),COLOR0055F
F,POINTDOT;
DRAWLINE(CURRBARSCOUNT=GDCS1,H,ISLASTBAR,REF(H,GDCS1-1),1),COLORYELLO
W,POINTDOT;
AA1:=REF(L,LOWN)=LLV(L,2*LOWN+1);
QY1:=BACKSET(AA1,LOWN+1);
CC1:=FILTER(QY1,LOWN)ANDL=LLV(L,LOWN+1);
DRAWICON(CC1,L*0.98,1);
DD1:=BARSLAST(CC1);
DDTS:=IF(CC1,CURRBARSCOUNT,0);
YDB:=IF(DD1,REF(L,DD1),L);
DDTS1:=IF(DD1,REF(DDTS,DD1),DDTS);
DDCS1:=CONST(DDTS1);
ZDB:=REF(YDB,DD1+1);
DDTS2:=REF(DDTS1,DD1+1);
DDCS2:=CONST(DDTS2);
低点支撑:DRAWLINE(CURRBARSCOUNT=DDCS2,L,CURRBARSCOUNT=DDCS1,L,1)
COLORRED,LINETHICK2;
ZGSTAR:=(高点压力+低点支撑)/2;
ZGEND:=CONST((高点压力+低点支撑)/2);
STARDAY:=IF(DDCS2<GDCS2,DDCS2,GDCS2);
中轨:DRAWLINE(CURRBARSCOUNT=STARDAY,ZGSTAR,ISLASTBAR,ZGEND,1),COLORFF55
BB,LINETHICK2;
DRAWLINE(CURRBARSCOUNT=DDCS1,L,ISLASTBAR,REF(L,DDCS1-1),1),COLORMAGEN
TA,POINTDOT,;
DRAWLINE(CURRBARSCOUNT=DDCS2,L,ISLASTBAR,REF(L,DDCS2-1),1),COLORCYAN,
POINTDOT;
MA7:MA(C,7),COLORWHITE;
MA14:MA(C,14),COLORYELLOW;
MA25:MA(C,25),COLORFF00FF;
MA120:MA(C,120),COLORFFCC66;
QA:=REF(H,10)=HHV(H,2*10+1);
QB:=BACKSET(QA,10+1);
QC:=FILTER(QB,10)ANDH=HHV(H,10+1);
QD:=BARSLAST(QC);
QE:=IF(QC,CURRBARSCOUNT,0);
QF:=IF(QD,REF(QE,QD),QE);
QG:=CONST(QF);
QH:=REF(QF,QD+1);
QW:=CONST(QH);
DRAWLINE(CURRBARSCOUNT=QW,H,CURRBARSCOUNT=QG,H,1),COLORGREEN;
DRAWLINE(CURRBARSCOUNT=QW,H,ISLASTBAR,REF(H,QW-1),1),COLOR0099FF,
POINTDOT;
DRAWLINE(CURRBARSCOUNT=QG,H,ISLASTBAR,REF(H,QG-1),1),COLOR0099FF,P
OINTDOT;
QM:=INTPART(3*8/5);
QR:=REF(H,QM)=HHV(H,2*QM+1);
QT:=FILTER(QR,QM);
QY:=BACKSET(QT,QM+1);
QU:=FILTER(QY,QM);
QI:=BACKSET(ISLASTBAR,BARSLAST(QU)+1);
QP:=QI>REF(QI,1);
DRAWLINE(QU,H,QP,H,1),COLORRED;
QA1:=REF(L,8)=LLV(L,2*8+1);
QB1:=BACKSET(QA1,8+1);
QC1:=FILTER(QB1,8)ANDL=LLV(L,8+1);
QD1:=BARSLAST(QC1);
QE1:=IF(QC1,CURRBARSCOUNT,0);
QF1:=IF(QD1,REF(L,QD1),L);
QG1:=IF(QD1,REF(QE1,QD1),QE1);
QH1:=CONST(QG1);
QW1:=REF(QF1,QD1+1);
QM1:=REF(QG1,QD1+1);
QR1:=CONST(QM1);
DRAWLINE(CURRBARSCOUNT=QR1,L,CURRBARSCOUNT=QH1,L,1),COLORBLUE;
DRAWLINE(CURRBARSCOUNT=QH1,L,ISLASTBAR,REF(L,QH1-1),1),COLORWHITE,
POINTDOT;
DRAWLINE(CURRBARSCOUNT=QR1,L,ISLASTBAR,REF(L,QR1-1),1),COLORWHITE,
POINTDOT;
QT1:=REF(L,QM)=LLV(L,2*QM+1);
QY1:=FILTER(QT1,QM);
QU1:=BACKSET(QY1,QM+1);
QI1:=FILTER(QU1,QM);
QP1:=BACKSET(ISLASTBAR,BARSLAST(QI1)+1);
QJ1:=QP1>REF(QP1,1);
DRAWLINE(QI1,L,QJ1,L,1),COLORRED;
SR1:=REF(HIGH,10)=HHV(HIGH,2*10+1);
SR2:=FILTER(SR1,10);
SR3:=BACKSET(SR2,10+1);
HD:=FILTER(SR3,10);
前高:=REF(H,BARSLAST(HD));
DRAWICON(CROSS(C,前高),L-0.20,3);{突破前高的信号}
选股指标:
SR1:=REF(HIGH,10)=HHV(HIGH,2*10+1);
SR2:=FILTER(SR1,10);
SR3:=BACKSET(SR2,10+1);
HD:=FILTER(SR3,10);
前高:=REF(H,BARSLAST(HD));
突破前高:CROSS(C,前高);
[源码注释]通达信公式动态翻译结果
N赋值:9
M1赋值:3
M2赋值:3
RSV赋值:(收盘价-N日内最低价的最低值)/(N日内最高价的最高值-N日内最低价的最低值)*100
K赋值:RSV的M1日[1日权重]移动平均
D赋值:K的M2日[1日权重]移动平均
J赋值:3*K-2*D
钝化赋值:如果统计3日中满足K<20的天数=3,返回10,否则返回无效数 AND 如果统计1日中满足K<20的天数=1,返回10,否则返回无效数
红赋值:统计3日中满足钝化的天数>=2
MA1赋值:收盘价的8日指数移动平均
趋势线赋值:(5)*(((收盘价-27日内最低价的最低值)/(27日内最高价的最高值-27日内最低价的最低值))*(100)的5日[1日权重]移动平均)-(3)*(((收盘价-27日内最低价的最低值)/(27日内最高价的最高值-27日内最低价的最低值))*(100)的5日[1日权重]移动平均的3日[1日权重]移动平均)-((收盘价-27日内最低价的最低值)/(27日内最高价的最高值-27日内最低价的最低值))*(100)的5日[1日权重]移动平均的3日[1日权重]移动平均的2日[1日权重]移动平均
GUA1赋值:((收盘价>=1日前的收盘价) AND (1日前的收盘价>=2日前的收盘价) AND (1日前的收盘价<=3日前的收盘价) AND (2日前的收盘价<=3日前的收盘价) AND ((4日前的收盘价>2日前的收盘价) OR (4日前的收盘价<=2日前的收盘价) AND (5日前的收盘价>=3日前的收盘价)) OR (收盘价>=1日前的收盘价) AND (1日前的收盘价<=2日前的收盘价)AND (收盘价>=2日前的收盘价) AND ((3日前的收盘价>1日前的收盘价) OR(3日前的收盘价<=1日前的收盘价) AND (4日前的收盘价>=2日前的收盘价)))
GUB2赋值:((收盘价-10日内最低价的最低值)/(10日内最高价的最高值-10日内最低价的最低值))*(100)
GUB3赋值:GUB2的7日指数移动平均
GUB4赋值:GUB3的10日指数移动平均
GUB5赋值:(3)*(GUB3)-(2)*(GUB4)
GUB6赋值:GUB5的5日指数移动平均
底部赋值:如果(趋势线<=5),返回58,否则返回0,COLORFF00FF
串赋值:GUB6的1日指数移动平均
黄赋值:串 AND 如果1日前的(统计5日中满足(串<=1日前的串)的天数=5)AND(串>1日前的串),返回10,否则返回0
P1赋值:3
P2赋值:3
RSSV赋值:(收盘价-9日内最低价的最低值)/(9日内最高价的最高值-9日内最低价的最低值)*100
KS赋值:RSSV的3日[1日权重]移动平均,画黄色
DS赋值:KS的3日[1日权重]移动平均,COLOR00DD00
蓝赋值:KS上穿DSANDKS<20的4日过滤
出彩赋值:红 AND 黄 AND 蓝
当满足条件出彩时,在0和75位置之间画柱状线,宽度为2,0不为0则画空心柱.,画白色
当满足条件出彩时,在52和73位置之间画柱状线,宽度为1.2,0不为0则画空心柱.,画红色
当满足条件出彩时,在27和48位置之间画柱状线,宽度为1.2,0不为0则画空心柱.,画黄色
当满足条件出彩时,在2和23位置之间画柱状线,宽度为1.2,0不为0则画空心柱.,画蓝色
推荐阅读:通达信画柱状线公式
DIF1:=EMA(CLOSE,12)-EMA(CLOSE,26),COLOR00FF00,LINETHICK1;
DEA1:=EMA(DIF1,9),COLOR00FF00,LINETHICK1;
DRAWICON(CROSS(DIF1,DEA1),DEA1,1);
DRAWICON(CROSS(DEA1,DIF1),DEA1,2);
{主升浪消失出局}
DI:=EMA(CLOSE,4)-EMA(CLOSE,13),COLORMAGENTA,LINETHICK2;
D1:=EMA(DI,5),COLORGRAY;
D2:=EMA(DI,10),COLORGRAY;
D3:=EMA(DI,20),COLORGRAY;
D4:=EMA(DI,30),COLORGRAY;
D5:=EMA(DI,60),COLORGRAY;
D6:=EMA(DI,90),COLORGRAY;
D7:=EMA(DI,120),COLORGRAY;
D8:=EMA(DI,250),COLORGRAY;
AA:=STICKLINE(DI>=REF(DI,1)ANDD1>=REF(D1,1)ANDD2>=REF(D2,1)AND
D3>=REF(D3,1)AND
D4>=REF(D4,1)ANDD5>=REF(D5,1)ANDD6>=REF(D6,1)ANDD7>=REF(D7,1)AND
D8>=REF(D8,1)ANDC>EMA(C,11)ANDDI>-0.8,DI,0,2,0),COLORRED;
STICKLINE(AA,DIF1,DEA1,3,0),COLORE6E8FA;
{柱状线}
MACD1:=(DIF1-DEA1)*2;
STICKLINE(MACD1>REF(MACD1,1),0,MACD1,3.2,0),COLOR0000FF;
STICKLINE(MACD1>REF(MACD1,1),0,MACD1,2.7,0),,COLOR0000FF;
STICKLINE(MACD1>REF(MACD1,1),0,MACD1,2.1,0),COLOR0000FF;
STICKLINE(MACD1>REF(MACD1,1),0,MACD1,1.5,0),COLOR0000FF;
STICKLINE(MACD1>REF(MACD1,1),0,MACD1,0.9,0),COLOR0000FF;
STICKLINE(MACD1>REF(MACD1,1),0,MACD1,0.3,0),COLORCC66FF;
STICKLINE(MACD1<REF(MACD1,1),0,MACD1,3.2,0),COLORFF9900;
STICKLINE(MACD1<REF(MACD1,1),0,MACD1,2.7,0),COLORFF9900;
STICKLINE(MACD1<REF(MACD1,1),0,MACD1,2.1,0),COLORFF9900;
STICKLINE(MACD1<REF(MACD1,1),0,MACD1,1.5,0),COLORFF9900;
STICKLINE(MACD1<REF(MACD1,1),0,MACD1,0.9,0),COLORFF9900;
STICKLINE(MACD1<REF(MACD1,1),0,MACD1,0.3,0),COLORFFCC00;
STICKLINE(MACD1>=0ORMACD1<=0,0,0,50,1),COLORWHITE;
{买点提示}
A1:=BARSLAST(REF(CROSS(DIF1,DEA1),1));
BL:=REF(CLOSE,A1+1)>CLOSEANDDIF1>REF(DIF1,A1+1)ANDCROSS(DIF1,DEA1);
{STICKLINE(BL,0,1,2,0),COLOR00FF00;}
DRAWICON(BL,DEA1,23);
A2:=BARSLAST(REF(CROSS(DEA1,DIF1),1));
DBL:=REF(CLOSE,A2+1)<CLOSEANDREF(DIF1,A2+1)>DIF1AND
CROSS(DEA1,DIF1);
DRAWICON(DBL,DEA1,12);
低位金叉:=CROSS(DIF1,DEA1)ANDDIF1<-0.1;
DRAWTEXT(低位金叉,DIF1,'低位金叉');
JCCOUNT:=COUNT(CROSS(DIF1,DEA1),BARSLAST(DEA1>=0));
二次金叉:=CROSS(DIF1,DEA1)ANDDEA1<0ANDCOUNT(JCCOUNT=2,21)=1;
DRAWICON(二次金叉,DEA1*1.04,13);
DRAWTEXT(二次金叉,-0.1,'二次金叉'),COLORFF00FF;
A10:=BARSLAST(REF(CROSS(DIF1,DEA1),1));
底背离:=REF(CLOSE,A10+1)>CLOSEANDDIF1>REF(DIF1,A10+1)AND
CROSS(DIF1,DEA1);
DRAWLINE(A10=0,DEA1,底背离,DEA1,0),COLORRED,LINETHICK2;
DRAWTEXT(底背离,-0.50,'底背离'),COLOR00FF00;
A20:=BARSLAST(REF(CROSS(DEA1,DIF1),1));
顶背离:=REF(CLOSE,A20+1)<CLOSEANDREF(DIF1,A20+1)>DIF1AND
CROSS(DEA1,DIF1);
DRAWLINE(A20=0,DEA1,顶背离,DEA1,0),COLORWHITE,LINETHICK2;
{趋势柱状线}
WY1001:=(2*CLOSE+HIGH+LOW)/4;
WY1002:=EMA(WY1001,4);
WY1003:=EMA(WY1002,4);
WY1004:=EMA(WY1003,4);
X:=(WY1004-REF(WY1004,1))/REF(WY1004,1)*100;
X1:=IF(X<REF(X,1),X,DRAWNULL),COLORWHITE,LINETHICK2;
XO:=MA(X,2),COLOR9932CD;
SI:=REF(X,1);
STICKLINE(X>SI,X,SI,2.3,0),COLOR0000FF;
STICKLINE(X>SI,X,SI,0.3,0),COLORCC66FF;
STICKLINE(X<SI,X,SI,2.3,0),COLOR00BB00;
STICKLINE(X<SI,X,SI,0.3,0),COLOR00FF00;
STICKLINE(底背离,X,SI,1,0),COLORYELLOW;
STICKLINE(低位金叉,X,SI,1,0),COLORWHITE;
STICKLINE(低位金叉AND底背离,X,SI,0.1,0),COLORYELLOW;
{买点2,可省}
VAR2:=REF(LOW,1);
VAR3:=SMA(ABS(LOW-VAR2),3,1)/SMA(MAX(LOW-VAR2,0),3,1)*100;
VAR4:=EMA(IF(CLOSE*1.3,VAR3*10,VAR3/10),3);
VAR5:=LLV(LOW,13);
VAR6:=HHV(VAR4,13);
VAR7:=IF(MA(CLOSE,34),1,0);
VAR8:=EMA(IF(LOW<=VAR5,(VAR4+VAR6*2)/2,0),3)/618*VAR7;
VAR9:=IF(VAR8>100,100,VAR8);
VAR10:=IF(VAR9>-120,VAR9,0);
VAR11:=VAR10<REF(VAR10,1);
DRAWTEXT(VAR11ANDREF(NOT(VAR11),1),0,'☆'),COLORYELLOW;
{走势线}
DIF:DIF1,LINETHICK1,COLORGREEN;
DEA:DEA1,LINETHICK1,COLORGREEN;
DIF2:IF(MACD>REF(MACD,1),DIF1,DRAWNULL),COLORRED,LINETHICK1;
DEA2:IF(DEA1<DIF1,DEA1,DRAWNULL),COLORFF00FF,LINETHICK1;
{主力进场}
VAR12:=REF((LOW+OPEN+CLOSE+HIGH)/4,1);
VAR13:=SMA(ABS(LOW-VAR12),13,1)/SMA(MAX(LOW-VAR12,0),10,1);
VAR14:=EMA(VAR13,10);
VAR15:=LLV(LOW,33);
VAR16:=EMA(IF(LOW<=VAR15,VAR14,0),3);
主力进场:=IF(VAR16>REF(VAR16,1),VAR16,0),COLORRED,NODRAW;
STICKLINE(主力进场,X,SI,0.1,0),COLORRED;
N:=5;M1:=3;M2:=3;
RSV:=(CLOSE-LLV(LOW,N))/(HHV(HIGH,N)-LLV(LOW,N))*100;
K:SMA(RSV,M1,1),COLORYELLOW,LINETHICK1;
D:SMA(K,M2,1),COLORCYAN,LINETHICK1;
J:3*K-2*D,COLORMAGENTA,LINETHICK1;
高安全区:0,COLORRED;
安全区:20,COLORCYAN;
风险区:100,COLORGREEN;
U1:=BARSLAST(REF(CROSS(K,D),1));
U2:=REF(C,U1+1)>CANDREF(K,U1+1)<KANDCROSS(K,D)ANDD<50;
底背离:=IF(U2>0,1,0);
DRAWLINE(U1=0,D,底背离,REF(D,U1),0),COLORRED,LINETHICK2;
DRAWLINE(底背离,D,底背离,REF(D,U1),0),COLORRED,LINETHICK2;
DRAWTEXT(底背离,REF(D,U1)*1.00,'底背离'),COLORYELLOW;
RR:=MAX(C,O);
Q1:=HHV(RR,5);
Q2:=D<REF(D,1)ANDREF(D,1)>REF(D,2);
A2:=BARSLAST(REF(Q2,1));
顶背离:=REF(Q1,A2+1)<Q1ANDK<REF(K,A2+1)ANDQ2;
DRAWLINE(A2=0,D,顶背离,REF(D,A2),0),COLORWHITE,LINETHICK2;
DRAWLINE(顶背离,D,顶背离,REF(D,A2),0),COLORWHITE,LINETHICK2;
DRAWTEXT(顶背离,REF(D,A2)*1.02,'顶背离'),COLORGREEN;
评论(0)