以下是通达信金通道源码附图
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;
DRAWBAND(MA(C,2),RGB(108,0,1),MA(C,7),RGB(28,134,238));
上18H:WMA(SMA(HHV(HIGH,18),9/2,1),3);
下18L:WMA(SMA(LLV(LOW,18),9/2,1),3);
通道:(上18H+下18L)/2;
DRAWBAND(上18H,RGB(68,0,1),通道,RGB(68,0,1));
DRAWBAND(通道,RGB(3,43,63),下18L,RGB(3,43,63));
WMA(SMA(HHV(HIGH,18),9/2,1),3),COLOR0080FF,DOTLINE;
WMA(SMA(LLV(LOW,18),9/2,1),3),COLOR0080FF,DOTLINE;
(上18H+下18L)/2,COLORFFFFFF;
MA5:WMA(C,5),COLOR808080;
IF(MA5>REF(MA5,1),MA5,DRAWNULL),COLORRED,LINETHICK3;
{高抛.低吸}
RC:=(H+L+C*2)/4;
R2D:=WMA(RC,27);
R2E:=STD(RC,27);
R3F:=(RC-R2D)/R2E*100;
R40:=WMA(R3F,3);
R41:=WMA(R40,3);
JD:=WMA(R41,2);
AJ:=3*R41-2*JD;
DRAWTEXT(CROSS(AJ,JD) ,L-0.0.9,’★’),COLOR00FFFF,LINETHICK1;
DRAWTEXT(CROSS(JD,AJ) ,H+0.0.9,’★’),COLORFFFF00,LINETHICK1;
今日保护价:(REF(C,2)+REF(C,1)+O)/3 ,COLOR4080FF,NODRAW;
三日最低:=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;
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)NODRAW,COLORFFFFFF,LINETHICK1;
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)DOTLINE,COLOR00FFFF{,LINETHICK2};
看空:IF(A1X<0 AND BARSLAST(CROSS(0,A1X))>0,REF((C+O)/2,BARSLAST(CROSS(0,A1X))),DRAWNULL)DOTLINE,COLORCYAN,{LINETHICK2};
STICKLINE(CROSS(A1X,0),H,L,0,0 ),COLOR9933FF;
STICKLINE(CROSS(A1X,0),C,O,3,0 ),COLOR0000CC;
STICKLINE(CROSS(A1X,0),C,O,1,0 ),COLOR0033FF;
STICKLINE(CROSS(0,A1X),L,H,0,0 ),COLOR66CC33;
N1:=10;
T1:=CONST(HHVBARS(V,10)),COLOR0000FF,LINETHICK1;
量能平台:IF(CURRBARSCOUNT<=N1+15,CONST(IF(T1=0,C,REF(C,T1))),DRAWNULL),COLORFFFFFF,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;
TT:=IF(ISLASTBAR,240/FROMOPEN,1);
NN:=120;
HH:=HHV(V*TT,NN);
LL:=LLV(V,NN);
最高:=CONST(HH);
最低:=CONST(LL);
最高2:=CONST(HHV(H,NN));
最低2:=CONST(LLV(L,NN));
PP:=IF((最高2*0.9-(最高2-最低2)*0.5)>CONST(LLV(L,20)),0.9,IF((最高2*0.9-(最高2-最低2)*0.5)>CONST(LLV(L,50)),0.7,0.6)),NODRAW;
RCC1:=最高2*0.9-(最高2-最低2)*PP;
最低3:=MIN(RCC1,最低2);
AA:=最低3;
MA20:MA(C,20),COLORRED,LINETHICK1;
MA55:MA(C,55),COLORRED,CIRCLEDOT;
IF(MA20<REF(MA20,1),MA20,DRAWNULL),COLOR00FF00,LINETHICK1;
IF(MA55<REF(MA55,1),MA55,DRAWNULL),COLOR408000,CIRCLEDOT;
BB:MA(MA(CLOSE,3),1),LINETHICK1,COLORFFFF00;
IF(BB>=REF(BB,1),BB,DRAWNULL),COLOR0000FF,LINETHICK1;
STICKLINE(BB>=REF(BB,1),AA-0.000*AA,AA-0.050*AA,3,0),COLOR000074;
STICKLINE(BB<REF(BB,1),AA-0.010*AA,AA-0.040*AA,3,1),COLORFFFF00;
DRAWRECTREL(0,500,147,999.4,IF(120,RGB(10,0,0),0));
超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;
评论(0)