//基礎(chǔ)指標公式
50,DOTLINE;20;80;
DRAWBAND(80,RGB(0,30,255),100,RGB(0,30,255));
DRAWBAND(20,RGB(0,150,200),0,RGB(0,150,200));
DRAWTEXT_FIX(1,0.02,0,0,'★RSI6與RSA12金叉參考買入.死叉參考賣出. ★威廉WR大于80買入?yún)^(qū).小于20賣出區(qū).'),COLOR00FFFF,LINETHICK3;
CC:=FORCAST(C,3); HH:=FORCAST(H,3); LL:=FORCAST(L,3);
LC:=REF(WMA((2*CC+HH+LL)/4,3),1);
RSI6:SMA(MAX(CLOSE-LC,0),6,1)/SMA(ABS(CLOSE-LC),6,1)*100,COLORFF9900,LINETHICK0;
RSI12:SMA(MAX(CLOSE-LC,0),12,1)/SMA(ABS(CLOSE-LC),12,1)*100,COLOR00FFFF,LINETHICK0;
DRAWBAND(RSI6,RGB(255,80,0),RSI12,RGB(0,255,100));
SMA(MAX(CLOSE-LC,0),6,1)/SMA(ABS(CLOSE-LC),6,1)*100,COLORFF9900,LINETHICK3;
IF(RSI6>REF(RSI6,1),RSI6,DRAWNULL),COLOR0000FF,LINETHICK4;
SMA(MAX(CLOSE-LC,0),12,1)/SMA(ABS(CLOSE-LC),12,1)*100,COLOR00FFFF,LINETHICK2;
威廉WR:FORCAST(100*(HHV(HH,14)-CC)/(HHV(HH,14)-LLV(LL,14)),5),COLOR00FFFF,DOTLINE;
IF(威廉WR>80 ,威廉WR,DRAWNULL),COLOR00FF00,LINETHICK3;
IF(威廉WR<20,威廉WR,DRAWNULL),COLOR0000FF,LINETHICK3;
導(dǎo)入軟件之后的基本走勢圖形有:
//買賣指標公式
N1:=6;
N2:=6;
N3:=6;
LC:=REF(CLOSE,1);
RSI1:SMA(MAX(CLOSE-LC,0),N1,1)/SMA(ABS(CLOSE-LC),N1,1)*100;
RSI2:SMA(MAX(CLOSE-LC,0),N2,1)/SMA(ABS(CLOSE-LC),N2,1)*100;
RSI3:SMA(MAX(CLOSE-LC,0),N3,1)/SMA(ABS(CLOSE-LC),N3,1)*100;
MA60:MA(C,60);
MA5:MA(C,5);
MA10:MA(C,10);
MA20:MA(C,20);
A:20;
D:80;
買:=RSI1<20 OR RSI1<80 AND C>REF(C,1)AND VOLREF(MA60,1) AND MA5>REF(MA5,1)AND MA10>REF(MA10,1)AND MA20>REF(MA20,1);
DRAWTEXT(買,RSI1*0.8,'買'),COLOR0099FF;
賣:=RSI1>80 AND VOL>REF(VOL,1);
DRAWTEXT(賣,RSI1*1.09,'賣'),COLOR0099FF;
//精確買賣點公式
LC := REF(CLOSE,1);
R:SMA(MAX(CLOSE-LC,0),9,1)/SMA(ABS(CLOSE-LC),9,1)*10;
K:=r-REF(r,1);
STICKLINE(k>REF(k,1) AND R<3 AND (k<0 OR REF(k,1)<0),3,5,2),colorred;
STICKLINE(k5.5,5,7,2),colorgreen;
x:=(k>REF(k,1) AND R<3.0 AND (k<0 OR REF(k,1)<0))*8;
y:=((k5.5)>0)*8;
//趨勢分析
VAR1:=HHV(HIGH,33);
VAR2:=LLV(LOW,33);
A:=(SMA((CLOSE-VAR2)/(VAR1-VAR2),8,1))*(100),COLOR00FFFF;
價格線:EMA(HHV(A,3),1),colorgreen;
va1:=(CLOSE-LLV(LOW,90))/(HHV(HIGH,90)-LLV(LOW,90))*100;
va2:=SMA(va1,9,1),colorwhite;
趨勢線:SMA(va2,6,1),colorff00ff;
va4:=3*va2-2*趨勢線,colorff00ff;
撐壓線:WMA((va2+趨勢線+va4)/3,60),colorred;
LC:= REF(CLOSE,1);
RSI6:SMA(MAX(CLOSE-LC,0),6,1)/SMA(ABS(CLOSE-LC),6,1)*100,colorwhite;
RSI12:SMA(MAX(CLOSE-LC,0),12,1)/SMA(ABS(CLOSE-LC),12,1)*100,coloryellow;
賣線:85,LINETHICK02,POINTDOT,Color15FF15;
界線:50,LINETHICK02,POINTDOT,ColorFF1EFF;
買線:20,LINETHICK02,POINTDOT,Color28FFFF;
其中講解的主要是有買線和賣線的操作技巧,以及趨勢線和撐壓線,導(dǎo)入后的基本圖形如下:
//rsi自用公式
N0:=3;N1:=5;N2:=6;N3:=7;N4:=8;N5:=9;N6:=10;N7:=11;N8:=12;N9:=13;N10:=14;N11:=15;N12:=16;
LC := REF(CLOSE,1);
RSI$12:SMA(MAX(CLOSE-LC,0),N12,1)/SMA(ABS(CLOSE-LC),N12,1)*100,COLORFFFF00;
RSI$11:SMA(MAX(CLOSE-LC,0),N11,1)/SMA(ABS(CLOSE-LC),N11,1)*100,COLORFFCC00;
RSI$10:SMA(MAX(CLOSE-LC,0),N10,1)/SMA(ABS(CLOSE-LC),N10,1)*100,COLORFF9900;
RSI$9:SMA(MAX(CLOSE-LC,0),N9,1)/SMA(ABS(CLOSE-LC),N9,1)*100,COLORFF6600;
RSI$8:SMA(MAX(CLOSE-LC,0),N8,1)/SMA(ABS(CLOSE-LC),N8,1)*100,COLORFF3300;
RSI$7:SMA(MAX(CLOSE-LC,0),N7,1)/SMA(ABS(CLOSE-LC),N7,1)*100,COLORFF0000;
RSI$6:SMA(MAX(CLOSE-LC,0),N6,1)/SMA(ABS(CLOSE-LC),N6,1)*100,COLOR00FFFF;
RSI$5:SMA(MAX(CLOSE-LC,0),N5,1)/SMA(ABS(CLOSE-LC),N5,1)*100,COLOR00CCFF;
RSI$4:SMA(MAX(CLOSE-LC,0),N4,1)/SMA(ABS(CLOSE-LC),N4,1)*100,COLOR0099FF;
RSI$3:SMA(MAX(CLOSE-LC,0),N3,1)/SMA(ABS(CLOSE-LC),N3,1)*100,COLOR0066FF;
RSI$2:SMA(MAX(CLOSE-LC,0),N2,1)/SMA(ABS(CLOSE-LC),N2,1)*100,COLOR0033FF;
RSI$1:SMA(MAX(CLOSE-LC,0),N1,1)/SMA(ABS(CLOSE-LC),N1,1)*100,COLOR0000FF;
RSI$0:SMA(MAX(CLOSE-LC,0),N0,1)/SMA(ABS(CLOSE-LC),N0,1)*100,COLORFF33FF;
a:20;
d:80;
//復(fù)合通道公式
M=12,2,10;
N1=6,2,100;
N2=13,2,100;
LC:=REF(CLOSE,1);
RS1:=SMA(MAX(CLOSE-LC,0),M,1)/SMA(ABS(CLOSE-LC),M,1)*100;
ATR:=MA(MAX(MAX((RS1-RS1),ABS(REF(RS1,1)-RS1)),ABS(REF(RS1,1)-RS1)),15);
VM:=MA(RS1,N1);
SM:MA(RS1,20),PRECIS1,Coloraaee00,LINETHICK0;
SU:SM+2*STD(RS1,20),PRECIS1,Coloraaee00,LINETHICK0;
SD:SM-2*STD(RS1,20),PRECIS1,Coloraaee00,LINETHICK0;
VU:VM+2.3*ATR,PRECIS1,Colorffffff,LINETHICK0;
VD:VM-2.1*ATR,PRECIS1,Colorffffff,LINETHICK0;
//{DRAWGBKLAST(C>0),Color7a6500};
FILLRGN(SU,SD,C>0,RGB(0,170,140)),PRECIS1;
FILLRGN(VU,VD,C>0,RGB(210,210,210)),PRECIS1;
RSI:RS1,PRECIS1,Color0000ff,LINETHICK2,LAYER0;
MA1:VM,PRECIS1,Colorff0000;
MA2:MA(RS1,N2),PRECIS1,Color004a00,LINETHICK2;
強勢:70,colorred,LAYER3;
中勢:50,colorblue,LAYER3;
弱勢:30,colorgreen,LAYER3;
其中能夠表現(xiàn)出股價的強勢和弱勢,基本的圖形如下:
以上就是本文講解的rsi指標具有的公式操作源碼,如果您還想要了解更多的股市操作源碼公式,請關(guān)注贏家財富網(wǎng),或者點擊股票公式,為您提供更加全面的指標公式源碼介紹!
下一篇:股市波段買賣指標源碼公式解
服務(wù)中心:鄭州市金水區(qū)農(nóng)業(yè)路經(jīng)三路
郵編:450002 網(wǎng)址:m.hbzcqc.cn
銷售熱線:0371-65350319
技術(shù)支持:13333833889