个股与对应大盘强弱对比指标为主图指标。N...
个股与对应大盘强弱对比指标
为主图指标。
N为参数,表示为20个周期内两者的对比。可自行设置和调整参数。
此为主图指标。为个人多年前原创。今天送给有缘人。#散户互助炒股#
源码如下:
{N:0,999,20}{此句定义参数N,默认值为20}
C1:=EMA(INDEXC,150)/EMA(C,150);
D1:=INDEXO/C1;
D2:=INDEXH/C1;
D3:=INDEXL/C1;
D4:=INDEXC/C1;
个股涨幅:(C/REF(C,1)-1)*100,LINETHICK0;
大盘涨幅:(INDEXC/REF(INDEXC,1)-1)*100,LINETHICK0;
个股涨幅N:(C/REF(C,N)-1)*100,LINETHICK0;
大盘涨幅N:(INDEXC/REF(INDEXC,N)-1)*100,LINETHICK0;
I:=COUNT(大盘涨幅<个股涨幅,N);
大盘:=(INDEXC-REF(INDEXC,N))/REF(INDEXC,N)*100;
个股:=(C-REF(C,N))/REF(C,N)*100;
强于大盘:=I,LINETHICK0;
STICKLINE(D4>=REF(D4,1) AND D1<=D4,D3,D2,0.00001,0),COLORRED;
STICKLINE(D4>=REF(D4,1) AND D1<=D4,D4,D1,3,0),COLORRED;
STICKLINE(D4>=REF(D4,1) AND D1>D4,D4,D1,3,1),COLOR00EE00;
STICKLINE(D4>=REF(D4,1) AND D1>D4,D1,D2,0.00001,1),COLOR00EE00;
STICKLINE(D4>=REF(D4,1) AND D1>D4,D3,D4,0.00001,1),COLOR00EE00;
STICKLINE(D4<REF(D4,1) AND D1<=D4,D4,D2,0.00001,1),COLORRED;
STICKLINE(D4<REF(D4,1) AND D1<=D4,D3,D1,0.00001,1),COLORRED;
STICKLINE(D4<REF(D4,1) AND D1<=D4,D1,D4,3,0),COLORRED;
STICKLINE(D4<REF(D4,1) AND D1>D4,D1,D2,0.00001,1),COLOR00EE00;
STICKLINE(D4<REF(D4,1) AND D1>D4,D3,D4,0.00001,1),COLOR00EE00;
STICKLINE(D4<REF(D4,1) AND D1>D4,D4,D1,3,1),COLOR00EE00;
LC := REF(CLOSE,1);
RSI1:=SMA(MAX(CLOSE-LC,0),6,1)/SMA(ABS(CLOSE-LC),6,1)*100;
ZSLC :=REF(INDEXC,1);
大盘RSI1:=SMA(MAX(INDEXC-ZSLC,0),6,1)/SMA(ABS(INDEXC-ZSLC),6,1)*100;
强弱系数:RSI1/大盘RSI1,NODRAW,COLORYELLOW;
DRAWTEXT_FIX( ISLASTBAR AND 大盘<个股,0.06,0,0,STRCAT(STRCAT('最近 ',CON2STR(N,0)),' 个交易日与大盘对比: 强于大盘')),COLORYELLOW;
DRAWTEXT_FIX( ISLASTBAR AND 大盘>个股,0.06,0,0,STRCAT(STRCAT('最近 ',CON2STR(N,0)),' 个交易日与大盘对比: 弱于大盘')),COLORYELLOW;
DRAWTEXT_FIX(ISLASTBAR,0.06,0.05,0,STRCAT(STRCAT('大盘累计涨幅: ',CON2STR(大盘,2)),'%')),COLORYELLOW;
DRAWTEXT_FIX(ISLASTBAR,0.06,0.10,0,STRCAT(STRCAT('个股累计涨幅: ',CON2STR(个股,2)),'%')),COLORYELLOW;
DRAWTEXT_FIX(ISLASTBAR,0.06,0.15,0,STRCAT(STRCAT('强于大盘: ',CON2STR(I,2)),' 天')),COLORYELLOW;
DRAWTEXT_FIX(ISLASTBAR,0.06,0.20,0,STRCAT(STRCAT('弱于大盘: ',CON2STR(N-I,2)),' 天')),COLORYELLOW;
强弱系数为个股与对应大盘RSI的比值。
分享阳光,分享快乐!