通达信涨停回马枪源码

[复制链接]
查看31 | 回复0 | 2022-7-24 07:08:16 | 显示全部楼层 |阅读模式

V1:=ABS((2*CLOSE+HIGH+LOW)/4-MA(CLOSE,20))/MA(CLOSE,20);
V2:=(1-7/100)*(DMA(CLOSE,V1));
 V3:=(1+7/100)*(DMA(CLOSE,V1));
 V5:=MA((LOW+HIGH+CLOSE)/3,5);
    
EMA13:=EMA(C,13),COLORWHITE;
EMA21:=EMA(C,21),COLORYELLOW;
EMA34:=EMA(C,34),COLORFF00FF;
EMA60:=MA(C,60),COLORFFCC66;
VAR2:=(2*CLOSE+HIGH+LOW)/4;
VAR3:=IF(YEAR>=2099 AND MONTH>2,0,1);
VAR4:=LLV(LOW,5); VAR5:=HHV(HIGH,4);
散户:=EMA((VAR2-VAR4)/(VAR5-VAR4)*100,4)*VAR3;
庄家:=EMA(0.667*REF(散户,1)+0.333*散户,2)*VAR3;
 
DRAWICON(CROSS(散户,庄家) AND 散户<30,L-0.05,1);
DRAWICON(CROSS(庄家,散户) AND 散户>70,H+0.05,2);
VAR9:=CLOSE-REF(CLOSE,5);
VARA:=EMA(EMA(VAR9,5),5)/EMA(EMA(ABS(VAR9),5),5);
VARC:=EMA(EMA(VAR9,20),20)/EMA(EMA(ABS(VAR9),20),20);
卖出:=IF(VARA>0 AND CROSS(VARC,VARA),90,100);
DRAWICON(卖出<0,H+0.05,2); 买线:=EMA(CLOSE,2);
卖线:=EMA(SLOPE(CLOSE,21)*20+CLOSE,42);
B1:IF(CROSS(买线,卖线),L-0.02,DRAWNULL),CROSSDOT,LINETHICK3,COLORMAGENTA;
S1:IF(CROSS(80,RSI)*30,H+0.02,DRAWNULL),CROSSDOT,LINETHICK3,COLORYELLOW;
VC:=((CLOSE-MA(CLOSE,6))/MA(CLOSE,6)*100+(CLOSE-MA(CLOSE,24))/MA(CLOSE,24)*100+(CLOSE-MA (CLOSE,32))/MA(CLOSE,32)*100)/3;
 S2:=IF(VC>20 AND FILTER(VC< REF(VC,1),5),H+0.02,DRAWNULL),CIRCLEDOT,LINETHICK3,COLORGREEN;
A0:=(L+H+C*2)/4;
 A1:EMA(A0,14)COLORBLUE,LINETHICK2;
 A2:=EMA(A0,25)COLORLIBLUE,LINETHICK2;
 A1X:=(A1-REF(A1,1))/REF(A1,1)*100,NODRAW;
 A2X:=(A2-REF(A2,1))/REF(A2,1)*100,NODRAW;
 看多:IF(A1X>=0 AND BARSLAST(CROSS(A1X,0))>0,REF((C+O)/2,BARSLAST(CROSS(A1X,0))),DRAWNULL),COLORMAGENTA{,LINETHICK2};
 
 看空:IF(A1X<0 AND BARSLAST(CROSS(0,A1X))>0,REF((C+O)/2,BARSLAST(CROSS(0,A1X))),DRAWNULL),COLORCYAN,{LINETHICK2};
 

DRAWRECTREL(0,500,147,999.4,IF(120,RGB(10,0,0),0));


 TS:=130;
  N:=99;
  M:=3;
  MT:=3;
  M1:=5;
  M2:=7;
  M3:=21;
  M4:=12;
  M5:=50;
DA1:=IF(TS>TOTALBARSCOUNT,TOTALBARSCOUNT,TS);
  DA:=IF(CURRBARSCOUNT>DA1,0,DA1);
  HI:=REFDATE(HHV(H,DA),DATE);
  LO:=REFDATE(LLV(L,DA),DATE);
  C1:=IF(CURRBARSCOUNT<=DA,C,DRAWNULL);
  GZ:=EXP(LN(HI/LO)/10);
LH1:=SUM(IF(C1>=(HI/GZ),V,0),DA);
  LH2:=SUM(IF(C1>=(HI/POW(GZ,2)) AND C1<(HI/GZ),V,0),DA);
  LH3:=SUM(IF(C1>=(HI/POW(GZ,3)) AND C1<(HI/POW(GZ,2)),V,0),DA);
  LH4:=SUM(IF(C1>=(HI/POW(GZ,4)) AND C1<(HI/POW(GZ,3)),V,0),DA);
  LH5:=SUM(IF(C1>=(HI/POW(GZ,5)) AND C1<(HI/POW(GZ,4)),V,0),DA);
  LH6:=SUM(IF(C1>=(HI/POW(GZ,6)) AND C1<(HI/POW(GZ,5)),V,0),DA);
  LH7:=SUM(IF(C1>=(HI/POW(GZ,7)) AND C1<(HI/POW(GZ,6)),V,0),DA);
  LH8:=SUM(IF(C1>=(HI/POW(GZ,8)) AND C1<(HI/POW(GZ,7)),V,0),DA);
  LH9:=SUM(IF(C1>=(LO*GZ) AND C1<LO*POW(GZ,2),V,0),DA);
  LH10:=SUM(IF(C1>=LO AND C1<LO*GZ,V,0),DA);
  L1:=REFDATE(HHV(LH1,DA),DATE),LINETHICK0;
  L2:=REFDATE(HHV(LH2,DA),DATE),LINETHICK0;
  L3:=REFDATE(HHV(LH3,DA),DATE),LINETHICK0;
  L4:=REFDATE(HHV(LH4,DA),DATE);
  L5:=REFDATE(HHV(LH5,DA),DATE);
  L6:=REFDATE(HHV(LH6,DA),DATE);
  L7:=REFDATE(HHV(LH7,DA),DATE);
  L8:=REFDATE(HHV(LH8,DA),DATE);
  L9:=REFDATE(HHV(LH9,DA),DATE);
  L10:=REFDATE(HHV(LH10,DA),DATE);
  SS:=(L1+L2+L3+L4+L5+L6+L7+L8+L9+L10);
 
 STICKLINE(CEILING(DA*L1/SS)*3>=CURRBARSCOUNT,HI*N/100,(HI/GZ),1,1),COLOR454545,LINETHICK1;
  STICKLINE(CEILING(DA*L2/SS)*3>=CURRBARSCOUNT,HI/POW(GZ,1)*N/100,HI/POW(GZ,2),1,1),COLOR454545,LINETHICK1;
  STICKLINE(CEILING(DA*L3/SS)*3>=CURRBARSCOUNT,HI/POW(GZ,2)*N/100,HI/POW(GZ,3),1,1),COLOR454545,LINETHICK1;
  STICKLINE(CEILING(DA*L4/SS)*3>=CURRBARSCOUNT,HI/POW(GZ,3)*N/100,HI/POW(GZ,4),1,1),COLOR454545,LINETHICK1;
  STICKLINE(CEILING(DA*L5/SS)*3>=CURRBARSCOUNT,HI/POW(GZ,4)*N/100,HI/POW(GZ,5),1,1),COLOR454545,LINETHICK1;
  STICKLINE(CEILING(DA*L6/SS)*3>=CURRBARSCOUNT,HI/POW(GZ,5)*N/100,HI/POW(GZ,6),1,1),COLOR454545,LINETHICK1;
  STICKLINE(CEILING(DA*L7/SS)*3>=CURRBARSCOUNT,HI/POW(GZ,6)*N/100,HI/POW(GZ,7),1,1),COLOR454545,LINETHICK1;
  STICKLINE(CEILING(DA*L8/SS)*3>=CURRBARSCOUNT,LO*POW(GZ,2),LO*POW(GZ,3)*N/100,1,1),COLOR454545,LINETHICK1;
  STICKLINE(CEILING(DA*L9/SS)*3>=CURRBARSCOUNT,LO*POW(GZ,1),LO*POW(GZ,2)*N/100,1,1),COLOR454545,LINETHICK1;
  STICKLINE(CEILING(DA*L10/SS)*3>=CURRBARSCOUNT,LO,LO*POW(GZ,1)*N/100,1,1),COLOR454545,LINETHICK1;
  DRAWKLINE(H,O,L,C);JJ:=(CLOSE+HIGH+LOW)/3;
 
  今日保护价:(REF(C,2)+REF(C,1)+O)/3 ,COLORA2C0FF,NODRAW;
 
ZT:=C/REF(C,1)>1.097;
 XH:=FILTER(ZT,13);
 BH:=BARSLAST(ZT);
 CZ:=REF(H,BH)-REF(L,BH);
 STICKLINE(C,(REF(L,BH)+CZ*0.5),(REF(L,BH)+CZ*0.5),7,0),COLORRED;
 STICKLINE(C,REF(L,BH),REF(L,BH),7,0),COLORBLUE;
 STICKLINE(ZT,REF(O,BH),REF(C,BH),7,0),COLORYELLOW;
 DRAWTEXT(ZT,L*0.98,'涨停'),COLORFFFFFF;
 VARZT:=BARSLAST(C/REF(C,1)>1.097);
 STICKLINE(VARZT=2,L*0.97,L*0.98,8,0),COLOR0000FF;
 DRAWTEXT(VARZT=2,L*0.95,'3天'),COLORYELLOW;
 STICKLINE(VARZT=4,H*1.03,H*1.02,8,0),COLOR9966FF;
 DRAWTEXT(VARZT=4,H*1.06,'5天'),COLORYELLOW;
 STICKLINE(VARZT=7,L*0.97,L*0.98,8,0),COLOR00FFFF;
 DRAWTEXT(VARZT=7,L*0.95,'8天'),COLORYELLOW;
 STICKLINE(VARZT=12,H*1.03,H*1.02,8,0),COLORFF33FF;
 DRAWTEXT(VARZT=12,H*1.06,'13天'),COLORYELLOW;
 STICKLINE(VARZT=20,L*0.97,L*0.98,8,0),COLOR0066FF;
 DRAWTEXT(VARZT=20,L*0.95,'21天'),COLORYELLOW;
 STICKLINE(VARZT=33,H*1.03,H*1.02,8,0),COLOR9932CD;
 DRAWTEXT(VARZT=33,H*1.06,'34天'),COLORYELLOW;
 STICKLINE(VARZT=54,L*0.97,L*0.98,8,0),COLOR006600;
 DRAWTEXT(VARZT=54,L*0.95,'55天'),COLORYELLOW;
 STICKLINE(VARZT=88,H*1.03,H*1.02,8,0),COLOR00FF00;
 DRAWTEXT(VARZT=88,H*1.06,'89天'),COLORYELLOW;
 STICKLINE(VARZT=143,L*0.97,L*0.98,8,0),COLORCCFFFF;
 DRAWTEXT(VARZT=143,L*0.95,'144天'),COLORYELLOW;
 STICKLINE(VARZT=232 ,H*1.03,H*1.02,8,0),COLORFF0033;
 DRAWTEXT(VARZT=232,H*1.06,'233天'),COLORYELLOW;
 STICKLINE(VARZT=376,L*0.97,L*0.98,8,0),COLORFF9966;
 DRAWTEXT(VARZT=376,L*0.95,'377天'),COLORYELLOW;
 DRAWBAND(MA(C,2),RGB(108,0,1),MA(C,7),RGB(28,134,238));
 
三日最低:=EMA((REF(L,4)+REF(L,3)+REF(L,2))/3,3);
三日最高:=EMA((REF(H,4)+REF(H,3)+REF(H,2))/3,3),COLORWHITE;
S:=CROSS(CROSS(三日最高,C),0.6);
 B:=CROSS(CROSS(C,三日最低),0.5);
 DRAWICON(B,LOW*0.99,34);
 DRAWICON(S,H*1.00,35);
 
STICKLINE(C>=O,C,O,3.4,0),COLOR0000AA;
 STICKLINE(C>=O,C,O,3.0,0),COLOR0000BB ;
 STICKLINE(C>=O,C,O,2.4,0),COLOR0000CC;
 STICKLINE(C>=O,C,O,2.0,0),COLOR0000DD ;
 STICKLINE(C>=O,C,O,1.6,0),COLOR0000EE;
 STICKLINE(C>=O,C,O,1.2,0),COLOR0000FF;
 STICKLINE(C>=O,C,O,0.6,0),COLOR0000FF;
 STICKLINE(C>=O,H,L,0,0),COLORRED;
 STICKLINE(C<=O,C,O,3.4,0),COLORAAAA00;
 STICKLINE(C<=O,C,O,3.0,0),COLORBBBB00;
 STICKLINE(C<=O,C,O,2.4,0),COLORCCCC00;
 STICKLINE(C<=O,C,O,2.0,0),COLORDDDD00;
 STICKLINE(C<=O,C,O,1.6,0),COLOREEEE00;
 STICKLINE(C<=O,C,O,1.2,0),COLORFFFF00;
 STICKLINE(C<=O,C,O,0.6,0),COLORFFFF00;
 STICKLINE(C<=O,H,L,0,0),COLORFFFF00;

N1:=10;
 T1:=CONST(HHVBARS(V,10)),COLOR0000FF,LINETHICK1;
 量能平台:IF(CURRBARSCOUNT<=N1+15,CONST(IF(T1=0,C,REF(C,T1))),DRAWNULL),COLOR00FFFF,LINETHICK1;
 新量能点:IF(CURRBARSCOUNT=T1+1,量能平台,DRAWNULL),CIRCLEDOT,COLORFFFFFF,LINETHICK9;
 DRAWTEXT(ISLASTBAR,量能平台,' 量能平台'),COLOR00F0F0;

HV:=HHV(V,5)=V OR V/REF(V,1)>=5;
 FT:=BARSLAST(HV);
 量能平台1:=IF(HV,C,REF(C,FT));
 DRAWTEXT(量能平台1>REF(量能平台1,1)AND C<REF(C,1),L,'*带量跌'),COLORGREEN;
 DRAWTEXT(量能平台1<REF(量能平台1,1) AND C>REF(C,1),L,'*缩量涨'),COLORYELLOW;
 DRAWTEXT(量能平台1>REF(量能平台1,1) AND C>REF(C,1) AND C>MA(C,13) AND C=HHV(C,20) AND C/REF(C,1)>1.05,L,'*突破量'),COLORFFFFFF;

 
 超B:=L2_AMO(0,2)/10000.0;
 大B:=L2_AMO(1,2)/10000.0;
 中B:=L2_AMO(2,2)/10000.0;
 小B:=L2_AMO(3,2)/10000.0;
 超S:=L2_AMO(0,3)/10000.0;
 大S:=L2_AMO(1,3)/10000.0;
 中S:=L2_AMO(2,3)/10000.0;
 小S:=L2_AMO(3,3)/10000.0;
 TESTSKIP(NOT(超B OR 大B OR 中B OR 小B OR 超S OR 大S OR 中S OR 小S)!=0);
 大宗进:=(超B)+(大B),NODRAW;
 大宗出:=(超S)+(大S),NODRAW;
 非大宗进:=(中B)+(小B),NODRAW;
 非大宗出:=(中S)+(小S),NODRAW;
 大宗进限制:=IF((超B+大B)=0,0,大宗进);
 大宗出限制:=IF((超S+大S)=0,0,大宗出);
 非大宗进限制:=IF(中B+小B=0,0,非大宗进);
 非大宗出限制:=IF(中S+小S=0,0,非大宗出);
 主力净流入:=(超B+大B)-(超S+大S),COLORRED,NODRAW;
 散户净流入:=(中B+小B)-(中S+小S),COLORRED,NODRAW;
 净流入:=(超B+大B+中B+小B)-(超S+大S+中S+小S),COLORRED,NODRAW;
 大单流入:=(超B+大B)/(超B+大B+超S+大S)*100,NODRAW;
 大单流入限制:=IF((超B+大B+超S+大S)=0,0,大单流入);
 大单流出比:=(超S+大S)/(超B+大B+超S+大S)*100,NODRAW;
 大单流出限制:=IF((超B+大B+超S+大S)=0,0,大单流出比);
 总流入比:=(超B+大B+中B+小B)/(超B+大B+中B+小B+超S+大S+中S+小S)*100,NODRAW;
 总流出比:=(超S+大S+中S+小S)/(超B+大B+中B+小B+超S+大S+中S+小S)*100,NODRAW;
 成交总量:=(超B+大B+中B+小B+超S+大S+中S+小S),NODRAW;
 机构参与度:=(超B+超S+大B+大S)/成交总量*100,COLORYELLOW,NODRAW;
 大单强度:=(超B+大B-超S-大S)/成交总量*100,COLORYELLOW,NODRAW;
 大单强度限制:=IF(大单强度=0,-100,大单强度);
 大单强度比:=IF(大单强度>=0,(大单强度限制+100)/2,100-ABS((大单强度限制-100)/2)),NODRAW;
 超单强度:=(超B-超S)/(超B+超S)*100,COLORYELLOW,NODRAW;
 超单强度限制:=IF(超单强度=0,-100,超单强度);
 超单强度比:=IF(超单强度>0,(超单强度限制+100)/2,IF(超单强度<0,100-ABS((超单强度限制-100)/2),0)),NODRAW;
 
DAZHIV:=CONST(MAX(ABS(大宗进),MAX(ABS(大宗出),MAX(ABS(非大宗进),ABS(非大宗出))))),NODRAW;
 DRAWRECTREL(0,CONST(930-(ABS(大宗进)*250/DAZHIV)),35,950,IF(CONST(大宗进>0),RGB(255,0,0),RGB(23,125,255)));
 DRAWRECTREL(37,CONST(930-(ABS(大宗出)*250/DAZHIV)),72,950,IF(CONST(大宗出>0),RGB(23,125,255),RGB(255,0,0)));
 DRAWRECTREL(75,CONST(930-(ABS(非大宗进)*250/DAZHIV)),110,950,IF(CONST(非大宗进>0),RGB(255,0,0),RGB(23,125,255)));
 DRAWRECTREL(112,CONST(930-(ABS(非大宗出)*250/DAZHIV)),147,950,IF(CONST(非大宗出>0),RGB(23,125,255),RGB(255,0,0)));
 DRAWRECTREL(150,CONST(940-(ABS(净流入)*250/DAZHIV))-20,190,950,IF(CONST(净流入>0),RGB(200,0,0),RGB(0,125,50)));
 DRAWTEXT_FIX(CURRBARSCOUNT=1,0.0001,0.9,0,STRCAT('',CON2STR(大宗进/1,0))),COLORYELLOW;
 DRAWTEXT_FIX(CURRBARSCOUNT=1,0.036,0.9,0,STRCAT('',CON2STR(大宗出/1,0))),COLORYELLOW;
 DRAWTEXT_FIX(CURRBARSCOUNT=1,0.074,0.9,0,STRCAT('',CON2STR(非大宗进/1,0))),COLORYELLOW;
 DRAWTEXT_FIX(CURRBARSCOUNT=1,0.111,0.9,0,STRCAT('',CON2STR(非大宗出/1,0))),COLORYELLOW;
 DRAWTEXT_FIX(CURRBARSCOUNT=1,0.150,0.9,0,STRCAT('',CON2STR(净流入/1,0))),COLORYELLOW;
 DRAWTEXT_FIX(1,0.000,0.99,0,STRCAT(STRCAT('主力 ',CON2STR(主力净流入,0)),'万')),COLORMAGENTA;
 DRAWTEXT_FIX(1,0.078,0.99,0,STRCAT(STRCAT('散户 ',CON2STR(散户净流入,0)),'万')),COLORCYAN;
 DRAWTEXT_FIX(CURRBARSCOUNT=1,0.145,0.99,0,'净流入:(万)'),COLORYELLOW;
 主力买力度:=LARGEINTRDVOL*1000/VOL;
 主力卖力度:=LARGEOUTTRDVOL*1000/VOL;
 AAD:=CONST(MAX(ABS(主力买力度),ABS(主力卖力度)))*4,NODRAW;
 DRAWRECTREL(0,515,CONST(ABS(主力买力度)*560/AAD),568,IF(CONST(主力买力度)>0,RGB(255,0,0),RGB(0,50,0)));
 DRAWRECTREL(0,570,CONST(ABS(主力卖力度)*560/AAD),623,IF(CONST(主力卖力度)>0,RGB(0,50,0),RGB(255,0,0)));
 DRAWTEXT_FIX(1,0,0.524,0,STRCAT('主买力度:',CON2STR(主力买力度,0))),COLORYELLOW;
 DRAWTEXT_FIX(1,0,0.576,0,STRCAT('主卖力度:',CON2STR(主力卖力度,0))),COLORYELLOW;

73711545.jpg

73711545.jpg

 

回复

使用道具 举报

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

本版积分规则