唐山信息港

大智慧RSI核心指標公式

更新時間:2020-05-23 08:41

input:n(10,1,30),p(9,1,21);
0,DOTLINE,colorwhite;
50,DOTLINE,colorwhite;
-20,DOTLINE,color000099;
-50,DOTLINE,colorwhite;
{rsi差比}
gc:=close;
比c:=ema(gc/"SH000001$CLOSE"*1000,3);
比LC:= REF(比c,1);
比RSI1:=SMA(MAX(比c-比LC,0),6,1)/SMA(ABS(比c-比LC),6,1)*100;
比RSI:=eMA(比RSI1,n)-50;
比RSEA:=EMA(比RSI,p);
STICKLINE(比RSI<ref(比RSI,1)and 比RSI>0,0,比RSI,6,0),color777777;
STICKLINE(比RSI<ref(比RSI,1)and 比RSI<0,0,比RSI,6,0),color555555;
STICKLINE(比RSI>ref(比RSI,1)and 比RSI<0,0,比RSI,6,0),COLOR777777;
STICKLINE(比RSI>ref(比RSI,1)and 比RSI>0,0,比RSI,6,0),COLOR999999;
{個股多空}
TR := SUM(MAX(MAX(HIGH-LOW,ABS(HIGH-REF(CLOSE,1))),ABS(LOW-REF(CLOSE,1))),14);
HD := HIGH-REF(HIGH,1);
LD := REF(LOW,1)-LOW;
DMP:= SUM(IF(HD>0 AND HD>LD,HD,0),14);
DMM:= SUM(IF(LD>0 AND LD>HD,LD,0),14);
多:=DMP*100/TR-50;
空:=DMM*100/TR-50;
差值:多-空,linethick0,color00cc33;
STICKLINE( 差值>=0,-50 ,差值-50,4 ,0 ),COLORCC0099;
STICKLINE( 差值<0,-50 ,差值-50,4 ,0 ),COLOR336666;
{RSI}
LC := REF(CLOSE,1);
RSI1:SMA(MAX(CLOSE-LC,0),6,1)/SMA(ABS(CLOSE-LC),6,1)*100-100,LAYER0;
RSI2:SMA(MAX(CLOSE-LC,0),12,1)/SMA(ABS(CLOSE-LC),12,1)*100-100,LAYER0;
RSI3:SMA(MAX(CLOSE-LC,0),24,1)/SMA(ABS(CLOSE-LC),24,1)*100-100,LAYER0;
{RSI壓力支撐}
TY:=RSI1;
AA:=REF(TY,5)=HHV(TY,2*5+1);
BB:=BACKSET(AA,5+1);
CC:=FILTER(BB,5) AND TY=HHV(TY,5+1);
AA2:=REF(TY,5)=LLV(TY,2*5+1);
BB2:=BACKSET(AA2,5+1);
CC2:=FILTER(BB2,5) AND TY=LLV(TY,5+1);
GG:=BARSTATUS=2 AND REF(CC,BARSLAST(CC));
HH:=BACKSET(GG,BARSLAST(CC)+1);
II:=HH>REF(HH,1);
JJ:=REF(BARSLAST(CC),1);
KK:=BACKSET(II,JJ+2);
LL:=KK>REF(KK,1);
DRAWLINE(LL,TY,II,TY,1),COLORblue,DOTLINE;
CS:=(REF(TY,BARSLAST(II))-REF(TY,BARSLAST(LL)))/(BARSLAST(LL)-BARSLAST(II));
阻力線:=REF(TY,BARSLAST(II))+BARSLAST(II)*CS;
阻力值:阻力線,LINETHICK0;
DRAWICON(CROSS(TY,阻力線),阻力線*0.99,12);
阻力點:阻力線*0.99,linethick0;
GG2:=BARSTATUS=2 AND REF(CC2,BARSLAST(CC2));
HH2:=BACKSET(GG2,BARSLAST(CC2)+1);
II2:=HH2>REF(HH2,1);
JJ2:=REF(BARSLAST(CC2),1);
KK2:=BACKSET(II2,JJ2+2);
LL2:=KK2>REF(KK2,1);
DRAWLINE(LL2,TY,II2,TY,1),COLORblue,DOTLINE;
{RSICD}
RSI: eMA(RSI1,n)+50;
RSEA : EMA(RSI,p);
RSCD:2*(RSI-RSEA),linethick0;
bbRSI:=RSI-ref(RSI,1);
bbRSEA:=RSEA-ref(RSEA,1);
bbRSCD:=RSCD-ref(RSCD,1);
PARTLINE(bbRSI>0,RSI),color0066ff,LINETHICK2;
PARTLINE(bbRSI<0,RSI),colorcyan,LINETHICK2;
PARTLINE(bbRSEA>0,RSEA),colormagenta,LINETHICK2;
PARTLINE(bbRSEA<0,RSEA),color009999,LINETHICK2;
RSI速率:=bbRSI*100;
RSEA速率:=bbRSEA*100;
RSCD速率:=bbRSCD*100;
{KD}
RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
K:SMA(RSV,3,1);
D:SMA(K,3,1);

推薦文章

收音鸡赚钱 广东南粤风采36选7走势图 北京快3是不是官方的 股票融资鑫配资 安徽快3开奖结果 江苏快3app官方下载 山西11选5早上几点开始 彩票平台官网 赛车pk10跟计划的方法 极速飞艇不倍投计划 中国中车股票