通达信公式源码概况:
指标类别:通达信公式
授权方式: 免费版
指标评级: ★★★★★
指标分类: 策略
画线方法: 副图
公式解读:
公式源码如下:
TYP:=(H+L+C)/3;
cci:=(TYP-ma(TYP,14))/(0.015*AVEDEV(TYP,14));
COUNT(CCI 100,N)
买线:EMA(C,3);
卖线:EMA(SLOPE(C,21)*20+C,55);
差:=买线-卖线;
STICKLINE(买卖差 =0,(买线-买卖差*0.05),(买线-买卖差*0.15),3,0),COLOR00FFFF;
STICKLINE(买卖差 =0,(买线-买卖差*0.2),(买线-买卖差*0.35),3,0),COLOR00CCFF;
STICKLINE(买卖差 =0,(买线-买卖差*0.4),(买线-买卖差*0.55),3,0),COLOR0099FF;
STICKLINE(买卖差 =0,(买线-买卖差*0.6),(买线-买卖差*0.75),3,0),COLOR0066FF;
STICKLINE(买卖差 =0,(买线-买卖差*0.8),(买线-买卖差*0.95),3,0),COLOR0000CC;
STICKLINE(买卖差 0,(卖线+买卖差*0.05),(卖线+买卖差*0.15),3,0),COLOR006600;
STICKLINE(买卖差 0,(卖线+买卖差*0.2),(卖线+买卖差*0.35),3,0),COLOR009900;
STICKLINE(买卖差 0,(卖线+买卖差*0.4),(卖线+买卖差*0.55),3,0),COLOR00CC00;
STICKLINE(买卖差 0,(卖线+买卖差*0.6),(卖线+买卖差*0.75),3,0),COLOR00FF00;
STICKLINE(买卖差 0,(卖线+买卖差*0.8),(卖线+买卖差*0.95),3,0),COLOR66FF00;
AA:=IF(CURRBARSCOUNT=1ANDPERIOD=5,VOL*240/FROMOPEN,DRAWNULL);
预测:AA/10000,NODRAW,COLORYELLOW;
量:VOL/10000,NODRAW,VOLSTICK,COLORWHITE;
BB:=VOL/((HIGH-LOW)*2-ABS(CLOSE-OPEN));
主动买:=IF(CLOSE OPEN,BB*(HIGH-LOW),IF(CLOSE OPEN,BB*((HIGH-OPEN)+(CLOSE-LOW)),VOL/2));
主买:=主动买/10000;
主动卖:=IF(CLOSE OPEN,0-BB*((HIGH-CLOSE)+(OPEN-LOW)),IF(CLOSE OPEN,0-BB*(HIGH-LOW),0-VOL/2));
主卖:=-主动卖/10000;
买卖差:=ABS(主动买+主动卖)/10000,NODRAW,COLORLIMAGENTA;
买差:IF(主买 主卖,买卖差,DRAWNULL),COLORLIRED,NODRAW;
卖差:IF(主买 主卖,买卖差,DRAWNULL),COLORLICYAN,NODRAW;
换手:VOL/CAPITAL*100,NODRAW,COLORLIMAGENTA;
周换:SUM(V/CAPITAL*100,5),NODRAW,COLORMAGENTA;
MA5:MA(((SLOPE(C,4)*5)+C),5),COLORWHITE,LINETHICK2;
MA18:=MA(((SLOPE(C,10)*5)+C),18);
压力:MA(C,12)*IF(CAPITAL=0,1.035,1.12),LINETHICK1;
支撑:MA(C,10)*IF(CAPITAL=0,0.965,0.92),LINETHICK1;
TJ1:=REF(MA5,1) MA5ANDREF(MA5,1) REF(MA5,2)ANDREF(MA5,2) REF(MA18,2)AND
RANGE(REF(MA5,2),REF(MA5,1),REF(MA5,3))ANDREF(支撑,1)/REF(MA5,1) =0.98;
TJ2:=REF(MA5,1) 压力ANDREF(MA5,1) REF(MA5,2)ANDREF(MA5,1) MA5;
DRAWICON(TJ1,LOW*0.94,1);
DRAWICON(TJ2,1.02*HIGH,2);
100,POINTDOT;
-100,POINTDOT;
TYP:=(HIGH+LOW+CLOSE)/3;
CC1:(TYP-MA(TYP,M))/(0.015*AVEDEV(TYP,M)),COLORFF00FF;
LC:=REF(CLOSE,1);
RSI2:=SMA(MAX(CLOSE-LC,0),12,1)/SMA(ABS(CLOSE-LC),12,1)*100;
RSI3:=SMA(MAX(CLOSE-LC,0),18,1)/SMA(ABS(CLOSE-LC),18,1)*100;
MMS:=MA(3*RSI2-2*SMA(MAX(CLOSE-LC,0),16,1)/SMA(ABS(CLOSE-LC),16,1)*100,3);
MMM:=EMA(MMS,5);
AAA:=MMS-MMM;
STICKLINE(AAA =0,0,AAA*5,2.3,0),colorred;
STICKLINE(AAA 0,0,AAA*5,2.3,0),colorgreen;
TYP:=(HIGH+LOW+CLOSE)/3;
CCI:(TYP-MA(TYP,14))/(0.015*AVEDEV(TYP,14)),colorred,LINETHICK3;
MA(CCI,5),LINETHICK2;
CYC13:=0.01*EXPMA(AMOUNT,13)/EXPMA(VOL,13);
CYS:=(CLOSE-CYC13)/CYC13*2000;
MA(CYS,3);
0;
-100;
100;
F1:=ZIG(C,8);
F3:=IF(F1 =REF(F1,1),0,100);
VARP1:=(CLOSE+LOW+HIGH)/3;
VARP2:=SUM(((VARP1-REF(LOW,1))-(HIGH-VARP1))*VOL/100000/(HIGH-LOW),0);
VARP3:=EMA(VARP2,1);
JCS:=VARP3;
JCM:=MA(VARP3,10);
QJJ:=VOL/((HIGH-LOW)*2-ABS(CLOSE-OPEN));
XVL:=(IF(CLOSE OPEN,QJJ*(HIGH-LOW),IF(CLOSE OPEN,QJJ*(HIGH-OPEN+CLOSE-LOW),VOL/2))+IF(CLOSE OPEN,0-QJJ*(HIGH-CLOSE+OPEN-LOW),IF(CLOSE OPEN,0-QJJ*(HIGH-LOW),0-VOL/2)));
HSL:=(XVL/20)/1.15;
攻击流量:=((HSL*0.55+(REF(HSL,1)*0.33))+(REF(HSL,2)*0.22));
LLJX:=EMA(攻击流量,3);
流量:=LLJX,colorred,LINETHICK2;
XXX:=F3=0AND(CROSS(资金流量,0)ANDCROSS(JCS,JCM));
YYY:=(F3=0ANDCROSS(REF(资金流量,1),0)ANDCROSS(JCS,JCM));
ZZZ:=(F3=0ANDCROSS(资金流量,0)ANDCROSS(REF(JCS,1),REF(JCM,1)));
DRAWTEXT(XXXORYYYORZZZ,-120, 买入 ),coloryellow;
MA05:=MA(C,3),LINETHICK3,COLOR00CCFF;
MA10:=MA(C,10);
MA20:=MA(C,20);
MA30:=MA(C,30);
五日乖离率:=(C-MA05)/MA05*100;
BB05:=ATAN((MA05/REF(MA05,1)-1)*100)*180/3.1416;
速度5:=SMA(EMA((MA05-REF(MA05,1))/REF(MA05,1),3)*100,3,1);
加速度5:=EMA((速度5-REF(速度5,1)),3),NODRAW;
BB10:=ATAN((MA10/REF(MA10,1)-1)*100)*180/3.1416;
三拾日乖离率:=(C-MA30)/MA30*100,NODRAW;
VAR111:=(MA20-MA30) REF((MA20-MA30),1)ANDMA20 REF(MA20,1)ANDMA30 REF(MA30,1);
VAR22:=(MA30-MA20) REF((MA30-MA20),1)ANDMA20 REF(MA20,1)ANDMA30 REF(MA30,1);
BB30:=ATAN((MA30/REF(MA30,1)-1)*100)*180/3.1416;
强势狙击:=FILTER(BB30 30ANDBB10 45ANDCROSS(BB05,60),10);
加仓:=FILTER(COUNT(CROSS(BB05,30),5) =1ANDMA05 REF(MA05,1)AND三拾日乖离率 REF(三拾日乖离率,1)ANDMA10 REF(MA10,1)
AND加速度5 REF(加速度5,1)AND速度5 REF(速度5,1),10);
清仓:=FILTER(COUNT(CROSS(30,BB05),5) =1AND(C MA30ORO MA30)ANDMA05 REF(MA05,1)AND三拾日乖离率 REF(三拾日乖离率,1)ANDMA10 REF(MA10,1),10);
DRAWTEXT(加仓,-20, 加码 ),colorred;
JC:=CROSS(0,五日乖离率)AND三拾日乖离率 REF(三拾日乖离率,1)ANDMA10 REF(MA10,1);
减仓:=FILTER(JC,10);
MR:=COUNT(CROSS(五日乖离率,0),3) =1AND三拾日乖离率 REF(三拾日乖离率,1)ANDMA05 REF(MA05,1)AND(C/REF(C,1)-1)*100 5ANDREF(C,1) MA30;
买入:=FILTER(MR,10);
DRAWTEXT(减仓,100, 风险 ),colorcyan;
C1:=SMA(CC1,3,1);
C2:=SMA(C1,3,1);
C3:=3*C1-2*C2;
CB1:=EMA(C3,5);
CB2:=REF(CB1,1);
DRAWBAND(CC1,RGB(0,244,244),0,RGB(255,200,90));
DRAWBAND(100,0,-100,0);
100,POINTDOT;
-100,POINTDOT;
LC:=REF(CLOSE,1);
RSI1:=SMA(MAX(CLOSE-LC,0),N1,1)/SMA(ABS(CLOSE-LC),N1,1)*100;
RSI:(RSI1-50)*5,LINETHICK2,COLORFFFFFF;
R1:=SMA(RSI,3,1);
D1:=SMA(R1,3,1);
J1:=3*R1-2*D1;
RR1:=EMA(J1,5);
RR2:=REF(RR1,1);
RR:=RR1
RSV:=(CLOSE-LLV(LOW,N))/(HHV(HIGH,N)-LLV(LOW,N))*100;
K:=SMA(RSV,3,1);
K1:(K-50)*5,COLOR00FF00;
K2:=SMA(K1,3,1);
D2:=SMA(K2,3,1);
J2:=3*K2-2*D2;
BB1:=EMA(J2,5);
BB2:=REF(BB1,1);
买入:RRANDNOT(REF(RR,1))AND(RR1 -100ANDBB1 -100)ANDCB1 -100,LINETHICK0;
DRAWICON(买入,-200,1);
卖出:REF(RR,1)=1ANDNOT(RR)ANDCB1 100,LINETHICK0;
DRAWICON(卖出,200,2);
100,POINTDOT;
-100,POINTDOT,COLOR52F8FF;
CC2:(TYP-MA(TYP,M))/(0.015*AVEDEV(TYP,M)),COLORFF00FF;
额:AMOUNT/100000000,NODRAW,COLORYELLOW;
STICKLINE(C O,0,量,1,1),COLOR0000AA;
STICKLINE(C O,0,量,1,0),COLORCYAN;
STICKLINE(主买 主卖,0,买卖差,1,0),COLORLIRED;
STICKLINE(主买 主卖,0,买卖差,1,0),COLORLICYAN;
STICKLINE(CURRBARSCOUNT=1ANDPERIOD=5,预测,1.5,2,1),COLORFFFFFF;
M5:MA(V,5)/10000,COLORWHITE;
M13:MA(V,13)/10000,COLORYELLOW;
M21:MA(V,21)/10000,COLORGREEN;
公式解读:
AA赋值:平滑异同平均的DIF上穿平滑异同平均的DEA
BB赋值:上次AA距今天数
输出XG:BB =4 AND 最近BB日一直存在平滑异同平均的DIF =平滑异同平均的DEA