以下是通达信BBD指标公式源码和使用说明
使用说明:
短线BBD指标的计算:根据上述公式,计算得到每个交易日的BBD值。BBD值的范围为0到100之间,数值越高表示股价接近当日的最高价,数值越低表示股价接近当日的最低价。
识别超买超卖区域:根据BBD值的数值范围,可以判断股票当前是否处于超买或超卖状态。一般来说,当BBD值高于某一设定阈值(例如80)时,表示股票处于超买状态,可能出现价格回调的机会;当BBD值低于某一设定阈值(例如20)时,表示股票处于超卖状态,可能出现价格反弹的机会。
通达信短线BBD指标公式源码:
VAR1:=(2*CLOSE+HIGH+LOW)/4;
VAR2:=EMA(EMA(EMA(VAR1,4),4),4);
J:=(VAR2-REF(VAR2,1))/REF(VAR2,1)*100;
D:=MA(J,3);
K:=MA(J,1);
LX:=BARSLASTCOUNT(J
T:=BARSLAST(CROSS(J 0,0.5));
T2:=BARSLAST(CROSS(J 0,0.5));
J =REF(J,T+2)ANDCOUNT(J =REF(J,T+2),T2+1)=1;
VAR111:=IF(DATE 10000000ANDDATE 1000000,1,0);
AL:=(C+L+H)/3;
ao:=SMA(AL,5,1)-SMA(AL,13,1)*VAR111;
bbd:(AO-SMA(AO,3,1))*100,COLORFFCCFF,NODRAW;
BBDA:SMA(BBD,5,2),COLORRED,LINETHICK0;
RSV1:=BBD*VAR111;
RSV2:=BBDA*VAR111;
{BBD彩色柱体}
VAR11:=IF(DATE 10000000ANDDATE 1000000,1,0);
BBD1:=IF(BBD =REF(BBD,1)*VAR11,BBD,DRAWNULL)*VAR111;
BBD2:=IF(BBD REF(BBD,1)*VAR11,BBD,DRAWNULL)*VAR111;
STICKLINE(BBD1,0,BBD,3,0),COLOR000088;
STICKLINE(BBD1,0,BBD,1.5,0),COLOR0000AA;
STICKLINE(BBD1,0,BBD,1,0),COLOR0000CC;
STICKLINE(BBD1,0,BBD,0.5,0),COLOR0000FF;
STICKLINE(BBD2,0,BBD*VAR11,3,0),COLOR888800;
STICKLINE(BBD2,0,BBD*VAR11,1.5,0),COLORAAAA00;
STICKLINE(BBD2,0,BBD*VAR11,1,0),COLORCCCC00;
STICKLINE(BBD2,0,BBD*VAR11,0.5,0),COLORFFFF00;
SV1:=BArslAST(REF(crOSS(RSV1,RSV2),1));
SV1A:=REF(CLOSE,SV1+1) CLOSEANDRSV1 REF(RSV1,SV1+1)AND
CROSS(RSV1,RSV2)*VAR11;
上涨BBD:IF(SV1A,RSV2,DRAWNULL),COLORRED;
DRAWTEXT(SV1A,RSV2,'─B底背'),COLOR0033FF;
SV2:=BARSLAST(REF(CROSS(RSV2,RSV1),1));
SV2A:=REF(CLOSE,SV2+1) CLOSEANDREF(RSV1,SV2+1) RSV1ANDCROSS(RSV2,RSV1);
下跌BBD:IF(SV2A,RSV2,DRAWNULL),COLORFFFF00;
DRAWICON(((((LLV(BBD,4) 0)AND(BBD REF(BBD,1)))
AND(REF(BBD*VAR11,1) REF(BBD,2)))AND(REF(BBD*VAR111,2) REF(BBD,3)))
,BBD,2*VAR111)*VAR111;
DRAWICON(((((HHV(BBD*VAR111,4) 0)AND(BBD*VAR11 REF(BBD,1)))
AND(REF(BBD,1) REF(BBD,2)))AND(REF(BBD,2)
REF(BBD,3))),BBD,1)*VAR111;
DIF:=EMA(CLOSE,12)-EMA(CLOSE,26)*10;
DEA:=EMA(DIF,9);
上涨:(DIF-DEA)*2,COLOR0000EE,LINETHICK0;
下跌:上涨,COLORCYAN,NODRAW,LINETHICK0;
VARF:=TROUGHBARS(3,15,1)
大单:=IF(V 500,V,0);
正量:=C REF(C,1);
负量:=C REF(C,1);
BBD:=IF(正量,大单,0)-IF(负量,大单,0);
BBD累计:SUM(BBD,0),LINETHICK0;
今天大单净量:BBD累计-REF(BBD累计,FROMOPEN-1),NODRAW;
M5:MA(BBD累计,5);
M10:MA(BBD累计,10);
M20:MA(BBD累计,20),COLORSTICK;
DRAWKLINE(HHV(BBD累计,1),REF(BBD累计,1),REF(BBD累计,1),BBD累计);
多空:=EMA((CLOSE-MA((2*CLOSE+HIGH+LOW)/4,30))
/MA((2*CLOSE+HIGH+LOW)/4,30)*100,3),LINETHICK1,COLORWHITE;
STICKLINE(FILTER(VARF=1,5)AND多空 -10,下跌,0,3.2,1),COLOR00FFFF;
STICKLINE(FILTER(VARF=1,5),下跌,0,3,0),COLORAA00AA;
STICKLINE(FILTER(VARF=1,5),下跌,0,2.3,0),COLORBB00BB;
STICKLINE(FILTER(VARF=1,5),下跌,0,1.6,0),COLORCC00CC;
STICKLINE(FILTER(VARF=1,5),下跌,0,0.9,0),COLORDD00DD;
STICKLINE(FILTER(VARF=1,5),下跌,0,0.2,0),COLOREE00EE;
明天见底:FILTER(VARF=1,3)ORCROSS(多空,0)ORCROSS(多空,10),COLORFF00FF,NODRAW;
通达信短线BBD指标公式截图