通达信指标公式源码概况:
指标类别: 通达信指标公式
授权方式: 免费版
指标评级: ★★★★★
指标分类: 策略
画线方法: 副图
牛熊指标公式
N:=9;
中期牛熊线:=MA(CLOSE,26);
短期牛熊线:=MA(CLOSE,5);
VAR1:=EMA(EMA(CLOSE,N),N);
控盘:=(VAR1-REF(VAR1,1))/REF(VAR1,1)*1000;
STICKLINE(控盘0,控盘,0,1,0),COLORYELLOW;
黄色观望:IF(控盘0,控盘,0),COLORYELLOW,NODRAW;
STICKLINE(中期牛熊线短期牛熊线,控盘,0,1,0),COLORRED;
红色买进持有:中期牛熊线短期牛熊线,COLORRED;
STICKLINE(控盘REF(控盘,1) AND 控盘0,控盘,0,1,0),COLOR00FF00;
绿色卖出:IF(控盘REF(控盘,1) AND 控盘0,控盘,0 AND CLOSE短期牛熊线),COLOR00FF00,NODRAW;
说明0上是牛市:黄色观望,LINETHICK;
说明0下是熊市:黄色观望,LINETHICK;
牛熊骨:=18;心理线:=15;
RSV:=(((CLOSE - LLV(LOW,(牛熊骨 + 3))) / (HHV(HIGH,(牛熊骨 + 3)) - LLV(LOW,19))) * 100);
FASTK:=(((SMA(RSV,8,1) - 50) * 1.4) + 50);
D:=SMA(FASTK,8,1);
SSS:=SMA(D,8,1);
IF(D=REF(D,1),D,DRAWNULL),COLOR005C00,LINETHICK8;
IF(D=REF(D,1),D+1.5,DRAWNULL),COLOR007D00,LINETHICK8;
IF((D = REF(D,1)),D+3,DRAWNULL)COLOR00B400,LINETHICK8;
IF((D = REF(D,1)),D+4.5,DRAWNULL),COLOR00DE00,LINETHICK8;
IF((D = REF(D,1)),D+6,DRAWNULL),COLOR00FF00,LINETHICK8;
IF(SSS= REF(SSS,1),SSS,DRAWNULL),COLOR000082,LINETHICK8;
IF(SSS= REF(SSS,1),SSS+1.5,DRAWNULL),COLOR00009D,LINETHICK8;
IF(SSS= REF(SSS,1),SSS+3,DRAWNULL),COLOR0000B4,LINETHICK8;
IF(SSS= REF(SSS,1),SSS+4.5,DRAWNULL),COLOR0000D6,LINETHICK8;
IF(SSS= REF(SSS,1),SSS+6,DRAWNULL),COLOR0000FF,LINETHICK8;
B:=SSS;
W:=CROSS(BACKSET(ISLASTBAR,5),0.5);
VAR19:=BARSLAST(W);
DRAWLINE(W=1,B,ISLASTBAR AND BREF(B,VAR19),B,1),COLOR0000FF,LINETHICK1;
DRAWLINE(W=1,B,ISLASTBAR AND BREF(B,VAR19),B,1),COLOR00FF00,LINETHICK1;
(COUNT(CLOSEREF(CLOSE,1),心理线)/心理线)*100,COLORFF00FF,LINETHICK3;
{DRAWTEXT((SYSPARAM(1) = BARPOS),0, #39;☆ #39;),ALIGN5,COLORFFFF;};
公式解读:
牛熊量能副图指标N:=20;
P:=30;
K:=10;
正量能:MA(100*(L- LLV(LOW,N))/(HHV(HIGH,N)-LLV(LOW,N)),3),COLORYELLOW,LINETHICK1;
负量能:MA(-100*(L- LLV(LOW,N))/(HHV(HIGH,N)-LLV(LOW,N)),3),COLORWHITE,LINETHICK1;
正: EMA(100*(L-LLV(LOW,P))/(HHV(HIGH,P)-LLV(LOW,P)),K)/2,COLORRED;
负趋势: EMA(-100*(L-LLV(LOW,P))/(HHV(HIGH,P)-LLV(LOW,P)),K)/2,COLORGREEN;
N:=31;K:=3;
生命量能: EMA(100*(CLOSE-LLV(LOW,N))/(HHV(HIGH,N)-LLV(LOW,N)),K)/4, STICK,COLORRED;
DRAWTEXT(生命量能23,生命量能, #39; #39;),COLORYELLOW;
DRAWICON(生命量能1,3,1);
生命分水岭: 10;
强势: 21;
N:=34;
A:=EMA(AMOUNT/C/1000000,7);
MID :=EMA(A,N);
UPPER:=MID + 2*STD(A,N);
LOWER:=MID - 2*STD(A,N);
量能:(A-LOWER)/(UPPER-LOWER)*100,COLORFFFFFF;
放量:IF(CROSS(量能,70),70,50),COLOR00FF00;
:IF(CROSS(量能,50),1,0),COLORFF00FF;
攻击:IF(CROSS(量能,100),1,0),COLOR0000FF,POINTDOT,LINETHICK0;
缩量:IF(CROSS(30,量能),1,0),COLORFFFF00,POINTDOT,LINETHICK0;
{以下设置副图显示方式}
100,POINTDOT,COLORFF00FF;
70,COLORFFFFFF;
30,POINTDOT,COLORFFFFFF;
0,POINTDOT,COLORFF6600;
STICKLINE(量能70,70,量能,4,0),COLOR00FFFF;
STICKLINE(量能100,100,量能,4,0),COLOR0000FF;
STICKLINE(量能30,30,量能,4,0),COLORFFFF00;
STICKLINE(量能0,0,量能,4,0),COLOR00FF00;
DRAWTEXT(,50, #39; #39;),COLORFF00FF;
DRAWTEXT(攻击,70, #39; #39;),COLOR0000FF;
DRAWTEXT(缩量,30, #39; #39;),COLORFFFF00;
{以下设置指标使用提示,明白以后可以删除.}
{BDDW:=FILTER(缩量,60);
DRAWTEXT(BDDW,45, #39;量能看股市 #39;),COLORFFFFFF;
DRAWTEXT(BDDW,25, #39;放量要升值 #39;),COLORFFFFFF;
DRAWTEXT(REF(BDDW,15),45, #39;攻击防登顶 #39;),COLOR00FFFF;
DRAWTEXT(REF(BDDW,15),25, #39;缩量幸福池 #39;),COLOR00FFFF;};
引用: