通达信指标公式源码概况:
指标类别: 通达信指标公式
授权方式: 免费版
指标评级: ★★★★★
指标分类: 策略
画线方法: 副图
公式解读:
VAR1:=SAR(10,2,20);
S:IF(VAR1 C,VAR1,DRAWNULL),COLORRED,CIRCLEDOT;
X:IF(VAR1 C,VAR1,DRAWNULL),COLORGREEN,CIRCLEDOT;
B1:=REF(C,1);B2:=REF(C,2);
SS:=IF(C REF(C,1)ANDREF(C,1) =REF(C,2),1,IF(C REF(C,1)ANDREF(C,1) =REF(C,2),-1,IF(C REF(C,2)ANDREF(C,2) REF(C,1),2,IF(C REF(C,2)ANDREF(C,2) REF(C,1),-2,0))));
SM:=IF(REF(SS,1) 0ORREF(SS,1) 0,REF(SS,1),IF(REF(SS,2) 0ORREF(SS,2) 0,REF(SS,2),IF(REF(SS,3) 0ORREF(SS,3) 0,REF(SS,3),IF(REF(SS,4) 0ORREF(SS,4) 0,REF(SS,4),IF(REF(SS,5) 0ORREF(SS,5) 0,REF(SS,5),IF(REF(SS,6) 0ORREF(SS,6) 0,REF(SS,6),IF(REF(SS,7) 0ORREF(SS,7) 0,REF(SS,7),0)))))));
VAR1:=SAR(10,2,20);
S:IF(VAR1 C,VAR1,DRAWNULL),COLORRED,CIRCLEDOT;
X:IF(VAR1 C,VAR1,DRAWNULL),COLORGREEN,CIRCLEDOT;
B1:=REF(C,1);B2:=REF(C,2);
SS:=IF(C REF(C,1)ANDREF(C,1) =REF(C,2),1,IF(C REF(C,1)ANDREF(C,1) =REF(C,2),-1,IF(C REF(C,2)ANDREF(C,2) REF(C,1),2,IF(C REF(C,2)ANDREF(C,2) REF(C,1),-2,0))));
SM:=IF(REF(SS,1) 0ORREF(SS,1) 0,REF(SS,1),IF(REF(SS,2) 0ORREF(SS,2) 0,REF(SS,2),IF(REF(SS,3) 0ORREF(SS,3) 0,REF(SS,3),IF(REF(SS,4) 0ORREF(SS,4) 0,REF(SS,4),IF(REF(SS,5) 0ORREF(SS,5) 0,REF(SS,5),IF(REF(SS,6) 0ORREF(SS,6) 0,REF(SS,6),IF(REF(SS,7) 0ORREF(SS,7) 0,REF(SS,7),0)))))));
MC:IF(REF(SS,1) 0ORREF(SS,1) 0,B2,IF(SM 0,MIN(B1,B2),MAX(B1,B2))),COLORFF00FF;
STICKLINE(SS=1ORSM =1ANDSS=0,B1,C,0.8,1),COLORRED;
STICKLINE(SS=-1ORSM =-1ANDSS=0,B1,C,0.8,0),COLORFF9000;
STICKLINE(SS=2,B2,C,0.8,1),COLORRED;
STICKLINE(SS=-2,B2,C,0.8,0),COLORFF9000;
STICKLINE((SS=-1ORSS=-2)ANDSM 0,B2,B1,0.8,1),COLORRED;
STICKLINE((SS=1ORSS=2)ANDSM 0,B2,B1,0.8,0),COLORFF9000;
MC:IF(REF(SS,1) 0ORREF(SS,1) 0,B2,IF(SM 0,MIN(B1,B2),MAX(B1,B2))),COLORFF00FF;
STICKLINE(SS=1ORSM =1ANDSS=0,B1,C,0.8,1),COLORRED;
STICKLINE(SS=-1ORSM =-1ANDSS=0,B1,C,0.8,0),COLORFF9000;
STICKLINE(SS=2,B2,C,0.8,1),COLORRED;
STICKLINE(SS=-2,B2,C,0.8,0),COLORFF9000;
STICKLINE((SS=-1ORSS=-2)ANDSM 0,B2,B1,0.8,1),COLORRED;
STICKLINE((SS=1ORSS=2)ANDSM 0,B2,B1,0.8,0),COLORFF9000;
DIF:=EMA(CLOSE,6)-EMA(CLOSE,16);
DEA:=EMA(DIF,9);
窗:CROSS(DIF,DEA)ANDDEA -0.05,COLORFFFFFF,NODRAW;
DRAWICON(资金窗,LOW*0.98,5);
DRAWTEXT(资金窗 0,LOW*0.99, 资金窗 ),COLORFFFFFF;
VAR26:=EMA(CLOSE,2)-EMA(CLOSE,150);
VAR27:=EMA(VAR26,100);
VAR28:=2*(VAR26-VAR27);
VAR29:=POW(VAR28,3)*0.1+POW(VAR28,1);
VAR2A:=SQRT(SQRT(LOW*HIGH*OPEN*CLOSE));
VAR2B:=EMA(VAR2A*0.97,3);
VAR2C:=(HIGH+LOW+CLOSE)/3;
VAR2D:=(VAR2C-MA(VAR2C,14))/(0.015*AVEDEV(VAR2C,14));
龙抬头:=IF(VAR28 0.1,VAR29,0)*5,COLORCYAN;
护盘:CROSS(VAR28,1),COLORFF9900,NODRAW;
DRAWICON(护盘,LOW*0.96,31);
DRAWTEXT(护盘 0,LOW*0.95, 护盘 ),COLORFF9900;
后金窗:COUNT(L=LLV(L,20),20)=1ANDL=LLV(L,20),NODRAW,COLORFF00FF;
DRAWICON(后金窗,LOW*1,22);
DRAWTEXT(后金窗 0,LOW*0.99, 后金窗 ),COLORFF00FF;
STICKLINE(后金窗ANDFILTER(后金窗,31) 0,L*1.01,L*1.01,300,0),COLORYELLOW;
C3:=REF(C,1);
:=IF((C-C3)*100/C3 =(10-0.01*100/C3),1,0);
STICKLINE(涨停,OPEN,CLOSE,3,0),COLORYELLOW;
跌停:=IF((C3-C)*100/C3 =(10-0.01*100/C3),1,0);
STICKLINE(跌停,OPEN,CLOSE,2,0),COLORGREEN;
RC1:=REF(C,1);
涨停率10:=10-1/RC1;
涨停率5:=5-1/RC1;
比前涨率:=(C-RC1+0.004)*100/RC1;
比前跌率:=(RC1-C-0.004)*100/RC1;
本日涨率:=(C-O+0.004)*100/O;
本日跌率:=(O-C-0.004)*100/O;
大阳线:=C OAND(比前涨率 =涨停率5OR本日涨率 =涨停率5)
AND比前涨率 涨停率10AND涨停=0;
STICKLINE(大阳线,O,C,3,0),COLOR0000BB;
大阴线:=C OAND(比前跌率 =涨停率5OR本日跌率 =涨停率5)
AND比前跌率 涨停率10AND跌停=0;
STICKLINE(大阴线,O,C,3,0),COLORLIGREEN;
HIGHN:=10;
AAB:=REF(H,HIGHN)=HHV(H,2*HIGHN+1);
QY:=BACKSET(AAB,HIGHN+1);
CC:=FILTER(QY,HIGHN)ANDH=HHV(H,HIGHN+1);
DRAWICON(CC,H*1.01,2);
DRAWTEXT(CC 0,H*1, 洗盘 ),COLORFFFFFF;
涨停2:=(C/REF(C,1)) 1.095;
STICKLINE(涨停2,HIGH,OPEN,1,0),COLORYELLOW;
跌停2:=C/REF(C,1)
STICKLINE(跌停2,HIGH,LOW,1,0),COLORGREEN;
VAR1:=(EMA(C,12)-EMA(C,26))*100+50;
VAR2:=EMA(VAR1,9);
VAR3:=((HHV(H,21)-C)/(HHV(H,21)-LLV(L,21)))*100-10;
VAR4:=((C-LLV(L,21))/(HHV(H,21)-LLV(L,21)))*100;
STICKLINE(C REF(C,1),H,L,0,0),COLOR0000FF;
STICKLINE(C REF(C,1),O,C,3.1,1),COLOR000066;
STICKLINE(C REF(C,1),O,C,2.6,1),COLOR000099;
STICKLINE(C REF(C,1),O,C,2,1),COLOR0000CC;
STICKLINE(C REF(C,1),O,C,1.2,1),COLOR0000FF;
STICKLINE(C REF(C,1),O,C,0.4,1),COLORCC66FF;
STICKLINE(C REF(C,1),H,L,0,0),COLORFF0000;
STICKLINE(C REF(C,1),O,C,3.1,1),COLORCC0000;
STICKLINE(C REF(C,1),O,C,2.6,1),COLORFF4400;
STICKLINE(C REF(C,1),O,C,2,1),COLORFF8800;
STICKLINE(C REF(C,1),O,C,1.2,1),COLORFFCC00;
STICKLINE(C REF(C,1),O,C,0.4,1),COLORFFFF00;
STICKLINE(C=REF(C,1),H,L,0,0),COLORFFFFFF;
STICKLINE(C=REF(C,1),O,C,3.1,1),COLOR777777;
STICKLINE(C=REF(C,1),O,C,2.6,1),COLOR999999;
STICKLINE(C=REF(C,1),O,C,2,1),COLORBBBBBB;
STICKLINE(C=REF(C,1),O,C,1.2,1),COLORDDDDDD;
STICKLINE(C=REF(C,1),O,C,0.4,1),COLORFFFFFF;
A0:=(L+H+C*2)/4;
工作:EMA(A0,14)COLORYELLOW,LINETHICK1;
度假:EMA(A0,25)COLORGREEN,LINETHICK2;
A1X:=(工作-REF(工作,1))/REF(工作,1)*100;
A2X:=(度假-REF(度假,1))/REF(度假,1)*100;
G:=BARSLAST(CROSS(A1X,0));
买入止损:REF(A0,G),COLORWHITE,LINETHICK1;
A2:=3*EMA((C-LLV(L,30))/(HHV(H,30)-LLV(L,30))*100,5)-2*EMA((C-LLV(L,30))/(HHV(H,30)-LLV(L,30))*100,5);
A4:=(HHV(H,34)-C)/(HHV(H,34)-LLV(L,34))*100;
A5:=EMA(CLOSE,12)-EMA(CLOSE,26);
A6:=EMA(A5,9);
A7:=(A5 -0.1ANDA5
财神:IF(A7,LLV(L,21),DRAWNULL)COLORRED,CIRCLEDOT;
DRAWICON(CROSS(A2,EMA(A2,5))AND(A4-EMA(A2,5)) 40ANDA7,LLV(L,21)*1.02,1);
STICKLINE(C REF(C,1)*1.09,C,O,3.1,0)COLOR000055;
STICKLINE(C REF(C,1)*1.09,C,O,2.6,0)COLOR000077;
STICKLINE(C REF(C,1)*1.09,C,O,2.1,0)COLOR000099;
STICKLINE(C REF(C,1)*1.09,C,O,1.5,0)COLOR0000BB;
STICKLINE(C REF(C,1)*1.09,C,O,0.9,0)COLOR0000DD;
STICKLINE(C REF(C,1)*1.09,C,O,0.3,0)COLOR0000FF;
STICKLINE(C REF(C,1)*0.901,C,O,3.1,0)COLOR005500;
STICKLINE(C REF(C,1)*0.901,C,O,2.6,0)COLOR007700;
STICKLINE(C REF(C,1)*0.901,C,O,2.1,0)COLOR009900;
STICKLINE(C REF(C,1)*0.901,C,O,1.5,0)COLOR00BB00;
STICKLINE(C REF(C,1)*0.901,C,O,0.9,0)COLOR00DD00;
STICKLINE(C REF(C,1)*0.901,C,O,0.3,0)COLOR00FF00;
减:IF(A2X =0,度假,DRAWNULL),COLORMAGENTA,LINETHICK2;
少:IF(A1X =0,工作,DRAWNULL),COLORRED,LINETHICK2;
操:IF(A1X =0,买入止损,DRAWNULL),LINETHICK2,COLORRED;
作:IF(H =REF(A0,BARSLAST(CROSS(A1X,0)))*1.1,REF(A0,BARSLAST(CROSS(A1X,0)))*1.1,DRAWNULL),COLORGREEN,POINTDOT;
顺:IF(H =REF(A0,BARSLAST(CROSS(A1X,0)))*1.2,REF(A0,BARSLAST(CROSS(A1X,0)))*1.2,DRAWNULL),COLORGREEN,POINTDOT;
应:IF(H =REF(A0,BARSLAST(CROSS(A1X,0)))*1.3,REF(A0,BARSLAST(CROSS(A1X,0)))*1.3,DRAWNULL),COLORGREEN,CIRCLEDOT;
趋:IF(H =REF(A0,BARSLAST(CROSS(A1X,0)))*1.4,REF(A0,BARSLAST(CROSS(A1X,0)))*1.4,DRAWNULL),COLORGREEN,POINTDOT;
势:IF(H =REF(A0,BARSLAST(CROSS(A1X,0)))*1.5,REF(A0,BARSLAST(CROSS(A1X,0)))*1.5,DRAWNULL),COLORGREEN,POINTDOT;
破:IF(H =REF(A0,BARSLAST(CROSS(A1X,0)))*1.6,REF(A0,BARSLAST(CROSS(A1X,0)))*1.6,DRAWNULL),COLORGREEN,POINTDOT;
位:IF(H =REF(A0,BARSLAST(CROSS(A1X,0)))*1.7,REF(A0,BARSLAST(CROSS(A1X,0)))*1.7,DRAWNULL),COLORGREEN,POINTDOT;
出:IF(H =REF(A0,BARSLAST(CROSS(A1X,0)))*1.8,REF(A0,BARSLAST(CROSS(A1X,0)))*1.8,DRAWNULL),COLORGREEN,POINTDOT;
C2:=REF(C,1);
涨停:=IF((C-C2)*100/C2 =(10-0.01*100/C2),1,0);
STICKLINE(涨停,OPEN,CLOSE,1.5,0),COLORRED;
STICKLINE(涨停,H,L,0,0),COLORRED;
跌停:=IF((C2-C)*100/C2 =(10-0.01*100/C2),1,0);
STICKLINE(跌停,OPEN,CLOSE,1.5,0),COLORGREEN;
STICKLINE(跌停,H,L,0,1),COLORGREEN;
YX1赋值:2日前的收盘价/3日前的收盘价 1.095 AND 2日前的最高价=2日前的收盘价
YX2赋值:1日前的收盘价/2日前的收盘价 0.95 OR (1日前的收盘价/2日前的收盘价 0.96 and= 1.05)
YX3赋值:收盘价/1日前的收盘价 1.03
输出夹阴抓板:YX1 AND YX2 AND YX3
N:=20;
P:=1.618;
TYP:=(HIGH+LOW+CLOSE+OPEN)/4;
CCI:=(TYP-MA(TYP,N))/(0.015*AVEDEV(TYP,N));
MV:=FORCAST(OBV,3);
CCIV:=(MV-MA(MV,N))/(0.015*AVEDEV(MV,N));
{布林线信号}
CC:FORCAST((CCI+CCIV)/2,3),LINETHICK2;
中轨:MA(CC,N);
上轨:中轨+P*STD(CC,N);
下轨:中轨-P*STD(CC,N);
{DRAWICON(CROSS(CC,下轨),下轨*1.2,1);{买信号B}
{DRAWICON(CROSS(上轨,CC),上轨*1.2,2);{卖信号S}
100,POINTDOT;
-100,POINTDOT;
持仓:EMA(100*(CLOSE-LLV(LOW,34))/(HHV(HIGH,34)-LLV(LOW,34)),3),COLORMAGENTA,LINETHICK2;
主力集中度:WINNER(C)*100,COLORRED,LINETHICK2;
散筹筹码集中度:(WINNER(C*1.1)-WINNER(C*0.9))*100,COLORGREEN,LINETHICK2;
强弱分界:80,COLORYELLOW;
趋势线:3*SMA((CLOSE-LLV(LOW,27))/(HHV(HIGH,27)-LLV(LOW,27))*100,5,1)-2*SMA(SMA((CLOSE-LLV(LOW,27))/(HHV(HIGH,27)-LLV(LOW,27))*100,5,1),3,1);
VAR1:=REF((LOW+OPEN+CLOSE+HIGH)/4,1);
VAR2:=SMA(ABS(LOW-VAR1),13,1)/SMA(MAX(LOW-VAR1,0),10,1);
VAR3:=EMA(VAR2,10);
VAR4:=LLV(LOW,33);
VAR5:=EMA(IF(LOW =VAR4,VAR3,0),3);
主力进场:
STICKLINE(VAR5 REF(VAR5,1),0,VAR5,7,0),COLORRED;
洗盘:
STICKLINE(VAR5 REF(VAR5,1),0,VAR5,7,0),COLORGREEN;
T:=BARSLAST(H=HHV(H,60)ANDC OANDO REF(C,1)ANDH/L 1.05);
TJ1:=EVERY(C REF(C,1),2);
TJ2:=EVERY(L =REF(L,1),2);
LT:=BARSLAST(REF(T,2)=0ANDTJ1ANDTJ2);
TJ3:=T-LT=2ANDC REF(C,T)*1.02;
TJ4:=BARSLASTCOUNT(C O)=4ANDC/REF(C,1) 1.045;
XG1:=REF(EVERY(MAX(C,O) REF(H,T),T),1)ANDO REF(H,1)ANDTJ3ANDT 15ANDNOT(TJ4);
XG:=COUNT(XG1,T)=1ANDXG1;
QF:=BACKSET(XG=1,T+1);
QFT:=BARSLAST(CROSS(QF=1,0.5));
DRAWTEXT(QFT=0,H*1.1, 开始洗盘 ),COLORYELLOW;
DRAWICON(QFT=0,H,12);
STICKLINE(QFT =0ANDQF=1,REF(H,T),REF(H,T),4,-1),COLORLIBLUE;
DRAWTEXT(XG=1,L*0.95, 买 ),COLORYELLOW;
DRAWICON(XG=1,L,11);
n1:=6;n2:=12;
q1:=(close*vol)/sum(vol,100);
a1:=ma(q1,n1);
zm1:=sma(a1,n1,1);
zm2:=sma(a1,n2,1);
zmf:(zm1-zm2)*10000,colorstick,linethick2;
fm:sma(zmf,3,1);
t1:=if(c ma(close,13),1,0);
t2:=if(c ma(close,13),1,0);
t3:=count(if(zmf 0andzmf ref(zmf,1),1,0),4)
t4:=count(if(zmf 0,1,0),5)
t5:=filter(t1andt4,20);
t6:=filter(t2andt3,20);
drawtext(t5,zmf-3, 洗盘谷 ),colorgreen;
drawtext(t6,zmf+3, 建仓峰 ),coloryellow;
LR:=36;
B:=13;
N:=100;
UR:=5;
SHORT:=21;
LONG:=44;
MIDD:=11;
M:=11;
{KDJ的MACD}
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;
DIFF:EMA(J,8)-EMA(J,16),COLOR0044FF;
DEA:EMA(DIFF,5),COLOR00FF00;
DRAWBAND(DIFF,RGB(255,80,0),DEA,RGB(0,255,100));
MACD:2*(DIFF-DEA),COLORSTICK;
0,COLORFF9900,DOTLINE;
{卖}
KC:=FORCAST(((2*C+H+L)/4*0.618+C*0.382),3);
AAX:=(KC-MA(KC,9))/MA(KC,9)*100;
VAR0:=MIN(EXIST(KC,55),9);
AAX1:=EMA(AAX,VAR0)*VAR0;
AAX2:=MA(AAX1,3);
AAX3:=MA(AAX1,5);
DRAWTEXT(AAX3 10ANDAAX1 REF(AAX1,1)ANDCROSS(AAX2,AAX1),12, 卖 ),COLOR00FFFF,LINETHICK3;
DRAWTEXT(AAX3 10ANDAAX1 REF(AAX1,1)ANDCROSS(AAX2,AAX1),15, ◆ ),COLOR0000FF,LINETHICK3;
DRAWTEXT_FIX(1,0.02,0,0, ■现在KDJ的参数是:N=9,M1=3,M2=3; ),COLOR0000FF;
DRAWTEXT_FIX(1,0.02,0.1,0, ■【KDJ】的【MACD】的参数是:LONG=8,LONG=16,M=5; ),COLOR00FF00;
公式编写要求:
长上影线幅度大于3个点的选股公式。
公式编写方法:
XG:H/MAX(C,O) 1.02;