当然我是拿来主义逆市飘红是老公式,很好用它把你的股和大盘密切对比,使你更清楚的知道你的股好坏,是该保留还是卖掉,我再上边加进了该知道的关联项目,有点乱有点花,不想要的别用,想要的别怕乱,
这个【逆市飘红】和原来的大不相同,进行了翻天覆地改造,不信你看,本来我的老箱底,我想过节和大家一起分享,你想知道KDJ的个股和大盘的关联,打开大括号即可,但线条是不是太多了,你自己选择,祝你春节愉快,拿点时间研究它一定会有新的发现,
{逆市飘红}
input:N(34);
DRAWGBKlast(DATE>900101,strip(RGB(0,0,100),RGB(0,0,40),0));
{个股KDJ}
{RSV:= (CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*8;
FASTK:=SMA(RSV,3,1);
K:=SMA(FASTK,3,1);
D:=SMA(K,5,1);
个股J:3*K-2*D,COLOR00FF00,LINETHICK0;
partline(个股J,个股J>ref(个股J,1),rgb(255,0,0),个股J<ref(个股J,1),rgb(0,255,0)),LINETHICK1;}
{大盘KDJ}
{VARDC:=(INDEXC-LLV(INDEXL,9))/(HHV(INDEXH,9)-LLV( INDEXL,9))*8;
FASDC:=SMA(VARDC,3,1);
KDC:=SMA(FASDC,3,1);
DDC:=SMA(KDC,5,1);
大盘JDK:3*KDC-2*DDC,COLOR0000FF,LINETHICK0;
partline(大盘JDK,大盘JDK>ref(大盘JDK,1),rgb(255,0,0),大盘JDK<ref(大盘JDK,1),rgb(0,255,0)),DOTLINE;}
{趋势}
个股趋势: 3*SMA((CLOSE-LLV(LOW,N))/(HHV(HIGH,N)-LLV(LOW,N))*10,5,1)-2*SMA(SMA((CLOSE-LLV(LOW,N))/(HHV(HIGH,N)-LLV(LOW,N))*10,5,1),3,1),COLORRED,LINETHICK2;
大盘趋势: 3*SMA((INDEXC-LLV(INDEXL,N))/(HHV(INDEXH,N)-LLV(INDEXL,N))*10,5,1)-2*SMA(SMA((INDEXC-LLV(INDEXL,N))/(HHV(INDEXH,N)-LLV(INDEXL,N))*10,5,1),3,1),LINETHICK0;
partline(大盘趋势,大盘趋势>ref(大盘趋势,1),rgb(255,0,100),大盘趋势<ref(大盘趋势,1),rgb(255,255,0));
FILLRGN(个股趋势,大盘趋势,个股趋势>大盘趋势,RGB(0,0,255)),COLORFF9900,LINETHICK2,LAYER7;
FILLRGN(大盘趋势,个股趋势,大盘趋势>个股趋势,RGB(80,0,60)),COLOR00FF00,LINETHICK2,LAYER7;
PARTLINE(个股趋势,(大盘趋势>个股趋势),rgb(0,255,0),1,rgb(255,0,0) ),LINETHICK2;
a:=if(个股趋势>=大盘趋势,1,0);
X:=BARSLAST(DISPSTATUS=1)+1;
上趋势:=COUNT(a=1 ,X );
下趋势:=COUNT(a=0 ,X );
趋势上占:=上趋势/(上趋势+下趋势)*X;
DRAWTEXTABS(250,5,'【■可视'+NUMTOSTRN(X,0)+'天中.个股趋势有'+NUMTOSTRN(趋势上占,0)+'天强于大盘趋势: 占'+NUMTOSTRN(趋势上占*100/X,1)+'%】'),Color00FFFF,LINETHICK4;
ZDF:=(CLOSE-REF(CLOSE,1))/REF(CLOSE,1)*100;
DPZDF:=(INDEXC-REF(INDEXC,1))/REF(INDEXC,1)*100;
STICKLINE(ZDF>=0 AND DPZDF<0,2,3.5,6,0),COLORRED; {大盘-.个股+}
STICKLINE(ZDF>=0 AND DPZDF<-2,2.5,4,10,0),COLORMAGENTA;{大盘-2.个股+}
STICKLINE(ZDF>=0 AND DPZDF>0,2,3,6,1),COLOR0099ff;{大盘+.个股+}
STICKLINE(ZDF<0 AND DPZDF>=0,2,0.5,6,0),COLOR00ff00; {大盘+.个股-}
STICKLINE(ZDF<0 AND DPZDF>=2,2,0,10,0),COLOR9977ff; {大盘+2.个股-}
STICKLINE(ZDF<0 AND DPZDF<0,2,1,6,1),COLOR007700;{大盘-.个股-}
STICKLINE(ZDF>9.9,5,6,12,0),COLORYELLOW;{个股+10}
STICKLINE(ZDF<-9.9,5,4,12,0),COLORff9900; {个股-10}
DRAWTEXT(BARSTATUS=2,3.6,' 逆市涨'),ALIGN2,COLOR0000FF,LINETHICK2,LAYER0;
DRAWTEXT(BARSTATUS=2,0.8,' 逆市跌'),ALIGN2,COLOR00FF00,LINETHICK2,LAYER0;
DRAWTEXT(BARSTATUS=2,2.6,' 涨'),ALIGN0,COLOR0077FF,LINETHICK2,LAYER0;
DRAWTEXT(BARSTATUS=2,1.8,' 跌'),ALIGN0,COLORFF9900,LINETHICK2,LAYER0;
DRAWTEXTABS(5,5, '■'+NUMTOSTRN(X,0)+'天逆市涨 ' +NUMTOSTRN(COUNT(ZDF>=0 AND DPZDF<0,X),0)+'次' ),COLOR0077FF,LINETHICK3;
DRAWTEXTABS(5,25, '■'+NUMTOSTRN(X,0)+'天逆市跌 ' +NUMTOSTRN(COUNT(ZDF<0 AND DPZDF>0,X),0)+'次' ),COLOR00FF00,LINETHICK3;
DRAWTEXTABS(5,45, '■'+NUMTOSTRN(X,0)+'天涨停数 ' +NUMTOSTRN(COUNT(ZDF>9.9,X),0)+'次' ),COLOR0000FF,LINETHICK3;
试庄线:2,COLORFF9900,DOTLINE;
反转线:5,COLOR00FFff,DOTLINE;
拉升线:8,COLOR0077FF,DOTLINE;
TODAY:="ddx.ddx"=0;{判断是否有正版数据}
主单买:=IF(TODAY,"DATA@DDE"(6),bigorder(1,2));
主单卖:=IF(TODAY,"DATA@DDE"(7),bigorder(2,2));
特单买:=IF(TODAY,"DATA@DDE"(4),bigorder(1,3));
特单卖:=IF(TODAY,"DATA@DDE"(5),bigorder(2,3));
HX:=HHVALL(X);
GX:=(HX- X)+1 ;
DDX:=(主单买-主单卖)*AMOUNT/10000;
DRAWTEXT(DDX>0 and GX<50,8.6,''+NUMTOSTRN(DDX,0)+'.' ),ALIGN1,color0000ff;
DRAWTEXT(DDX<0 and GX<50,8.6,''+NUMTOSTRN(-DDX,0)+'.'),ALIGN1,color00ff00;
DDXT:=(特单买-特单卖)*AMOUNT/10000;
DRAWTEXT(DDXT>0 and GX<50,7.8,''+NUMTOSTRN(DDXT,0)+'.' ),ALIGN1,color0099ff;
DRAWTEXT(DDXT<0 and GX<50,7.8,''+NUMTOSTRN(-DDXT,0)+'.'),ALIGN1,colorff9900;
DRAWTEXT(BARSTATUS=2,8.6,' >10W'),ALIGN0,COLOR00ffFF,LINETHICK2,LAYER0;
DRAWTEXT(BARSTATUS=2,7.8,' >50W'),ALIGN0,COLORFF9900,LINETHICK2,LAYER0;
HS:=vol/capital*100;
DRAWTEXT(HS and HS>1.5 and HS<9.4 and GX<50,5.6,''+NUMTOSTRN(HS,0)+'.' ),ALIGN1,color00FF00,linethick1,LAYER0;
DRAWTEXT(HS and HS>10 and GX<50,5.6,''+NUMTOSTRN(HS,0)+'.' ),ALIGN1,color0000FF,linethick1,LAYER0;
DRAWTEXT(BARSTATUS=2,5.6,' >2%换手'),ALIGN0,COLOR0000FF,LINETHICK2,LAYER0;
ZF:=(C-REF(C,1))/REF(C,1)*100;
DRAWTEXT(ZF>0.5 and GX<50,4.8,''+NUMTOSTRN(ZF,0)+'.' ),ALIGN1,color0077ff,linethick1,LAYER5;
DRAWTEXT(ZF<-0.5 and GX<50,4.8,''+NUMTOSTRN(-ZF,0)+'.' ),ALIGN1,color00ff00,linethick1,LAYER5;
DRAWTEXT(BARSTATUS=2,4.8,' >1%涨.'),ALIGN0,COLOR0077FF,LINETHICK2,LAYER0;
DRAWTEXT(BARSTATUS=2,4.8,' 跌'),ALIGN0,COLOR00FF00,LINETHICK2,LAYER0; |