以下是通达信看压力指标公式源码和使用说明
通达信RSI看趋势压力指标公式源码:
diff:=ema(close,12)-ema(close,26);
dea:=ema(diff,9);
ma(c,8),colorwhite;
ma(c,21),coloryellow;
多头:stickline(diff dea,c,o,8,0),colorred;
stickline(diff dea,h,l,0,0),colorred;
空头:stickline(diff =dea,c,o,8,0),COLORF0F000;
stickline(diff =dea,h,l,0,0),COLORF0F000;
drawtext(cross(diff,dea),l-0.2,'买入'),colorwhite;
drawtext(cross(dea,diff),h+0.2,'卖出'),colorgreen;
N:=14;
LC:=REF(CLOSE,1);
rsi:SMA(MAX(CLOSE-LC,0),N,1)/SMA(Abs(CLOSE-LC),N,1)*100;
DRAWLINE(RSI =HHV(RSI,10),RSI,RSI =LLV(RSI,3),HHV(RSI,3),1),COLORFF6000,LINETHICK1;
AA0:=REF(RSI,N)=HHV(RSI,2*N+1);
QY0:=BacKSET(AA0,N+1);
CC0:=FILTER(QY0,N)ANDRSI=HHV(RSI,N+1);
DRAWICON(CC0,RSI,2);
AA1:=REF(RSI,N)=LLV(RSI,2*N+1);
QY1:=BACKSET(AA1,N+1);
CC1:=FILTER(QY1,N)ANDRSI=LLV(RSI,N+1);
DRAWICON(CC1,RSI,1);
Q:=5;
AA:=REF(RSI,Q)=HHV(RSI,2*Q+1);
BB:=FILTER(AA,Q);
CC:=BACKSET(BB,Q+1);
DD:=FILTER(CC,Q);
AAA:=REF(RSI,Q)=LLV(RSI,2*Q+1);
BBB:=FILTER(AAA,Q);
CCC:=BACKSET(BBB,Q+1);
DDD:=FILTER(CCC,Q);
R11:=BACKSET(ISLASTBAR,BArslAST(DD)+1);
S11:=R11 REF(R11,1);
压力:DRAWLINE(DD,RSI,S11,RSI,1),LINETHICK1,COLOR00FF00;
T11:=BACKSET(ISLASTBAR,BARSLAST(DDD)+1);
U11:=T11 REF(T11,1);
支撑:DRAWLINE(DDD,RSI,U11,RSI,1),LINETHICK1,COLOR0088FF;
P:=5;N1:=6;HIGHN:=2;
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)ANDRSI1=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)ANDRSI1=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);
上轨:UPPER,COLORYELLOW;
下轨:LOWER,COLORYELLOW;
DRAWICON(CC,RSI1*1.03,2);
DRAWICON(CC1,RSI1*0.97,1);
高压:DRAWLINE(CURRBARSCOUNT=GDCS2,RSI1,CURRBARSCOUNT=GDCS1,RSI1,1);
低支:DRAWLINE(CURRBARSCOUNT=DDCS2,RSI1,CURRBARSCOUNT=DDCS1,RSI1,1);
阻力:DRAWLINE(D1,RSI1,S11,RSI1,1),COLORYELLOW;
支撑:DRAWLINE(D2,RSI1,U11,RSI1,1),COLOR00FF00;
DRAWTEXT(CROSS(RSI1,LOWER),LOWER,'抄'),COLOR00FF00;
DRAWTEXT(CROSS(LOWER,RSI1),LOWER,'▼'),COLOR00FF00;
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(ISLASTBARANDRSI1 REF(RSI1,1),VM,'▲'),COLORDD00FF;
DRAWTEXT(ISLASTBARANDRSI1 REF(RSI1,1),VM,'▼'),COLORCCEE00;
通达信RSI看趋势压力指标公式截图