通達信黃買藍賣指標公式原始碼

指标公式分享發表於2024-03-11
{ 通達信黃買藍賣指標公式原始碼 }

{指標介紹:能量線、RSI3、KDJ、W&R、CCI五個指標共振線,[紅]、[綠]變化是買賣訊號,顏色及標記是配合訊號,重點關注60分MACD和周K拐頭、周K金叉。}

W:=10;
W2:=6;
W3:=1;
N1:=60;
100,COLORBLacK;
80,COLORBLACK;
volUME:=VOL,VOLSTICK;
MAVOL1:=MA(VOLUME,5);
MAVOL2:=MA(VOLUME,10);
SSTS:=BARSSINCE(C>0);
N4:=IF(SSTS<n1,ssts,n1);
MAV200:=EMA(VOL,N4);
QD1:=IF(MAVOL1>=MAVOL2,10,0);
{STICKLINE(MAVOL1>=MAVOL2,66,70,3,0),COLORYELLOW;
STICKLINE (MAVOL1<mavol2,66,70,3,1),color333333;
STICKLINE(VOLUME>=2*REF(VOLUME,1) AND C>=REF(C,1),60,95,1,0),COLORYELLOW;
STICKLINE(VOLUME>=2*REF(VOLUME,1) AND C<ref(c,1),60,95,1,0),colorgreen;
DRAWTEXT(CURRBARSCOUNT=W3,68,'★量'),COLORFFFFFF;}
PJJ:=DMA((HIGH+LOW+CLOSE*2)/4,0.9);
JJ:=REF(EMA(PJJ,3),1);
QJJ:=VOL/((HIGH-LOW)*2-Abs(CLOSE-OPEN));
XVL:=IF(CLOSE>OPEN,QJJ*(HIGH-LOW),IF(CLOSE<open,qjj*(high-open+close-low),vol 2))+if<br=""> (CLOSE>OPEN,0-QJJ*(HIGH-CLOSE+OPEN-LOW),IF(CLOSE<open,0-qjj*(high-low),0-vol 2));<br=""> HSL:=(XVL/20)/1.15;
攻擊流量:=((HSL*0.55+(REF(HSL,1)*0.33))+(REF(HSL,2)*0.22));
GJJ:=EMA(攻擊流量,8);
LLJX:=EMA(攻擊流量,3);
資金流量:=LLJX,LINETHICK0,COLOR0000FF;
A10:=資金流量>0;
{STICKLINE(資金流量>=0,72,76,3,0),COLORLIRED;
STICKLINE (資金流量<0,72,76,3,1),COLOR333333;
DRAWTEXT(CURRBARSCOUNT=W3,74,'★流'),COLORFFFFFF;}
QD2:=IF(資金流量>=0,10,0);
DIF60:=EMA(CLOSE,12/2)-EMA(CLOSE,26/2);
DEA60:=EMA(DIF60,9/2);
{STICKLINE(DIF60>=DEA60,54,58,3,0),COLORYELLOW;
STICKLINE(DIF60<dea60,54,58,3,1),color696969;
DRAWTEXT(CURRBARSCOUNT=W3,56,'★60M'),COLORFFFFFF;}
QD3:=IF(DIF60>=DEA60,10,0);
RSV60:=(CLOSE-LLV(LOW,36))/(HHV(HIGH,36)-LLV(LOW,36));
K60:=SMA(RSV60,3,1);
D60:=SMA(K60,3,1);
{STICKLINE(K60>= D60,60,64,3,0),COLORRED;
STICKLINE(K60 < D60,60,64,3,1),COLOR696969;
DRAWTEXT(CURRBARSCOUNT=W2,62,'★60K '),COLORWHITE;}
QD4:=IF(K60>= D60,10,0);
DIF:=EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:=EMA(DIF,9);
{STICKLINE(DIF>=DEA,48,52,3,0),COLORYELLOW;
STICKLINE(DIF<dea,48,52,3,1),color696969;
DRAWTEXT(CURRBARSCOUNT=W3,50,'★日M'),COLORFFFFFF;}
QD5:=IF(DIF>=DEA,10,0);
周MD:=macd.DIF#WEEK;
周MA:=MACD.DEA#WEEK;
{STICKLINE(周MD>=周MA,30,34,3,0),COLORYELLOW;
STICKLINE(周MD<周MA,30,34,3,1),COLOR696969;
DRAWTEXT(CURRBARSCOUNT=W3,32,'★周M'),COLORFFFFFF;}
QD6:=IF(周MD>=周MA,10,0);
月MD:=MACD.DIF#MONTH;
月MA:=MACD.DEA#MONTH;
{STICKLINE(月MD>=月MA,12,16,3,0),COLORYELLOW;
STICKLINE(月MD<月MA,12,16,3,1),COLOR696969;
DRAWTEXT(CURRBARSCOUNT=W3,14,'★月M'),COLORFFFFFF;}
QD7:=IF(月MD>=月MA,10,0);
RSV:=(CLOSE-LLV(LOW,12))/(HHV(HIGH,12)-LLV(LOW,12));
K:=SMA(RSV,3,1);
D:=SMA(K,3,1);
J:=3*K-2*D;
{STICKLINE(K>=D,42,46,3,0),COLORLIRED;
STICKLINE(K<d,42,46,3,1),color696969;
DRAWTEXT(CURRBARSCOUNT=W2,44,'★日K'),COLORFFFFFF;}
QD8:=IF(K>=D,10,0);
周K:=MA("kdj.K#WEEK"(9,3,3) ,5);
周D:=MA("kdJ.D#WEEK"(9,3,3) ,5);
周J:=MA("KDJ.J#WEEK"(9,3,3) ,5);
{STICKLINE(周K>=周D,24,28,3,0),COLORLIRED;
STICKLINE(周K<周D,24,28,3,1),COLOR696969;
DRAWTEXT(CURRBARSCOUNT=W2,26,'★周K'),COLORFFFFFF;}
QD9:=IF(周K>=周D,10,0);
{STICKLINE(周K>=REF(周K,1),-6,-2,3,0),COLORYELLOW;
STICKLINE (周K<ref(周k,1),-6,-2,3,0),color333333;
DRAWTEXT(CURRBARSCOUNT=W2,-4,'★周K拐'),COLORFFFFFF;}
QD10:=IF(周K>=周D,10,0);
{STICKLINE(周J>=REF(周J,1),-12,-8,3,0),COLORRED;
STICKLINE(周J<ref(周j,1),-12,-8,3,0),color333333;
DRAWTEXT(CURRBARSCOUNT=W2,-10,'★周J拐'),COLORWHITE;}
QD11:=IF(周J>=REF(周J,1),10,0);
DRAWICON(周K>=REF(周K,1) AND DIF60>=DEA60,85,25);
月K:="KDJ.K#MONTH" ;
月D:="KDJ.D#MONTH" ;
{STICKLINE(月K>=月D,6,10,3,0),COLORLIRED;
STICKLINE(月K<月D,6,10,3,1),COLOR696969;
DRAWTEXT(CURRBARSCOUNT=W2,8,'★月K'),COLORWHITE;}
QD12:=IF(月K>=月D,10,0);
{rsi日}
日RSI1:="RSI.RSI1#DAY"(9);
日RSI2:="RSI.RSI2#DAY"(9);
{STICKLINE(日RSI1>=日RSI2,36,40,3,0),COLORFF00FF;
STICKLINE(日RSI1<日RSI2,36,40,3,1),COLOR696969;
DRAWTEXT(CURRBARSCOUNT=W,38,'★日R'),COLORFFFFFF;}
QD13:=IF(日RSI1>=日RSI2,10,0);
{RSI周}
周RSI1:="RSI.RSI1#WEEK"(9);
周RSI2:="RSI.RSI2#WEEK"(9);
{STICKLINE(周RSI1>=周RSI2,18,22,3,0),COLORFF00FF;
STICKLINE(周RSI1<周RSI2,18,22,3,1),COLOR696969;
DRAWTEXT(CURRBARSCOUNT=W,20,'★周R'),COLORFFFFFF;}
QD14:=IF(周RSI1>=周RSI2,10,0);
{RSI月}
月RSI1:="RSI.RSI1#MONTH"(9);
月RSI2:="RSI.RSI1#MONTH"(9);
{STICKLINE(月RSI1>=月RSI2,0,4,3,0),COLORFF00FF;
STICKLINE(月RSI1<月RSI2,0,4,3,1),COLOR696969;
DRAWTEXT(CURRBARSCOUNT=W,2,'★月R'),COLORFFFFFF;}
QD15:=IF(月RSI1>=月RSI2,10,0);
XH1:=IF(DIF60>=DEA60,1,0);
XH2:=IF(K60>= D60,1,0);
XH3:=IF(DIF>=DEA,1,0);
XH4:=IF(周MD>=周MA,1,0);
XH5:=IF(月MD>=月MA,1,0);
XH6:=IF(K>=D,1,0);
XH7:=IF(周K>=REF(周K,1),1,0);
XH8:=IF(周J>=REF(周J,1),1,0);
XH9:=IF(月K>=月D,1,0);
XH10:=IF(MAVOL1>MAVOL2,1,0);
XH11:=IF(資金流量>0,1,0);
XH12:=IF(日RSI1>=日RSI2,1,0);
XH13:=IF(周RSI1>=周RSI2,1,0);
XH14:=IF(月RSI1>=月RSI2,1,0);
XH15:=IF(周K>=周D,1,0);
ZTB:=COUNT(C/REF(C,1)>=1.09,5)>=1;
XHHJ:XH1+XH2+XH3+XH4+XH6+XH7+XH8+XH5+XH9+XH10+XH11+XH12+XH13+XH14+XH15,NODRAW;
{IF( XHHJ<8,XHHJ*10,DRAWNULL),LINETHICK2,COLORGREEN;
IF(XHHJ>=8 AND XHHJ<10,XHHJ*10,DRAWNULL),LINETHICK2,COLORLIRED;
IF(XHHJ>=10,XHHJ*10,DRAWNULL),LINETHICK2,COLORYELLOW;
IF(XHHJ<ref(xhhj,1) and="" xhhj="">=10,XHHJ*10,DRAWNULL),LINETHICK2,COLORGREEN;}
STICKLINE(XHHJ<8 ,0,XHHJ*5,2,0),COLORLIGREEN;
STICKLINE(XHHJ>=8 AND XHHJ<10,0,XHHJ*5,2,0),COLORLIRED;
STICKLINE(XHHJ>=10 ,0,XHHJ*5,2,0),COLORYELLOW;
{1指.能量線}
能量線:=EMA(100*(C-LLV(L,34))/(HHV(H,34)-LLV(L,34)),3),LINETHICK0;
{2指.RSI}
RSI:=SMA(MAX(CLOSE-REF(CLOSE,1),0),6,1)/SMA(ABS(CLOSE-REF(CLOSE,1)),6,1)*100,LINETHICK0;
{3指.KDJ}
RSV1:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100,LINETHICK0;
K1:=SMA(RSV1,3,1);
D1:=SMA(K1,3,1);
J1:=3*K1-2*D1,LINETHICK0;
{4指.W&R}
威廉wr:=(HHV(HIGH,14)-CLOSE)/(HHV(HIGH,14)-LLV(LOW,14))*100,LINETHICK0;
{5指.cci}
TYP := (HIGH + LOW + CLOSE)/3;
CCI:=(TYP-MA(TYP,14))/(0.015*AVEDEV(TYP,14)),LINETHICK0;
五指A:WMA((能量線+RSI+J-威廉WR+CCI)/5,5);
五指B:WMA((能量線+RSI+J-威廉WR+CCI)/5,13);
WMA((能量線+RSI+J-威廉WR+CCI)/5,5),COLOR00FF00,LINETHICK3;
IF(五指A>REF(五指A,1),五指A,DRAWNULL),COLOR0000FF,LINETHICK3;
{DRAWTEXT_FIX(1,0.02,0,0,'能量線,RSI3.KDJ,W&R,CCI,五個指標共振線.[紅].[綠].變化是買賣訊號.顏色及標記是配合訊號,重點關注60分MACD和周K拐頭,周K金叉'),COLORRED,LINETHICK3;}
KC:=FORCAST(((2*C+H+L)/4*0.618+C*0.382),3);
AAX:=(KC-MA(KC,9))/MA(KC,9)*100;
VAR0:=MIN(EXIST(KC,55),9);
AAX1:=EMA(AAX,VAR0)*VAR0;
AAX2:=MA(AAX1,3);
AAX3:=MA(AAX1,5);
賣:=AAX3>3 AND AAX1<ref(aax1,1) and="" cross(aax2,aax1);<br=""> VBA:=FILTER(賣,5);
DRAWTEXT(VBA,五指A*1.08,'★減倉'),COLORYELLOW;
DRAWICON(FILTER(VBA=1,3),五指A,2),COLORFFFF00;
DRAWTEXT(CROSS(REF(五指A,1),五指A) AND 五指B<ref(五指b,1) and="" 五指a="">-20 ,五指A*1,'★空倉'),COLORFFFF00;
{STICKLINE(FILTER(VBA=1,5),36,0,1.25,0),COLORBLUE;
STICKLINE(FILTER(VBA=1,5),35,0,0.35,1),COLORBLUE,COLORGREEN;}
VB2:=EMA(EMA(C-REF(C,1),6),6)/EMA(EMA(ABS(C-REF(C,1)),6),6)*100;
VB3:=IF(LLV(VB2,3)=LLV(VB2,11) AND COUNT(VB2<0,2) AND CROSS(VB2,MA(VB2,2)),1,0);
VB4:=FILTER(VB3=1,5);
DRAWTEXT(VB4,五指A*1,'★建倉'),COLORD9D919;
DRAWTEXT(CROSS(五指A,五指B),五指A*1,'★加倉'),COLORYELLOW;
DRAWICON(FILTER(VB4=1,3),五指A,1),COLORFFFF00;
{STICKLINE(FILTER(VB4=1,5),36,0,1.25,0),COLORRED;
STICKLINE(FILTER(VB4=1,5),35,0,0.35,1),COLORRED,COLORYELLOW;}
震幅0:=(H-L)/REF(C,1)*100;
震幅:震幅0,NODRAW,COLORRED;
超級大盤股:FINANCE(7)>=8000000000,COLORRED,NODRAW;
大盤股:FINANCE(7)<8000000000 AND FINANCE(7)>=800000000,COLORYELLOW,NODRAW;
中盤股:FINANCE(7)<800000000 AND FINANCE(7)>=400000000,COLORGREEN,NODRAW;
小盤股:FINANCE(7)<400000000,COLORWHITE,NODRAW;
盤小績優:FINANCE(7)<1000000000 AND DYNAINFO(39)>0 AND DYNAINFO(39)<=28,COLOR9933FF,NODRAW;
獲利:WINNER(C)*100,COLORLIBLUE,LINETHICK2,NODRAW;
{IF(獲利>=90,獲利,DRAWNULL),COLORYELLOW,LINETHICK2;
IF(獲利>80 AND 獲利<90,獲利,DRAWNULL),COLORRED,LINETHICK2;
IF(獲利>50 AND 獲利<80,獲利,DRAWNULL),COLORLIRED,LINETHICK2;}
STICKLINE(獲利<=5,-50,-48,2,0),COLORBLUE;
STICKLINE(獲利>=5 AND 獲利<10,-50,-46,2,0),COLORLIBLUE;
STICKLINE(獲利>=10 AND 獲利<20,-50,-44,2,0),COLORLIGREEN;
STICKLINE(獲利>=20 AND 獲利<50,-50,-42,2,0),COLORWHITE;
STICKLINE(獲利>=50 AND 獲利<80,-50,-40,2,0),COLORLIRED;
STICKLINE(獲利>=80 AND 獲利<90,-50,-38,2,0),COLORRED;
STICKLINE(獲利>=90 AND 獲利<=100,-50,-36,2,0),COLORYELLOW;
XHHJ1:=XH2+XH6+XH9+XH15;
XHHJ2:=XH3+XH4+XH5+XH1;
XHHJ3:=XH12+XH13+XH14+XH2;
XG1:=(XHHJ1=4) ;
XG2:=(XHHJ2= 4) ;
XG3:=(XHHJ3= 4) ;
DRAWTEXT(XG1,-18,'K');DRAWTEXT(XG2,-25,'M');DRAWTEXT(XG3,-32,'R');
{DRAWICON(XG2 AND CROSS(DIF60,DEA60),90,26);}
DRAWICON(CROSS(XHHJ1,3) OR CROSS(XHHJ2,3),94,23);
DRAWTEXT(VOL>=MAV200*2 AND VOL<mav200*3,96 ,'2');<br=""> DRAWTEXT(VOL>=MAV200*3 AND VOL<mav200*4,96 ,'3');<br=""> DRAWTEXT(VOL>=MAV200*4 AND VOL<mav200*5,96 ,'4');<br=""> DRAWTEXT(VOL>=MAV200*5 AND VOL<mav200*6,96 ,'5');<br=""> DRAWTEXT(VOL>=MAV200*6 AND VOL<mav200*7,96 ,'6');<br=""> DRAWTEXT(VOL>=MAV200*7 AND VOL<mav200*8,96,'7');
DRAWTEXT(VOL>=MAV200*8 AND VOL<mav200*9,96,'8');
DRAWTEXT(VOL>=MAV200*9 AND VOL<mav200*10,96,'9');
DRAWTEXT(VOL>=MAV200*10,96,'10');
量比: DYNAINFO(17),NODRAW;

相關文章