通达信相对能量副图指标公式
安装后如下图,友情提示(指标只是辅助,不作建议) 所有程序均为免费分享。
不会安装点击 安装指南 步骤操作。
P:=5;
N1:=6;
HIGHN:=20;
LC:=REF(CLOSE,1);
RSI1:SMA(MAX(CLOSE-LC,0),6,1)/SMA(ABS(CLOSE-LC),6,1)*100,COLORWHITE;
AA:=REF(RSI1,HIGHN)=HHV(RSI1,2*HIGHN+1);
QY:=BACKSET(AA,HIGHN+1);
CC:=FILTER(QY,HIGHN) AND RSI1=HHV(RSI1,HIGHN+1);
DDD:=BARSLAST(CC);
GDTS:=IF(CC,CURRBARSCOUNT,0);
DINGBUTS:=IF(DDD,REF(GDTS,DDD),GDTS);
GDCS1:=CONST(DINGBUTS);
DINGBUTS1:=REF(DINGBUTS,DDD+1);
GDCS2:=CONST(DINGBUTS1);
AA1:=REF(RSI1,HIGHN)=LLV(RSI1,2*HIGHN+1);
QY1:=BACKSET(AA1,HIGHN+1);
CC1:=FILTER(QY1,HIGHN) AND RSI1=LLV(RSI1,HIGHN+1);
DD1:=BARSLAST(CC1);
DDTS:=IF(CC1,CURRBARSCOUNT,0);
DDTS1:=IF(DD1,REF(DDTS,DD1),DDTS);
DDCS1:=CONST(DDTS1);
DDTS2:=REF(DDTS1,DD1+1);
DDCS2:=CONST(DDTS2);
A1:=REF(RSI1,P)=HHV(RSI1,2*P+1);
B1:=FILTER(A1,P);
C1:=BACKSET(B1,P+1);
D1:=FILTER(C1,P);
A2:=REF(RSI1,P)=LLV(RSI1,2*P+1);
B2:=FILTER(A2,P);
C2:=BACKSET(B2,P+1);
D2:=FILTER(C2,P);
R11:=BACKSET(ISLASTBAR,BARSLAST(D1)+1);
S11:=R11>REF(R11,1);
T11:=BACKSET(ISLASTBAR,BARSLAST(D2)+1);
U11:=T11>REF(T11,1);
MID:=MA(RSI1,20);
UPPER:=MID + 2*STD(RSI1,20);
LOWER:=MID - 2*STD(RSI1,20);
高:=REF(HHV(RSI1,360),1);
低:=REF(LLV(RSI1,240),1);
BIAS1:=(C-MA(C,6))/MA(C,6)*100;
BIAS2:=(C-MA(C,12))/MA(C,12)*100;
BIAS3:=(C-MA(C,24))/MA(C,24)*100;
BIAS:=(BIAS1+2*BIAS2+3*BIAS3)/6;
乖离:=MA(BIAS,6);
前高:REF(RSI1,BARSLAST(D1)),COLORFF00FF,NODRAW;
前低:REF(RSI1,BARSLAST(D2)),COLOR00FF00,NODRAW;
相对能量:(RSI1-前低)/(前高-前低)*100,COLORYELLOW,NODRAW;
RSI2:=SMA(MAX(CLOSE-LC,0),12,1)/SMA(ABS(CLOSE-LC),12,1)*100;
RSI:RSI1,COLORLIGRAY;
DRAWBAND(RSI1,RGB(255,28,28),RSI2,RGB(28,255,28));
上轨:UPPER,COLORD8D8D8;
下轨:LOWER,COLORD8D8D8;
DRAWICON(CC,RSI1*1.03,2);
DRAWICON(CC1,RSI1*0.97,1);
{需要编写选股关注微信公众号:程序化指标}阻力:DRAWLINE(D1,RSI1,S11,RSI1,1),COLORYELLOW;
支撑:DRAWLINE(D2,RSI1,U11,RSI1,1),COLOR00FF00;
DRAWTEXT(CROSS(RSI1,LOWER),LOWER,'抄'),COLORFF5BAD;
DRAWTEXT(CROSS(LOWER,RSI1),LOWER,'▼'),COLORFF5BAD;
DRAWTEXT(CROSS(RSI1,高),MID,'年高'),COLORYELLOW;
DRAWTEXT(CROSS(低,RSI1),MID,'年低'),COLORYELLOW;
DRAWTEXT(CROSS(UPPER,RSI1),UPPER,'逃'),COLORYELLOW;
DRAWTEXT(CROSS(RSI1,UPPER),UPPER,'▲'),COLORYELLOW;
VM:MA(RSI1,N1),COLORFF00FF,NODRAW;
STICKLINE(CROSS(BIAS,乖离) AND 乖离<-9,6,0,2,0),COLORRED;
DRAWTEXT(ISLASTBAR AND RSI1>REF(RSI1,1),VM,' 上'),COLORDD00FF;
DRAWTEXT(ISLASTBAR AND RSI1<REF(RSI1,1),VM,' 下'),COLORCCEE00;
P1:=3;
OB:=RSI;
A11:=REF(OB,P1)=HHV(OB,2*P1+1);
B11:=FILTER(A11,P1);
C11:=BACKSET(B11,P1+1);
D11:=FILTER(C11,P1);{高点}
A22:=REF(OB,P1)=LLV(OB,2*P1+1);
B22:=FILTER(A22,P1);
C22:=BACKSET(B22,P1+1);
D22:=FILTER(C22,P1);{低点}
R111:=BACKSET(ISLASTBAR,BARSLAST(D11)+1);
S111:=R111>REF(R111,1);
压力线:DRAWLINE(D11,OB,S111,OB,1),LINETHICK1,COLORCC33CC;
版权声明
所有指标均为免费分享。
文章内容来自互联网,本网站无任何收费项目也不推荐股票广告投放请自行识别风险。