通达信进抛、压力支撑画线主图指标 源码

[复制链接]
查看260 | 回复0 | 2021-8-28 00:20:23 | 显示全部楼层 |阅读模式

以下是通达信进抛、压力支撑画线主图指标 源码(无源码的请下载附件导入)

DRAWTEXT_FIX(1,0.0,10.0,0,'减持信息:'),COLORWHITE;
DRAWTEXT_FIX(1,0.05,10.0,0,EXTERNSTR(0,3)),COLORWHITE;

年开盘:CONST(O#YEAR),NODRAW;
年最高:CONST(H#YEAR),COLORRED,NODRAW;
年最低:CONST(L#YEAR),COLORCYAN,NODRAW;
年最新:DYNAINFO(7),DOTLINE,NODRAW;
年开盘后净差:ABS(DYNAINFO(7)-O#YEAR),NODRAW,COLORMAGENTA;
年开盘后涨跌幅:(DYNAINFO(7)-O#YEAR)/O#YEAR*100,NODRAW,COLORCYAN;
年低点至今涨幅%:(C-(L#YEAR))/(L#YEAR)*100,NODRAW,COLORRED;
年高点至今跌幅%:((H#YEAR)-C)/(H#YEAR)*100,NODRAW,COLORGREEN;
{年涨跌}
年O:=O#YEAR,NODRAW;
年C:=C#YEAR,NODRAW;
年H:=H#YEAR,NODRAW;
年L:=L#YEAR,NODRAW;
高:=REFDATE(CONST(REF(HHV(H,DATE),DATE)),DATE),DOTLINE;
低:=REFDATE(CONST(REF(LLV(L,DATE),DATE)),DATE),DOTLINE;
GD:=CONST(FINDHIGH(H,0,高*DATE,1));
DB:=CONST(FINDLOW(L,0,低*DATE,1));
GT:=CONST(BARSLAST(GD=H))+1;
DT:=CONST(BARSLAST(DB=L))+1;
上:=CONST(HHV(H,0));
下:=CONST(LLV(L,0));
STICKLINE(CURRBARSCOUNT=DT,上,下,0,0),COLORWHITE;
STICKLINE(CURRBARSCOUNT=GT,上,下,0,0),COLORWHITE;


MID:=(3*C+L+O+H)/6;
牛:=(20*MID+19*REF(MID,1)+18*REF(MID,2)+17*REF(MID,3)+16*REF(MID,4)+15*REF(MID,5)+14
*REF(MID,6)+13*REF(MID,7)+12*REF(MID,8)+11*REF(MID,9)+10*REF(MID,10)+9*REF(MID,11)+8
*REF(MID,12)+7*REF(MID,13)+6*REF(MID,14)+5*REF(MID,15)+4*REF(MID,16)+3*REF(MID,17)+2
*REF(MID,18)+REF(MID,20))/210;
线:=MA(牛,2);
STICKLINE(牛>=线 AND C<O,C,O,3,0),COLORFF00CC;
STICKLINE(牛>=线 AND C>O,C,O,3,1),COLORFF00CC;
STICKLINE(牛>=线,H,MAX(C,O),0,0),COLORFF00CC;
STICKLINE(牛>=线,L,MIN(C,O),0,0),COLORFF00CC;
STICKLINE(牛<线 AND C<O,C,O,3,0),COLORCYAN;
STICKLINE(牛<线 AND C>O,C,O,3,1),COLORCYAN;
STICKLINE(牛<线,H,MAX(C,O),0,0),COLORCYAN;
STICKLINE(牛<线,L,MIN(C,O),0,0),COLORCYAN;
DRAWTEXT(YEAR!=REF(YEAR,1),H+0.3,VARCAT(VAR2STR(YEAR,0),' 年 ')),COLORWHITE;
STICKLINE(YEAR!=REF(YEAR,1)=1,CONST(HHV(H,0)),CONST(LLV(L,0)),0,0),COLORRED;
成本:DMA(AMOUNT/(100*VOL),VOL/CAPITAL),COLORYELLOW,LINETHICK1;
DRAWTEXT(CURRBARSCOUNT=1,成本,STRCAT(' ',CON2STR(成本,2))),COLORLIRED;
涨停:=IF(REF(C,1)*1.095-C<0.01,1,0);
STICKLINE(涨停,O,C,3,0),COLORLIRED;
STICKLINE(涨停,O,C,3,0),COLORLIRED;
C3:=REF(C,1);
跌停:=IF((C3-C)*100/C3>=(10-0.01*100/C3),1,0);
STICKLINE(跌停,O,C,3,0),COLORGREEN;
STICKLINE(跌停,O,C,3,0),COLORGREEN;

天:MA(C,10),COLOR008000,LINETHICK3;
人:HHV(天,5),COLOR007AAA,LINETHICK3;
地:天-(人-天),COLOR000088,LINETHICK3;
DRAWTEXT(人=地 AND REF(人,1)>REF(地,1),地,'进'),COLORYELLOW;
DRAWTEXT(人>地 AND REF(人,1)=REF(地,1),人*1.02,'抛'),COLORYELLOW;
DRAWTEXT(CURRBARSCOUNT=1,天,STRCAT('  ',CON2STR(天,2))),COLORGREEN;
DRAWTEXT(CURRBARSCOUNT=1,人,STRCAT('  ',CON2STR(人,2))),COLOR007FFF;
DRAWTEXT(CURRBARSCOUNT=1,地,STRCAT('  ',CON2STR(地,2))),COLORRED;

P1:=C>REF(C,4);
P2:=BARSLASTCOUNT(P1);
DRAWTEXT(P2=9,H+H*0.02,'★9'),COLORYELLOW;
Z1:=C<REF(C,4);
Z2:=BARSLASTCOUNT(Z1);
DRAWTEXT(Z2=9,L-L*0.02,'★9'),COLORYELLOW;

T:=FINDHIGHBARS(H,30,30,1);
A:DRAWLINE(CURRBARSCOUNT=CONST(T)+1,H,ISLASTBAR,REF(H,T),0),COLORGRAY,LINETHICK1;
DRAWTEXT(CURRBARSCOUNT=1,A,STRCAT(' ',CON2STR(A,2))),COLORYELLOW;
TT:=BARSLAST(C>A*1.014 AND L<A);
TA:=BARSLAST(CROSS(A!=DRAWNULL,0.5));
TJ:=VOL=HHV(VOL,T+1) AND TA>28;
T1:=COUNT(EXPMA(C,2)>=A,TA+1)=1 AND EXPMA(C,2)>=A*1.01;
E1:=EXPMA(C,TA+1);
CJ:=(A/E1-1) *100 ;
HH:=HHV(CJ,10);
XG:=COUNT(TT=0,T+1)=1 AND TT=0 AND TJ AND T1 AND HH<20;
STICKLINE(XG,H,L,0,0),COLORFF00FF;
STICKLINE(XG,C,O,3,0),COLOR990099;
STICKLINE(XG,C,O,2,0),COLORBB00BB;
STICKLINE(XG,C,O,1,0),COLORDD00DD;
STICKLINE(XG,C,O,0.3,0),COLORFF00FF;

N:=13;
AA:=REF(H,N)=HHV(H,2*N+1);
BB:=BACKSET(AA,N+1);
CC:=FILTER(BB,N) AND H=HHV(H,N+1);
DD:=BARSLAST(CC);
EE:=IF(CC,CURRBARSCOUNT,0);
AA1:=REF(L,N)=LLV(L,2*N+1);
BB1:=BACKSET(AA1,N+1);
CC1:=FILTER(BB1,N) AND L=LLV(L,N+1);
DD1:=BARSLAST(CC1);
EE1:=IF(CC1,CURRBARSCOUNT,0);
FF1:=IF(DD1,REF(EE1,DD1),EE1);
GG1:=IF(DD,REF(EE,DD),EE);
SS1:=REF(GG1,DD+1);
SS2:=REF(FF1,DD1+1);
G21:=CONST(GG1);
GS2:=CONST(SS1);
DS2:=CONST(SS2);
压:DRAWLINE(CURRBARSCOUNT=GS2,H,CURRBARSCOUNT=G21,H,1),COLORBROWN,LINETHICK1;
撑:DRAWLINE(CURRBARSCOUNT=DS2,L,CURRBARSCOUNT=FF1,L,1),COLORBROWN,LINETHICK1;

M:=INTPART(3*N/5);
AAA:=REF(H,M)=HHV(H,2*M+1);
QYY:=BACKSET(AAA,M+1);
CCC:=FILTER(QYY,M) AND H=HHV(H,M+1);
DDH:=BARSLAST(CCC),NODRAW;
GSS:=IF(CCC,CURRBARSCOUNT,0);
DIS:=IF(DDH,REF(GSS,DDH),GSS);
G11:=CONST(DIS);
DI1:=REF(DIS,DDH+1);
G22:=CONST(DI1);
压M:DRAWLINE(CURRBARSCOUNT=G22,H,CURRBARSCOUNT=G11,H,1),COLORBROWN,LINETHICK1;

A11:=REF(L,M)=LLV(L,2*M+1);
Q11:=BACKSET(A11,M+1);
C11:=FILTER(Q11,M) AND L=LLV(L,M+1);
D11:=BARSLAST(C11);
DSS:=IF(C11,CURRBARSCOUNT,0);
DDT:=IF(D11,REF(DSS,D11),DSS);
D22:=REF(DDT,D11+1);
S22:=CONST(D22);
撑M:DRAWLINE(CURRBARSCOUNT=S22,L,CURRBARSCOUNT=D11,L,1),COLORBROWN,LINETHICK1;
DRAWTEXT(CURRBARSCOUNT=1,撑M,STRCAT(' ',CON2STR(撑M,2))),COLORGREEN;
DRAWTEXT(CURRBARSCOUNT=1,压M,STRCAT(' ',CON2STR(压M,2))),COLORGREEN;
DRAWTEXT(CURRBARSCOUNT=1,压,STRCAT(' ',CON2STR(压,2))),COLORGREEN;
DRAWTEXT(CURRBARSCOUNT=1,撑,STRCAT(' ',CON2STR(撑,2))),COLORGREEN;

M4:=EMA(C,40);
M6:=EMA(C,60);
AS:=BARSLAST(M4>M6 AND (MA2=M4 OR MA2>M4));
BS:=REF(COUNT(C<M6,AS)=AS,1);
CS:=CROSS(C,M6) AND VOL>MA(VOL,5) AND (C-REF(C,1))/REF(C,1)*100>3;
水:=BS AND CS;
STICKLINE(水,C,O,3,0),COLORYELLOW;

{趋势线}
N1:=5;
A1:=BACKSET(ISLASTBAR,PEAKBARS(1,N1,1)+1);
A2:=A1>REF(A1,1);
B1:=BACKSET(ISLASTBAR,PEAKBARS(1,N1,2)+1);
B2:=B1>REF(B1,1);
C1:=BACKSET(ISLASTBAR,PEAKBARS(1,N1,3)+1);
C2:=C1>REF(C1,1);
AS1:=BACKSET(ISLASTBAR,TROUGHBARS(2,N1,1)+1);
A21:=AS1>REF(AS1,1);
B11:=BACKSET(ISLASTBAR,TROUGHBARS(2,N1,2)+1);
B21:=B11>REF(B11,1);
CS1:=BACKSET(ISLASTBAR,TROUGHBARS(2,N1,3)+1);
C21:=CS1>REF(CS1,1);
①:DRAWLINE(B2,H,A2,H,1),COLORGRAY;
②:DRAWLINE(C2,H,B2,H,1),COLORGRAY;
③:IF(A1,PEAK(1,N1,1),DRAWNULL),COLORGRAY;
④:DRAWLINE(C2,H,A2,H,1),COLORGRAY;
⑤:DRAWLINE(B21,L,A21,L,1),COLORGRAY;
⑥:DRAWLINE(C21,L,B21,L,1),COLORGRAY;
⑦:DRAWLINE(C21,L,A21,L,1),COLORGRAY;
⑧:IF(A11,TROUGH(2,N1,1),DRAWNULL),COLORGRAY;
DRAWTEXT(CURRBARSCOUNT=1,①,STRCAT(' ',CON2STR(①,2))),COLORYELLOW;
DRAWTEXT(CURRBARSCOUNT=1,②,STRCAT(' ',CON2STR(②,2))),COLORYELLOW;
DRAWTEXT(CURRBARSCOUNT=1,③,STRCAT(' ',CON2STR(③,2))),COLORYELLOW;
DRAWTEXT(CURRBARSCOUNT=1,④,STRCAT(' ',CON2STR(④,2))),COLORYELLOW;
DRAWTEXT(CURRBARSCOUNT=1,⑤,STRCAT(' ',CON2STR(⑤,2))),COLORYELLOW;
DRAWTEXT(CURRBARSCOUNT=1,⑥,STRCAT(' ',CON2STR(⑥,2))),COLORYELLOW;
DRAWTEXT(CURRBARSCOUNT=1,⑦,STRCAT(' ',CON2STR(⑦,2))),COLORYELLOW;
DRAWTEXT(CURRBARSCOUNT=1,⑧,STRCAT(' ',CON2STR(⑧,2))),COLORYELLOW;

1023311301.png

1023311301.png

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则