通达信指标公式源码概况:
指标类别: 通达信指标公式
授权方式: 免费版
指标评级: ★★★★★
指标分类: 策略
画线方法: 副图
M:=5;
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;
ABC:SAR(4,M,20),colorlimagenta,NODRAW;
DRAWICON(CROSS(C,ABC),L-0.1,7);
T1:=C REF(C,1)ANDREF(C,1) REF(C,2);
A1:=REF(COUNT(T1,4) =1,1);
A2:=REF(C,1) REF(C,2)ANDC REF(C,1);
A3:=MA(C,20) REF(MA(C,20),1);
ZZ:=A1ANDA2;
DRAWTEXT(ZZ,L*0.998, 双 ),colorlimagenta;
上升风险线:MA(C,5)*1.18,colorligray;
MA5:MA(CLOSE,5),LINETHICK1,COLORGREEN;
MA10:MA(CLOSE,10),LINETHICK1,COLORRED;
MA30:MA(CLOSE,30),LINETHICK2,COLORYELLOW;
_持仓:IF(CLOSE =SAR(4,2,20),SAR(4,2,20),
DRAWNULL),CIRCLEDOT,COLORRED,{COLOR9955FF};
_空仓:IF(CLOSE =SAR(4,2,20),SAR(4,2,20),
DRAWNULL),CIRCLEDOT,COLORGREEN,{COLORDDFF00};
_现价:CLOSE,COLORWHITE,NODRAW;
_10日涨跌%:(C-REF(CLOSE,10))/REF(CLOSE,10)*100,COLORGREEN,NODRAW;
{二次给力}
给:=EMA(C,2),COLORRED;
力:=EMA(SLOPE(C,9)*20+C,37);
买:=CROSS(给,力);
卖:=CROSS(力,给);
DRAWICON(买,L*0.97,1);
RSV1:=(CLOSE-LLV(LOW,13))/(HHV(HIGH,13)-LLV(LOW,13))*100;
RSV2:=(CLOSE-LLV(LOW,55))/(HHV(HIGH,55)-LLV(LOW,55))*100;
J1:=3*SMA(RSV1,3,1)-2*SMA(SMA(RSV1,3,1),3,1);
J2:=3*SMA(RSV2,3,1)-2*SMA(SMA(RSV2,3,1),3,1);
支撑位:IF(CROSS(J1,J2),LOW,REF(LOW,BARSLAST(CROSS(J1,J2)))),POINTDOT;
STICKLINE(CROSS(J1,J2),LOW,REF(LOW,BARSLAST(CROSS(J1,J2))),9,0),COLORRED;
压力位:IF(CROSS(J2,J1),HIGH,REF(HIGH,BARSLAST(CROSS(J2,J1)))),POINTDOT;
STICKLINE(CROSS(J2,J1),HIGH,REF(HIGH,BARSLAST(CROSS(J2,J1))),9,0),COLORGREEN;
DRAWTEXT(买,L*0.95, 进攻 ),COLORYELLOW;
DRAWICON(卖,H*1.03,2);
DRAWTEXT(卖,H*1.08, 撤退 ),COLORWHITE;
STICKLINE(给 =力,LOW,HIGH,0.01,0),COLOR0000DD;
STICKLINE(给 =力,CLOSE,OPEN,2,1),COLORRED;
STICKLINE(给 =力,LOW,HIGH,0.01,0),COLOR0000DD;
STICKLINE(给 =力,CLOSE,OPEN,2,1),COLORRED;
STICKLINE(给 力,LOW,HIGH,0.01,0),COLORFFDD00;
STICKLINE(给 力,CLOSE,OPEN,2,0),COLORFFFF00;
STICKLINE(CROSS(给,力),OPEN,CLOSE,2.5,0),COLORYELLOW;
STICKLINE(CROSS(力,给),OPEN,CLOSE,2.5,0),COLORWHITE;
通达信SAR主图指标公式通达信公式爱查股网
MA5:MA(CLOSE,5),LINETHICK1,COLORGREEN;
MA10:MA(CLOSE,10),LINETHICK1,COLORRED;
MA30:MA(CLOSE,30),LINETHICK2,COLORYELLOW;
_持仓:IF(CLOSE =SAR(4,2,20),SAR(4,2,20),
DRAWNULL),CIRCLEDOT,COLORRED,{COLOR9955FF};
_空仓:IF(CLOSE =SAR(4,2,20),SAR(4,2,20),
DRAWNULL),CIRCLEDOT,COLORGREEN,{COLORDDFF00};
_现价:CLOSE,COLORWHITE,NODRAW;
_10日涨跌%:(C-REF(CLOSE,10))/REF(CLOSE,10)*100,COLORGREEN,NODRAW;
{二次给力}
给:=EMA(C,2),COLORRED;
力:=EMA(SLOPE(C,9)*20+C,37);
买:=CROSS(给,力);
卖:=CROSS(力,给);
DRAWICON(买,L*0.85,1);
DRAWTEXT(买,L*0.95, ),COLORYELLOW;
DRAWICON(卖,H*1.05,2);
DRAWTEXT(卖,H*1.08, ),COLORWHITE;
STICKLINE(给 =力,LOW,HIGH,0.01,0),COLOR0000DD;
STICKLINE(给 =力,CLOSE,OPEN,2,1),COLORRED;
STICKLINE(给 =力,LOW,HIGH,0.01,0),COLOR0000DD;
STICKLINE(给 =力,CLOSE,OPEN,2,1),COLORRED;
STICKLINE(给 力,LOW,HIGH,0.01,0),COLORFFDD00;
STICKLINE(给 力,CLOSE,OPEN,2,0),COLORFFFF00;
STICKLINE(CROSS(给,力),OPEN,CLOSE,2.5,0),COLORYELLOW;
STICKLINE(CROSS(力,给),OPEN,CLOSE,2.5,0),COLORWHITE;
新SAR100:=NEWSAR(1,100),COLORLIMAGENTA;
新SAR10:=NEWSAR(1,10);
新SAR5:=NEWSAR(1,5);
新SAR1:=NEWSAR(1,1);
现价:=C;
DRAWBAND(新SAR10,RGB(41,36,33),新SAR100+0.02,RGB(41,36,33));
前20内高:=HHV(C,20);
{50_DDX}
WJ:=(H+L+C)/3;
V1:=IF(H=L,1,H-MAX(O,C));
V2:=IF(H=L,1,MAX(C,O)-WJ);
V3:=IF(H=L,1,MIN(O,C)-L);
V4:=IF(H=L,1,WJ-MIN(C,O));
V5:=VOL/IF(H=L,4,H-L);
V6:=(V1*V5);
V7:=(V2*V5);
V8:=(V3*V5);
V9:=(V4*V5);
买盘:=(V9+V8);
卖盘:=(V6+V7);
差:=买盘-卖盘;
DDX:=买卖差;
DX:=MA(买卖差,5)*20;
N:=5;
M:=13;
N日内净流入:=SUM(DDX,N)*3;
流入:=IF(N日内净流入 REF(N日内净流入,1),N日内净流入,DRAWNULL);
DRAWBAND(N日内净流入,RGB(100,100,100),0,RGB(0,100,150));
{转向}{5天3%}
DLX1:=SMA(DX,3,1),LINETHICK,COLORWHITE;
RSV:=((C-LLV(L,6))/(HHV(H,6)-LLV(L,6)))*100;
K:=POW(SMA(RSV,2,1),5)/POW(10,8);
D:=POW(SMA(RSV,2,1),5)/POW(10,10);
J:=(K+D)/2;
花开短买:IF(CROSS(J,1),1,0)ANDDLX1 REF(DLX1,1),COLORYELLOW;
IF(花开短买,150000,DRAWNULL),CROSSDOT,LINETHICK6,COLORFF33FF;
IF(花开短买,150000,DRAWNULL),POINTDOT,LINETHICK4,COLOR00CCFF;
{IF(MACD =0ANDREF(MACD,1) 0,1,DRAWNULL),CROSSDOT,LINETHICK6,COLORFF33FF;
IF(MACD =0ANDREF(MACD,1) 0,1,DRAWNULL),POINTDOT,LINETHICK4,COLOR00CCFF;}
RSI1:=N日内净流入;
AA:=REF(RSI1,N)=HHV(RSI1,2*N+1);
BB:=BACKSET(AA,N+1);
CC:=FILTER(BB,N)ANDRSI1=HHV(RSI1,N+1);
A1:=BARSLAST(REF(CC,1));
顶:REF(CLOSE,A1+1) CLOSEANDREF(RSI1,A1+1) RSI1ANDCC,COLORRED;
DRAWLINE(CC,RSI1,FILTER(顶背离 0,5),RSI1,0),COLORRED;
AA2:=REF(RSI1,N)=LLV(RSI1,2*N+1);
BB2:=BACKSET(AA2,N+1);
CC2:=FILTER(BB2,N)ANDRSI1=LLV(RSI1,N+1);
A2:=BARSLAST(REF(CC2,1));
底背离:REF(CLOSE,A2+1) CLOSEANDREF(RSI1,A2+1) RSI1ANDCC2,COLORCYAN;
DRAWLINE(CC2,RSI1,FILTER(底背离 0,5),RSI1,0),COLORCYAN;
STICKLINE(DDX 0,0,DDX,4,0),COLORFF6600;
STICKLINE(DDX 0,0,DDX,3,0),COLORFF9900;
STICKLINE(DDX 0,0,DDX,1.5,0),COLORFFCC00;
STICKLINE(DDX 0,0,DDX,0,0),COLOR66CCFF;
STICKLINE(DDX 0,0,DDX,4,0),COLOR000099;
STICKLINE(DDX 0,0,DDX,3,0),COLOR0000CC;
STICKLINE(DDX 0,0,DDX,1.5,0),COLOR0000FF;
STICKLINE(DDX 0,0,DDX,0,0),COLORCC66FF;
DDX1:SMA(DX,3,1),COLORFFFFFF;
DDX2:SMA(DDX1,3,1),COLOR00FFFF;
DDX3:(5*DDX2+4*REF(DDX2,1)+3*REF(DDX2,2)+2*REF(DDX2,3)+REF(DDX2,4))/15;
预警:DDX 0ANDMA(V,5) MA(MA(V,5),5)ANDCROSS(DDX1,DDX2),LINETHICK;
天:=COUNT(DDX 0,5),COLORRED;
DRAWTEXT(预警,DDX*1.06, ★ ),LINETHICK3,COLOR00FFFF;
昨前高:CONST(REF(前20内高,2)),COLORYELLOW;
XX:=DRAWLINE(CURRBARSCOUNT=5,昨前高*0.98,CURRBARSCOUNT=1,昨前高,0);
DRAWBAND(昨前高,RGB(255,255,0),XX,RGB(0,0,0));
XX1:=DRAWLINE(CURRBARSCOUNT=9,昨前高,CURRBARSCOUNT=5,昨前高*0.98,0);
DRAWBAND(昨前高,RGB(255,255,0),XX1,RGB(0,0,0));
新SAR101:NEWSAR(1,100),COLORLIMAGENTA;
DRAWKLINE(HIGH,OPEN,LOW,CLOSE);
DRAWRECTREL(780,850,920,980,90);
DRAWTEXT_FIX(1,0.81,0.9,0, 两山凹陷处有大阳 ),COLORYELLOW;
DRAWRECTREL(680,50,820,170,90);
DRAWTEXT_FIX(1,0.70,0.10,0, 黄金三角上是望高台 ),COLORYELLOW;
:=新SAR101 REF(新SAR101,1)ANDREF(新SAR101,1) REF(新SAR101,2)ANDREF(新SAR101,2) REF(新SAR101,3)ANDC 新SAR101;{时去掉前面的等号}
M120:MA(C,120);
M240:MA(C,240);
MSAR24:MA(新SAR100,24),COLORYELLOW;
N:=10;
ZZ:=(HHV(H,3)+LLV(L,3))/2;A:=IF(C ZZ,VOL,0);B:=IF(C ZZ,VOL,0);
总0:=(A-B);
众赢BBD:EMA(总0,3)/SUM(VOL,5)*600,LINETHICK;
BBD:=众赢BBD;
STICKLINE(BBD =0,0,BBD,3,0),COLOR000088;
STICKLINE(BBD =0,0,BBD,1.5,0),COLOR0000AA;
STICKLINE(BBD =0,0,BBD,1,0),COLOR0000CC;
STICKLINE(BBD =0,0,BBD,0.5,0),COLOR0000FF;
STICKLINE(BBD 0,0,BBD,3,0),COLOR888800;
STICKLINE(BBD 0,0,BBD,1.5,0),COLORAAAA00;
STICKLINE(BBD 0,0,BBD,1,0),COLORCCCC00;
STICKLINE(BBD 0,0,BBD,0.5,0),COLORFFFF00;
XH1:=REF(BBD,1) REF(BBD,2)ANDREF(BBD,1) -10ANDBBD REF(BBD,1)ANDBBD 0;
XH2:=REF(BBD,1) =REF(BBD,2)ANDREF(BBD,1) 8ANDBBD REF(BBD,1)ANDBBD 0;
DRAWICON(XH1,-20,1);DRAWICON(XH2,20,2);
AA:=REF(CLOSE,1);
BBB:=SMA(MAX(CLOSE-AA,0),21,1)/SMA(ABS(CLOSE-AA),21,1)*1000;
HHH:=BBB-LLV(BBB,27);
CCC:=LLV(BBB,27)-BBB;
QQ:(MA(HHH,2)*3+HHH*13)/16,COLORFF00FF,LINETHICK1;
SS:(MA(CCC,2)*3+CCC*13)/16,COLORFF00FF,LINETHICK1;
GG:MA(HHH,5),LINETHICK1,COLORGREEN;
MM:MA(CCC,5),LINETHICK1,COLORGREEN;
WW:IF(QQ GG,SS,MM),LINETHICK1,COLOR0000FF;
EE:IF(SS MM,GG,QQ),COLORFFFFCC,LINETHICK1;
买:=IF(EE-WW 5.6,200,0);
{洗盘再买}
RSVV:=(CLOSE-LLV(LOW,10))/(HHV(HIGH,10)-LLV(LOW,10))*100;
VARB2:=(RSVV/2+22)*1;
量:=EMA(VOL,13);
:=EMA(AMOUNT,13);
过滤:=((资金/量)/100);
提纯:=(((CLOSE-过滤)/过滤)*100);
黄金:=((提纯 (0))ANDZXNH),COLORRED;
洗盘再买:IF(黄金ANDRSVV VARB2-2,180,0),COLORFFAA99,LINETHICK1;
VAR2:=LLV(LOW,10);
VAR3:=HHV(HIGH,25);
小心:3.2,COLORYELLOW;
风险:3.5,COLORBLUE;
动力线:=EMA((CLOSE-VAR2)/(VAR3-VAR2)*4,4);
STICKLINE(动力线 REF(动力线,1),动力线,REF(动力线,1),0,0),COLORRED;
STICKLINE(动力线 =REF(动力线,1),动力线,REF(动力线,1),0,0),COLOR00FF00;
底部:0.2,COLORC6C600;
关注:0.5,COLORFF75FF;
强弱分界:1.75,COLORRED;
输出短:最低价-2日前的收盘价
输出极短:((收盘价-1日前的收盘价)+短)/2
0,DOTLINE
买入开仓
{BOLL带}
MA26:=MA(C,26);
上轨26:=MA26+2*STD(C,26);
下轨26:=MA26-2*STD(C,26);
{然后画色带}
DRAWBAND(MA26,RGB(100,100,150),上轨26,RGB(100,100,150));
DRAWBAND(MA26,RGB(100,135,190),下轨26,RGB(100,135,190));
{黄金轨道}
CC:=ABS(C-MA(CLOSE,26))/MA(CLOSE,26);
DD:=DMA(CLOSE,CC);
内上:(1+618/10000)*DD,COLORRED,CROSSDOT;
内下:(1-618/10000)*DD,COLORRED,CROSSDOT;
中轴:(内上+内下)/2,COLORBLACK,CROSSDOT;
外上:(1+1236/10000)*DD,COLORCYAN,CROSSDOT;
外下:(1-1236/10000)*DD,COLORCYAN,CROSSDOT;
{因为画色带遮挡了原来的K线,所以要重做一次K线}
STICKLINE(C O,H,L,0,0),COLORRED;
STICKLINE(C =O,H,L,0,0),COLORCYAN;
STICKLINE(C O,C,O,3.1,1),COLORRED;
STICKLINE(C =O,C,O,3.1,0),COLORCYAN;
DX:=(C+H+L+O)/4;
MTM:=C-REF(C,1);
ZLGJ:=100*EMA(EMA(MTM,6),6)/EMA(EMA(ABS(MTM),6),6);
FB:=MA(DX,17)+ABS(MA(DX,17)-REF(MA(DX,17),1));
FS:=MA(DX,17)+MA(DX,17)-REF(MA(DX,17),1);
买1:=IF(LLV(ZLGJ,2)=LLV(ZLGJ,7)ANDCOUNT(ZLGJ 0,2)ANDCROSS(ZLGJ,MA(ZLGJ,2)),1,0);
卖1:=IF(HHV(ZLGJ,2)=HHV(ZLGJ,7)ANDCOUNT(ZLGJ 50,2)ANDCROSS(MA(ZLGJ,2),ZLGJ),1,0);
STICKLINE(FILTER(买1=1,5),C,O,6,0),COLORFF00FF;
STICKLINE(FILTER(卖1=1,1),C,O,6,0),COLOR00FF00;
RSV:=(C-LLV(L,9))/(HHV(H,9)-LLV(L,9))*100;
A:=(3*C+L+O+H)/6;
BB:=(20*A+19*REF(A,1)+18*REF(A,2)+17*REF(A,3)+16*REF(A,4)+15*REF(A,5)+14*REF(A,6)
+13*REF(A,7)+12*REF(A,8)+11*REF(A,9)+10*REF(A,10)+9*REF(A,11)+8*REF(A,12)
+7*REF(A,13)+6*REF(A,14)+5*REF(A,15)+4*REF(A,16)+3*REF(A,17)+2*REF(A,18)+
REF(A,20))/210;
MA101:=MA(CLOSE,10);
周MA101:MA(MA101,5),COLORRED,LINETHICK2;
上翘:IF(周MA101 REF(周MA101,1),周MA101,DRAWNULL),COLORRED,LINETHICK4;
下拐:IF(周MA101 REF(周MA101,1),周MA101,DRAWNULL),COLORGRAY,LINETHICK4;
BOLL:MA(CLOSE,20);
UPPER:BOLL+2*STD(CLOSE,20);
LOWER:BOLL-2*STD(CLOSE,20);
{平台}
N:=26;
T1:=CONST(HHVBARS(V,N));
T0:IF(CURRBARSCOUNT =N+7,CONST(IF(T1=0,C,REF(C,T1))),DRAWNULL),COLORGREEN;
IF(CURRBARSCOUNT=T1+1,T0,DRAWNULL),CIRCLEDOT,COLORBLUE;
DRAWTEXT(ISLASTBAR,T0, 量能平台 ),COLORYELLOW;
{}
均线5:MA(C,5),COLORWHITE;
均线24:MA(C,24),COLORYELLOW;
均线72:MA(C,72),COLORMAGENTA;
快线:EMA(EMA(EMA(EMA(CLOSE,3),3),3),3),LINETHICK2,COLORred;
慢线:EMA(REF(快线,1),3),LINETHICK2,COLOR00FFFF;
总趋势:EMA(EMA(EMA(EMA(EMA(CLOSE,65),3),3),3),3),LINETHICK2,colorblue;
VAR84:=(CLOSE-MA(CLOSE,13))/MA(CLOSE,13)*100;
VAR85:=100-ABS(VAR84);
VAR86:=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);
VAR87:=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);
VAR88:=100-VAR87;
VAR89:=100-VAR86;
VAR92:=MA(100*(CLOSE-LLV(CLOSE,34))/(HHV(HIGH,34)-LLV(LOW,34)),5)-20;
VAR93:=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);
VAR94:=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);
VAR95:=VAR93 REF(VAR94,1)ANDVOL REF(VOL,1)ANDCLOSE REF(CLOSE,1);
VARA:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
VARB:=SMA(VARA,3,1);
VARC:=SMA(VARB,3,1);
VA:=IF(CLOSE REF(CLOSE,1),VOL,-VOL);
OBV:=SUM(IF(CLOSE=REF(CLOSE,1),0,VA),TIMETOSEC(93000));
OBV开盘前:CONST(REF(OBV,FROMOPEN));
五日均:CONST(EMA(OBV,1200)),STICK;
十日均:CONST(EMA(OBV,2400)),STICK;
日20均:CONST(EMA(OBV,4800)),STICK;
OBV3:MA(OBV,3);
OBV24:EMA(OBV,24),COLORYELLOW;
股票公式编写要求:
低且连续下跌的选股公式。
股票公式编写结果:
XG:DOWNNDAY(C,10) AND EVERY(V/CAPITAL*100 5,10);