通达信指标公式源码概况:
指标类别: 通达信指标公式
授权方式: 免费版
指标评级: ★★★★★
指标分类: 策略
画线方法: 副图
一、资金动力指标公式源码
AJ:=VOL*CLOSE;
BJ:=SUM(AJ,1)/SUM(VOL,1);
B1J:=EMA(BJ,8);
主力J:=(BJ-B1J)*100/BJ;
DRAWBAND(主力J,RGB(250,180,80),0,RGB(0,180,180));
DRAWBAND(3*(EMA(C,3)-EMA(C,8)-EMA(EMA(C,3)-EMA(C,8),20))*2,RGB(250,0,00),0,RGB(0,80,180));
MA1:=MA(CLOSE,5);
MA2:=MA(CLOSE,10);
MA3:=MA(CLOSE,30);
MA4:=MA(CLOSE,60);
XG:COUNT(C>MA(C,5),3)=3{连续5日最低价大于5日均线} AND MA2>MA3 AND MA1>MA4 AND MA4>MA3 AND MA4>=MA2 AND REF(MA2,3)<REF(MA3,3);
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)) AND ZXNH);
低进:IF(黄金 AND RSVV<VARB2-2,2,0);
X:=(H-MAX(C,O))/ABS(C-O)>2 AND REF(L,1)/HHV(H,5)<0.96 AND REF(H,4)=REF(HHV(H,4),1) AND O/REF(C,1)>1.01 AND O/REF(C,1)<1.04;
SK:=COUNT(C/REF(C,1)<1.03,3)=3 AND REF(COUNT((C+O)<REF(C+O,1),2)=2,1) AND REF(HHV(H,20),1) =REF(HHV(H,4),1);
X4:=(H-MAX(C,O))/ABS(C-O)>2 AND REF(L,1)/HHV(H,6)<0.95 AND REF(H,5)=REF(HHV(H,5),1) AND O/REF(C,1)>1.01 AND O/REF(C,1)<1.04;
SK4:=COUNT(C/REF(C,1)<1.03,4)=4 AND REF(COUNT((C+O)<REF(C+O,1),3)=3,1) AND REF(HHV(H,20),1) =REF(HHV(H,5),1);
短线狙击:((X AND SK) OR (X4 AND SK4)) ;
MA111:=MA(CLOSE,20);
MA112:=MA(CLOSE,40);
MA113:=MA(CLOSE,60);
A11:=OPEN<MA111 OR OPEN<MA112 OR OPEN<MA113;
A12:=C>MAX(MA111,MAX(MA112,MA113));
A13:=V/MA(V,30)>1.2;
A14:=C/REF(C,1)>1.049;
生命:=EXPMA(EXPMA(CLOSE,50),1);
半:=MA(CLOSE,125);
年:=MA(CLOSE,240);
涨幅%:=(C-REF(C,1))/REF(C,1)*100;
换手率%:=HSL;
条件:=C>生命 AND 生命>半 AND 半>年 AND 涨幅%>6.5 AND 换手率%>6;
黑马:=A11 AND A12 AND A13 AND A14 AND 条件;
MA5:=MA(CLOSE,120);
A:=MAX(MAX(MAX(MA1,MA2),MAX(MA3,MA4)),MA5);
B:=MIN(MIN(MIN(MA1,MA2),MIN(MA3,MA4)),MA5);
LL:=BARSLAST(O<=B AND C>=A )=0;
KK: LL AND 黑马;
M2:=EMA(C,2);
M18:=EMA(C,18);
买点:=IF(CROSS(M18,M2),5,0* 10000),COLORFF00FF,LINETHICK2;
明天卖:买点 AND 低进 COLORYELLOW,LINETHICK3;
KTB:=SMA((CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100,3,1);
DTB:=SMA(KTB,3,1);
JTB:=3*KTB-2*DTB;
DI:="macd.MACD">0;
准确出击:CROSS(CLOSE,REF(EMA(DMA((((HIGH+LOW)+(CLOSE*2))/4.15),0.9),3),1))AND JTB<55 AND DI;
X1:=(C-REF(C,1))/REF(C,1)*100>=3;
X2:=COUNT( EVERY(C>O,2),BARSLAST( EVERY(C>O,2)=0))=1&& EVERY(C>O,2);
预选:=(X1||X2)*4,COLORGREEN;{//选出放在自选池中关注}
X3:=X1&& EVERY(C>O,2);
X44:=CROSS(REF(C,1),L);
X5:=FILTER(X2||X3||X44,3)&&REF(X1,1);
低位介入:=(FILTER(X3||X5,3)&&REF(预选,1));
每日3%:预选 AND 低位介入;
买入必涨:(((((CLOSE / REF(CLOSE,1)) >= 1.07) AND ((HIGH / CLOSE) < 1.005)) AND ((MA (CLOSE,90) / CLOSE) >1.48)))*1.5;
VAR1D:=(INDEXC-MA(INDEXC,58))/MA(INDEXC,58)<-0.152;
VAR2D:=(C-EMA(C,58))/EMA(C,58)<-0.19;
中短买入:COUNT(VAR2D AND VAR1D,2);
AA8:=LLV(L,34);
XD:=SMA(ABS(L-REF(L,1)),34,1);
CD:=SMA(MAX(L-REF(L,1),0),34,2);
收盘买:=-(EMA(IF(L<=AA8,XD/CD,-3),9));
明天卖2:收盘买<0 AND 收盘买>REF(收盘买,1) AND REF(EVERY(收盘买<REF(收盘买,1),3),1);
CYC13:=0.01*EXPMA(AMOUNT,13)/EXPMA(VOL,13);
CYS:=(CLOSE-CYC13)/CYC13*100;
平衡:=0;
RSVX:=(C-LLV(L,9))/(HHV(H,9)-LLV(L,9))*100;
K:=SMA(RSVX,3,1);
D:=SMA(K,3,1);
J:=3*K-2*D;
A1:=CROSS(J,REF(J+0.01,1)) AND J<20;
YX:=C<O;
低点介入:"ZXNH.ZXNH" AND CYS<0 AND A1 AND REF(YX,1);
AA:=REF(MA(C,5),1)<MA(C,5) ;
FF:=EMA(CLOSE,3);
MA15:=EMA(CLOSE,21);
BB:=CROSS(C,MA(C,5)) AND CROSS(C,MA(C,10)) ;
CC:=CROSS(C,MA(C,20)) AND REF(C<O,1) AND REF(C<O,2);
主升浪:(CROSS(FF,MA15) AND AA AND BB AND CC)*3,COLORRED ;
LC:=REF(CLOSE,1);
AAV:=(CLOSE-MA(CLOSE,34))/MA(CLOSE,34)*100;
XGV:=CROSS(-13,AAV);
RSI:=(SMA(MAX(CLOSE-LC,0),21,1)/SMA(ABS(CLOSE-LC),21,1)*20);
BBV:=MA(RSI,34);
CCV:=BBV-2.5*STD(RSI,34);
CF:=C>L;
成功率87.3%:(XGV AND CF AND RSI<CCV)*3,COLORGREEN;
A01:=(C-LLV(LOW,3))/(HHV(HIGH,3)-LLV(LOW,3));
A11A:=SMA(A01,2,1);
A21:=SMA(A11A,2,1);
A31:=3*A11A-2*A21 ;
A41:=2*A31-0.5;
生命线:=C*(1-(A41-A21)/15),COLORBLUE,LINETHICK2;
A线:=HHV(H,20);
B线:=LLV(L,20);
C线:=(A线+B线)/2;
做多线:=IF(C线,C线,DRAWNULL)COLORFF00FF,LINETHICK2;
进场:(CROSS(生命线,做多线) AND REF(做多线,1)<做多线 AND C>生命线)*5;
L1:=13;M:=9;N:=3;
VDI:=HHV(VOL,L1)-LLV(VOL,L1);
VDF:=VOL-LLV(VOL,L1);
SVI:=MA(VDF/VDI*100,M),COLORBLUE;
SVIS:=MA(SVI,N),COLORLIGREEN;
JDI:=HHV(CLOSE,L1)-LLV(CLOSE,L1);
JDF:=C-LLV(CLOSE,L1);
SJI:=MA(JDF/JDI*100,M),COLORRED;
SJF:=MA(SJI,N),COLORMAGENTA;
DH:(SVI+SJI)/2;
DL:(SVIS+SJF)/2;
VAR1:=(2*CLOSE+HIGH+LOW)/4;
VAR2:=EXPMA(EXPMA(EXPMA(VAR1,4),4),4);
J:= (VAR2-REF(VAR2,1))/REF(VAR2,1)*100;
D:=MA(J,3);
K:=MA(J,1);
DRAWICON(CROSS(DH,DL) AND DL<50 AND K>D,DL,1);
STICKLINE(DH>=25 AND DL<=75 AND DH>DL,DH,DL,0.1,1),COLORLIRED;
底线:15,COLORGREEN;
顶线:75,COLORYELLOW;
二、流动资金指标公式源码
资金线:=AMOUNT/CAPITAL,LINETHICK2;
E10:EMA(资金线,10);
ZX1:MAX(H,MAX(C,MAX(O,L))),COLORRED,LINETHICK2;
STICKLINE(ZX1<E10,ZX1,E10,1,1);
VAR1:=SMA(AMOUNT/10,10,1)/10000;
VAR2:=REF(VAR1,1);
VAR3:=SMA(AMOUNT/10,10,1)/10000;
资金运转:STICKLINE(VAR1>VAR2,VAR1,VAR2,8,0),colorred;
资金流失:STICKLINE(VAR1<VAR2,VAR1,VAR2,8,0),colorgreen;
起跑线:MA(VAR1,5);警戒线:MA(VAR1,10),coloryellow;
分界线:MA(VAR1,30),colorcyan;DRAWTEXT(CROSS(警戒线,VAR3),警戒线*1.2,'警'),colorwhite;DRAWTEXT(CROSS(分界线,VAR3),分界线*1.2,'走')
DRAWGBK(CURRBARSCOUNT=1,RGB(110,108,108),RGB(88,30,0),0,'',0);
LY:=10;
BL:=40;
CJQS:=XMA(CLOSE,LY);
JBQS:=XMA(CLOSE,BL);
N:=REF(JBQS,BL/2+1-CURRBARSCOUNT)/REF(JBQS,BL/2+2-CURRBARSCOUNT);
M:=REF(CJQS,LY/2+1-CURRBARSCOUNT)/REF(CJQS,LY/2+2-CURRBARSCOUNT);
JB上轨:IF(CURRBARSCOUNT>BL/2,JBQS*1.1,REF(JBQS,BL/2+1-CURRBARSCOUNT)*POW(N,BL/2+1-CURRBARSCOUNT)*1.1);
JB下轨:IF(CURRBARSCOUNT>BL/2,JBQS*0.9,REF(JBQS,BL/2+1-CURRBARSCOUNT)*POW(N,BL/2+1-CURRBARSCOUNT)*0.9);
CJ上轨:IF(CURRBARSCOUNT>LY/2,CJQS*1.05,REF(CJQS,LY/2+1-CURRBARSCOUNT)*POW(M,LY/2+1-CURRBARSCOUNT)*1.05);
CJ下轨:IF(CURRBARSCOUNT>LY/2,CJQS*0.95,REF(CJQS,LY/2+1-CURRBARSCOUNT)*POW(M,LY/2+1-CURRBARSCOUNT)*0.95);
{立桩量}
TJ:=VOL>=REF(V,1)*1.91ANDC>REF(C,1)*1.01;
STICKLINE(TJ,C,O+(C-O)/2,1,0),COLOR00FFFF;
{一穿三:5、10、20}
MA1:=MA(CLOSE,5);
MA2:=MA(CLOSE,10);
MA3:=MA(CLOSE,20);
一穿三:=MA1>OANDMA2>OANDMA3>OANDMA1<CANDMA2<CANDMA3<CANDCLOSE>OPEN;
STICKLINE(一穿三,O,O+(C-O)/2,1,0),COLORFF00FF;
AAA2:=SUM(IF(CLOSE>REF(CLOSE,1),VOL*C,0),0);
AAA3:=SUM(IF(CLOSE<REF(CLOSE,1),VOL*C,0),0);
AAA4:=SUM(IF(CLOSE=REF(CLOSE,1),VOL*C,0),0);
BB1:=0;
B1万元:=DVOL*DCLOSE/100;
B1差:=B1万元-REF(B1万元,1);
B2万元:=DVOL*DCLOSE/100;
B2比:=B2万元/REF(B2万元,1);
净流入万元:=(AAA2-AAA3-0.5*AAA4);
PM:=MA(净流入万元,1);
PMA:=PM/REF(PM,1)>1;
PMB:=REF(PMA,1)<1ANDPMA;
密码:(EMA(MA(B1万元,2),2))/100000,COLORYELLOW,NODRAW;
二日比:=密码/REF(密码,1);
选股:PMBAND密码>REF(密码,1)AND二日比>1,COLORRED,NODRAW;
Y:=CLOSE/REF(CLOSE,1)>1.07;
X:=VOL>MA(VOL,5);
A1:=YANDX;
TTL:=SMA(V,10,1);
LLH:=TTL*H/10;
LLL:=TTL*L/10;
LLC:=TTL*C/10;
LLO:=REF(LLC,1);
MAV5:=MA(LLC,5);
STICKLINE(LLC>MAV5,LLH,LLL,1,0),COLORFF0000;
STICKLINE(LLC>MAV5,LLC,LLO,3,1),COLORFF0000;
STICKLINE(LLC<MAV5,LLC,LLO,3,0),COLORFFFF00;
STICKLINE(LLC<MAV5,LLH,LLL,1,0),COLORFFFF00;
STICKLINE(CROSS(LLC,MAV5),LLH,LLL,1,0),COLORRED;
STICKLINE(CROSS(LLC,MAV5),LLC,LLO,3,1),COLORRED;
STICKLINE(CROSS(MAV5,LLC),LLC,LLO,3,0),COLORYELLOW;
STICKLINE(CROSS(MAV5,LLC),LLH,LLL,1,0),COLORYELLOW;
X1:=EMA(LLC,3),COLORWHITE;
X2:=EMA(LLC,5),COLORYELLOW;
主线:EMA(X2,8),COLORGREEN;
VBR1:EMA(LLC,3),COLORWHITE;
VBR2:EMA(LLC,5),COLORYELLOW;
STICKLINE(VBR1>VBR2,VBR2,VBR1,0.01,0),COLORRED;
STICKLINE(VBR1<VBR2,VBR1,VBR2,0.01,0),COLORYELLOW;
DRAWTEXT(CROSS(VBR2,VBR1),VBR1,'★止损'),COLORGREEN;
DRAWTEXT(CROSS(VBR1,VBR2),VBR1,'★加仓'),COLORRED;
N:=9;
MID:=SMA(AMOUNT/10,N,1)/10000;
MA0:=MA(MID,30);
MA1:=MA(MID,1);
A1:=MA1-MA0;
MA2:=MA(MID,2);
A2:=MA2-MA0;
MA3:=MA(MID,3);
A3:=MA3-MA0;
MA4:=MA(MID,4);
A4:=MA4-MA0;
MA5:=MA(MID,5);
A5:=MA5-MA0;
MA6:=MA(MID,6);
A6:=MA6-MA0;
MA7:=MA(MID,7);
A7:=MA7-MA0;
MA8:=MA(MID,8);
A8:=MA8-MA0;
MA9:=MA(MID,9);
A9:=MA9-MA0;
MA10:=MA(MID,10);
A10:=MA10-MA0;
MA11:=MA(MID,11);
A11:=MA11-MA0;
MA12:=MA(MID,12);
A12:=MA12-MA0;
MA13:=MA(MID,13);
A13:=MA13-MA0;
MA14:=MA(MID,14);
A14:=MA14-MA0;
MA15:=MA(MID,15);
A15:=MA15-MA0;
MA16:=MA(MID,16);
A16:=MA16-MA0;
MA17:=MA(MID,17);
A17:=MA17-MA0;
MA18:=MA(MID,18);
A18:=MA18-MA0;
MA19:=MA(MID,19);
A19:=MA19-MA0;
MA20:=MA(MID,20);
A20:=MA20-MA0;
MA21:=MA(MID,21);
A21:=MA21-MA0;
MA22:=MA(MID,22);
A22:=MA22-MA0;
MA23:=MA(MID,23);
A23:=MA23-MA0;
MA24:=MA(MID,24);
A24:=MA24-MA0;
MA25:=MA(MID,25);
A25:=MA25-MA0;
MA26:=MA(MID,26);
A26:=MA26-MA0;
MA27:=MA(MID,27);
A27:=MA27-MA0;
MA28:=MA(MID,28);
A28:=MA28-MA0;
MA29:=MA(MID,29);
A29:=MA29-MA0;
MA30:=MA(MID,30);
A30:=MA30-MA0;
MA31:=MA(MID,31);
A31:=MA31-MA0;
MA32:=MA(MID,32);
A32:=MA32-MA0;
MA33:=MA(MID,33);
A33:=MA33-MA0;
MA34:=MA(MID,34);
A34:=MA34-MA0;
MA35:=MA(MID,35);
A35:=MA35-MA0;
MA36:=MA(MID,36);
A36:=MA36-MA0;
MA37:=MA(MID,37);
A37:=MA37-MA0;
MA38:=MA(MID,38);
A38:=MA38-MA0;
MA39:=MA(MID,39);
A39:=MA39-MA0;
MA40:=MA(MID,40);
A40:=MA40-MA0;
{A1+A2+A3+A4+A5++A21+A22+A23+A24+A25+A26+A27+A28+A29+A30}
LC:(A6+A7+A8+A9+A10+A11+A12+A13+A14+A15+A16+A17+A18+A19+A20)/30,LINETHICK0,COLORYELLOW;
VAR1:=LC;
VAR2:=REF(LC,1);
VAR3:=VAR1>VAR2ANDREF(LC,1)<REF(LC,2);
VAR4:=VAR1<VAR2ANDREF(LC,1)>REF(LC,2);
均线发散:STICKLINE(VAR1>VAR2,LC,REF(LC,1),2,1),COLORRED;
均线粘合:STICKLINE(VAR1<VAR2,LC,REF(LC,1),2,1),COLORGREEN;
EMA5:MA(VAR1,5),COLOR666666;
EMA10:MA(VAR1,10),COLOR999999;
B1:=BARSLAST(MA20>REF(MA20,1));
DRAWTEXT(VAR3ANDMA20<REF(MA20,1)ANDCOUNT(VAR3,B1)=1,0.95*REF(LC,1),'1'),COLORYELLOW;
DRAWTEXT(VAR3ANDMA20<REF(MA20,1)ANDCOUNT(VAR3,B1)=2,0.95*REF(LC,1),'2'),COLORYELLOW;
DRAWTEXT(VAR3ANDMA20<REF(MA20,1)ANDCOUNT(VAR3,B1)=3,0.95*REF(LC,1),'3'),COLORYELLOW;
DRAWTEXT(VAR3ANDMA20<REF(MA20,1)ANDCOUNT(VAR3,B1)=4,0.95*REF(LC,1),'4'),COLORYELLOW;
DRAWTEXT(VAR3ANDMA20<REF(MA20,1)ANDCOUNT(VAR3,B1)=5,0.95*REF(LC,1),'5'),COLORYELLOW;
B2:=BARSLAST(MA20<REF(MA20,1));
DRAWTEXT(VAR4ANDMA20>REF(MA20,1)ANDCOUNT(VAR4,B2)=1,1.05*REF(LC,1),'1');
DRAWTEXT(VAR4ANDMA20>REF(MA20,1)ANDCOUNT(VAR4,B2)=2,1.05*REF(LC,1),'2');
DRAWTEXT(VAR4ANDMA20>REF(MA20,1)ANDCOUNT(VAR4,B2)=3,1.05*REF(LC,1),'3');
DRAWTEXT(VAR4ANDMA20>REF(MA20,1)ANDCOUNT(VAR4,B2)=4,1.05*REF(LC,1),'4');
MACD:=(EMA5-EMA10)*2,COLORSTICK;
{此段为MACD柱变色}
{STICKLINE(((MACD>REF(MACD,1))AND(MACD>0)),0,MACD,0,0),COLOR0000BB;
STICKLINE(((MACD<REF(MACD,1))AND(MACD>0)),0,MACD,0,0),COLORLIGREEN;
STICKLINE(((MACD>REF(MACD,1))AND(MACD<0)),0,MACD,0,0),COLORFFFF00;
STICKLINE(((MACD<REF(MACD,1))AND(MACD<0)),0,MACD,0,0),COLOR333333;}
减速上行:STICKLINE(VAR1>REF(VAR1,1)ANDMACD<REF(MACD,1),VAR1,REF(VAR1,1),2,1),COLORLIRED;
减速下行:STICKLINE(VAR1<REF(VAR1,1)ANDMACD>REF(MACD,1),VAR1,REF(VAR1,1),2,1),COLORFFFF00;
A1:=V>REF(MA(V,20),1)*3ANDV>REF(MA(V,3),1)*2;
A2:=C>REF(HHV(C,20),1)ANDREF(HHV(H,12)/LLV(L,20),1)<1.15;
A3:=A1ANDA2ANDC>O*1.033;
A4:=REF(A3,3)ANDHHV(H,3)/LLV(L,3)<REF(H/L,3)
ANDLLV(L,3)>REF(O,3)ANDLLV(C,3)>REF((C+O)/2,3);
SS:10*A4;
[源码注释]通达信公式动态翻译结果
(1日前的成交量(手)<成交量(手)的5日简单移动平均 OR 1日前的成交量(手)<成交量(手)的10日简单移动平均)AND 成交量(手)>成交量(手)的10日简单移动平均 AND 成交量(手)>成交量(手)的5日简单移动平均 AND 收阳线AND 收盘价>1日前的收盘价 AND (最高价-收盘价)<(收盘价-最低价)AND 收盘价>平滑异同平均的DEA AND 收盘价>收盘价的20日简单移动平均
推荐阅读:能量指标公式源码
MOBV:=OBV-MA(OBV,30);
STICKLINE(MOBV>0,0,MOBV,1,0),COLORRED;
STICKLINE(MOBV<0,0,MOBV,1,0),COLORCYAN;
OBV高:=REF(OBV,BARSLAST(FILTER(BACKSET(FILTER(REF(OBV,5)=HHV(OBV,2*5+1),5),5+1),5)));
obv:=SUM(IF(CLOSE>REF(CLOSE,1),VOL,IF(CLOSE<REF(CLOSE,1),-VOL,0)),0)/100000;
obv1:=ma(SUM(IF(CLOSE>REF(CLOSE,1),VOL,IF(CLOSE<REF(CLOSE,1),-VOL,0)),1)/10000,1);
obv2:=ma(SUM(IF(CLOSE>REF(CLOSE,1),VOL,IF(CLOSE<REF(CLOSE,1),-VOL,0)),1)/10000,2);
obv3:=ma(SUM(IF(CLOSE>REF(CLOSE,1),VOL,IF(CLOSE<REF(CLOSE,1),-VOL,0)),1)/10000,3);
obv4:=ma(SUM(IF(CLOSE>REF(CLOSE,1),VOL,IF(CLOSE<REF(CLOSE,1),-VOL,0)),1)/10000,4);
obv5:=ma(SUM(IF(CLOSE>REF(CLOSE,1),VOL,IF(CLOSE<REF(CLOSE,1),-VOL,0)),1)/10000,5);
obv6:=ma(SUM(IF(CLOSE>REF(CLOSE,1),VOL,IF(CLOSE<REF(CLOSE,1),-VOL,0)),1)/10000,6);
obv7:=ma(SUM(IF(CLOSE>REF(CLOSE,1),VOL,IF(CLOSE<REF(CLOSE,1),-VOL,0)),1)/10000,7);
obv8:=ma(SUM(IF(CLOSE>REF(CLOSE,1),VOL,IF(CLOSE<REF(CLOSE,1),-VOL,0)),1)/10000,8);
obv9:=ma(SUM(IF(CLOSE>REF(CLOSE,1),VOL,IF(CLOSE<REF(CLOSE,1),-VOL,0)),1)/10000,9);
obv10:=ma(SUM(IF(CLOSE>REF(CLOSE,1),VOL,IF(CLOSE<REF(CLOSE,1),-VOL,0)),1)/10000,10);
obv11:=ma(SUM(IF(CLOSE>REF(CLOSE,1),VOL,IF(CLOSE<REF(CLOSE,1),-VOL,0)),1)/10000,11);
obv12:=ma(SUM(IF(CLOSE>REF(CLOSE,1),VOL,IF(CLOSE<REF(CLOSE,1),-VOL,0)),1)/10000,12);
obv13:=ma(SUM(IF(CLOSE>REF(CLOSE,1),VOL,IF(CLOSE<REF(CLOSE,1),-VOL,0)),1)/10000,13);
obv14:=ma(SUM(IF(CLOSE>REF(CLOSE,1),VOL,IF(CLOSE<REF(CLOSE,1),-VOL,0)),1)/10000,14);
obv15:=ma(SUM(IF(CLOSE>REF(CLOSE,1),VOL,IF(CLOSE<REF(CLOSE,1),-VOL,0)),1)/10000,15);
obv16:=ma(SUM(IF(CLOSE>REF(CLOSE,1),VOL,IF(CLOSE<REF(CLOSE,1),-VOL,0)),1)/10000,16);
obv17:=ma(SUM(IF(CLOSE>REF(CLOSE,1),VOL,IF(CLOSE<REF(CLOSE,1),-VOL,0)),1)/10000,17);
obv18:=ma(SUM(IF(CLOSE>REF(CLOSE,1),VOL,IF(CLOSE<REF(CLOSE,1),-VOL,0)),1)/10000,18);
obv19:=ma(SUM(IF(CLOSE>REF(CLOSE,1),VOL,IF(CLOSE<REF(CLOSE,1),-VOL,0)),1)/10000,19);
obv20:=ma(SUM(IF(CLOSE>REF(CLOSE,1),VOL,IF(CLOSE<REF(CLOSE,1),-VOL,0)),1)/10000,20);
obvzh1:=(obv1*20+obv2*19+obv3*18+obv4*17+obv5*16+obv6*15+obv7*14+obv8*13+obv9*12+obv10*11+obv10*11+obv12*9+obv13*8+obv14*7+obv15*6+obv16*5+obv17*4+obv18*3+obv19*2+obv20*1)/210;
{obvzh:=EMA(((SLOPE(obv,21)*20)+obv),42);
obvm:=ema(obv,3);}
obvj:=sma(obvzh1,2,1);
obvj2:sma(obvj,2,1);
obvj3:sma(obvj2,5,1);
obvj4:ma(obvj3,3);
{stickline(obvj>=ref(obvj,1),obvj,ref(obvj,1),8,1),colorred,;
stickline(obvj<ref(obvj,1),obvj,ref(obvj,1),8,0),colorff9900;}
opent:=ref(obvj,1);
closet:=ref(obvj,0);
B0:=REF(CLOSEt-OPENT,2);
B1:=REF(CLOSET,1);
B2:=REF(CLOSET,2);
B3:=REF(CLOSET,3);
B4:=REF(CLOSET,4);
CMAX:=MAX(MAX(MAX(CLOSET,B1),B2),B3);
CMIN:=MIN(MIN(MIN(CLOSET,B1),B2),B3);
STICKLINE(CLOSET=CMAXAND(B1>=B2ORB1>=B3)ORB1=CMAXAND(B2=CMINORB3=CMIN)ANDCLOSET>=B2ORB2=CMAXANDB3=CMINANDCLOSET>=B1ORB3=CMAXANDCLOSET>=B1ANDCLOSET>=B2,B1,CLOSET,5,1),colorred;
STICKLINE(CLOSET=CMAXANDB1=CMIN,B2,CLOSET,5,1),colorred;
STICKLINE(CLOSET=CMINAND(B1<B2ORB1<B3)ORB1=CMINAND(B2=CMAXORB3=CMAX)ANDCLOSET<B2ORB2=CMINANDB3=CMAXANDCLOSET<B1ORB3=CMINANDCLOSET<B1ANDCLOSET<B2,B1,CLOSET,5,0),colorgreen;
STICKLINE(B1=CMAXANDCLOSET=CMIN,B2,CLOSET,5,0),colorgreen;
STICKLINE(B1=CMINANDCLOSET>=B2OR(B2=CMINANDB1<=B3ORB3=CMINANDB1<=B2)ANDB2<B4ANDCLOSET>=B1,B1,B2,5,0),colorgreen;
STICKLINE(B1=CMAXANDCLOSET<B2OR(B2=CMAXANDB1>B3ORB3=CMAXANDB1>B2)ANDB2>=B4ANDCLOSET<B1,B1,B2,5,1),colorred;
C高:REF(C,BARSLAST(FILTER(BACKSET(FILTER(REF(C,5)=HHV(C,2*5+1),5),5+1),5))),NODRAW;
量入为主:CROSS(OBV,OBV高)ANDH<C高,NODRAW;
STICKLINE(量入为主,0,MOBV,1,0),COLORYELLOW;
N:=26;
M1:=5;
M2:=20;
M3:=40;
M4:=62;
MID:=REF(HIGH+LOW,1)/2;
CRR:=SUM(MAX(0,HIGH-MID),N)/SUM(MAX(0,MID-LOW),N)*100;
RCC:=SUM(MIN(0,L-MID),N)/SUM(MIN(0,MID-H),N)*100;
CR:if(CRR>200,200,CRR),COLORWHITE;
RC:if(RCC>200,200,RCC),COLORCYAN;
STICKLINE(CR<50ANDCR>20,40,50,8,0),COLORMAGENTA;
STICKLINE(CR<40ANDCR>20,40,30,8,0),COLORYELLOW;
STICKLINE(CR<30ANDCR>20,20,30,8,0),COLORRED;
STICKLINE(RC<50ANDRC>20,180,170,8,0),COLORCYAN;
STICKLINE(RC<40ANDRC>20,190,180,8,0),COLORBLUE;
STICKLINE(RC<30ANDRC>20,200,190,8,0),COLORGREEN;
DRAWGBK(C>0,RGB(1,0,1),RGB(1,0,1),0,'0',0);
NN:=26;M1:=10;M2:=20;M3:=40;M4:=62;
MID:=REF(HIGH+LOW,1)/2;
CR:SUM(MAX(0,HIGH-MID),NN)/SUM(MAX(0,MID-LOW),NN)*100,NODRAW,COLORWHITE;
STICKLINE(C>0,REFDATE(LLV(CR,120),DATE),90,28,-1)COLORLICYAN;
STICKLINE(C>0,REFDATE(LLV(CR,120),DATE),40,28,-1)COLORYELLOW;
DRAWTEXT(ISLASTBAR,90,'██'),COLORBLACK;
DRAWTEXT(ISLASTBAR,90,'90')COLORCYAN;
MA1:REF(MA(CR,M1),M1/2.5+1)NODRAW,COLORYELLOW;
MA2:REF(MA(CR,M2),M2/2.5+1)NODRAW,COLORMAGENTA;
MA3:REF(MA(CR,M3),M3/2.5+1)NODRAW,COLORGREEN;
MA4:REF(MA(CR,M4),M4/2.5+1)NODRAW,COLORCYAN;
DRAWBAND(MA3,RGB(80,16,0),MA4,RGB(80,64,64));
DRAWBAND(MA1,RGB(150,50,50),MA2,RGB(0,50,150));
NOTEXT:SUM(MAX(0,HIGH-MID),NN)/SUM(MAX(0,MID-LOW),NN)*100,COLORWHITE,LINETHICK2;
DRAWTEXT(ISLASTBAR,CR,'←CR'),COLORWHITE;
STICKLINE(CROSS(CR,MA1),REFDATE(HHV(CR,120),DATE),REFDATE(LLV(CR,120),DATE),0,-1)COLORYELLOW;
AA1:=CR>MA1ANDCR>MA2ANDCR>MA3ANDCR>MA4;
AA2:=AA1ANDAA1!=REF(AA1,1);
STICKLINE(AA2,REFDATE(HHV(CR.CR,120),DATE),CR,0,-1)COLORRED;
{}
DRAWTEXT_FIX(1,0.40,0.00,0,'黄虚线–CR上穿MA1(可能有行情);红虚线–CR同时大于4线(强势);'),COLORWHITE;
每日公式解答:
股票公式编写要求:
5日前macd周金叉选股公式。
股票公式编写结果:
BETWEEN(BARSLAST(CROSS(MACD.DIF#WEEK>MACD.DEA#WEEK,0.5)),10,20);
评论(0)