股票培训网

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 680|回复: 0

RSI战神 RSI实战指标源码

[复制链接]

134

主题

141

帖子

182

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
182
发表于 2020-11-28 00:15:29 | 显示全部楼层 |阅读模式
1.RSI>80 为超买,RSI<20 为超卖;
2.RSI 以50为中界线,大于50视为多头行情,小于50视为空头行情;
3.RSI 在80以上形成M头或头肩顶形态时,视为向下反转信号;
4.RSI 在20以下形成W底或头肩底形态时,视为向上反转信号;
红方块为BIAS买入;
红色向上箭头为RSI买入;
绿色向下箭头为RSI卖出;
黄色向上三角▲为突破上轨;
黄色向下三角▼为跌破下轨;
抄为抄底,逃为逃顶;
白色向上三角 ▲为>昨日RSI1时的指示,表示趋势向上;
白色向下三角▼为<昨日RSI1时的指示,表示趋势向下;

P 2 100 5 N1 2 100 6 HIGHN 2 100 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;
上轨:UPPER,COLOR993300;
下轨OWER,COLOR993300;
DRAWICON(CC,RSI1*1.03,2);
DRAWICON(CC1,RSI1*0.97,1);
高压RAWLINE(CURRBARSCOUNT=GDCS2,RSI1,CURRBARSCOUNT=GDCS1,RSI1,1) COLORBLUE,POINTDOT,LINETHICK4;
低支RAWLINE(CURRBARSCOUNT=DDCS2,RSI1,CURRBARSCOUNT=DDCS1,RSI1,1) COLORRED,POINTDOT,LINETHICK4;
阻力RAWLINE(D1,RSI1,S11,RSI1,1),COLORYELLOW;
支撑RAWLINE(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(ISLASTBAR AND RSI1>REF(RSI1,1),VM,' ▲'),COLORDD00FF;
DRAWTEXT(ISLASTBAR AND RSI1<REF(RSI1,1),VM,' ▼'),COLORCCEE00;
DRAWTEXT(CURRBARSCOUNT=60,10,' ☆ 东家指标 ☆'),COLORGREEN;

怕未来函数的可删除下面几句,这几句我只是作参考,只显数据,不显图。 
前高:REF(RSI1,BARSLAST(D1)),COLORFF00FF,NODRAW;
前低:REF(RSI1,BARSLAST(D2)),COLOR00FF00,NODRAW;
相对能量RSI1-前低)/(前高-前低)*100,COLORYELLOW,NODRAW;

rsi.png

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|股票培训网

GMT+8, 2021-9-18 18:52 , Processed in 0.112236 second(s), 21 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表