以下是通达信北沙矩形源码副图(无源码的请下载附件导入)
{T:10 10000 150;TT:1,100,3 ; N1: 0 , 500 , 0}
{量能平台}
N1:=30;
T1:=CONST(HHVBARS(V,N1));
T0:IF(CURRBARSCOUNT<=N1+7,CONST(IF(T1=0,C,REF(C,T1))),DRAWNULL),LINETHICK3;
IF(CURRBARSCOUNT=T1+1,T0,DRAWNULL),CIRCLEDOT;
DRAWTEXT(ISLASTBAR,T0,' 量能平台');
STICKLINE(ISLASTBAR,HHV(C,5)*0.95-0.01,HHV(C,5)*0.95,100,0),COLORWHITE,LINETHICK3;
DRAWNUMBER(ISLASTBAR,HHV(C,5)*0.95-0.01,HHV(C,5)*0.95),LINETHICK3;
止损点:=(ISLASTBAR,HHV(C,5)*0.95-0.01,HHV(C,5)*0.95),LINETHICK3;
DRAWTEXT(ISLASTBAR ,止损点,' 止损点'),LINETHICK3;
自动画线:DRAWLINE(HIGH>=HHV(HIGH,10),HIGH,LOW<=LLV(LOW,3),HHV(HIGH,3),1),COLORMAGENTA,LINETHICK2;
A5:MA(C,5),COLORWHITE,LINETHICK2;
A10:MA(C,10),COLORFFAA00,LINETHICK2;
A20:MA(C,20),LINETHICK2;
A60:MA(C,60),COLOR00FFFF,LINETHICK2;
高1:=REF(HHV(H,T),TT);
低1:=REF(LLV(L,T),TT);
H1:=高1-(高1-低1)*0.191;
H2:=高1-(高1-低1)*0.382;
H03:=高1-(高1-低1)*0.5;
H4:=高1-(高1-低1)*0.618;
H5:=高1-(高1-低1)*0.809;
顶:REFDATE(高1,DATE),COLORFFFF00 DOTLINE;
一:REFDATE(H1,DATE),COLORYELLOW DOTLINE;
二:REFDATE(H2,DATE),COLORMAGENTA DOTLINE;
三:REFDATE(H03,DATE),COLOR00FFFF DOTLINE;
四:REFDATE(H4,DATE),COLORMAGENTA DOTLINE;
五:REFDATE(H5,DATE),COLORYELLOW DOTLINE;
低:REFDATE(低1,DATE),COLOR00FF00 DOTLINE;
TT3:=(CURRBARSCOUNT=5);
TT4:=(CURRBARSCOUNT=5+3);
DRAWTEXT(TT4 AND 顶,顶,'高:'),COLOR208FFF;
DRAWTEXT(TT4 AND 一,一,'191:'),COLOR208FFF;
DRAWTEXT(TT4 AND 二,二,'382:'),COLOR208FFF;
DRAWTEXT(TT4 AND 三,三,'1/2:'),COLOR208FFF;
DRAWTEXT(TT4 AND 四,四,'618:'),COLOR208FFF;
DRAWTEXT(TT4 AND 五,五,'809:'),COLOR208FFF;
DRAWTEXT(TT4 AND 低,低*1.009,'低:'),COLOR208FFF;
HIGHN:=10;LOWN:=10;HIGHDISPLAY:=0;LOWDISPLAY:=0;ZGDISPLAY:=0;MADISPLAY:=0;
AA:=REF(H,HIGHN)=HHV(H,2*HIGHN+1);
QY:=BACKSET(AA,HIGHN+1);
CC:=FILTER(QY,HIGHN) AND H=HHV(H,HIGHN+1);
DDD:=BARSLAST(CC);
GDTS:=IF(CC,CURRBARSCOUNT,0);
DINGBU:=IF(DDD,REF(H,DDD),H);
DINGBUTS:=IF(DDD,REF(GDTS,DDD),GDTS);
DINGBU1:=REF(DINGBU,DDD+1);
GDCS1:=CONST(DINGBUTS);
DINGBUTS1:=REF(DINGBUTS,DDD+1);
GDCS2:=CONST(DINGBUTS1);
DINGBU2:=REF(DINGBU1,DDD+1);
MM:=IF(CURRBARSCOUNT>GDCS2,0,1);
高点压力:DRAWLINE(CURRBARSCOUNT=GDCS2,H,CURRBARSCOUNT=GDCS1,H,1),LINETHICK3 ;
DRAWLINE(CURRBARSCOUNT=GDCS2,H,ISLASTBAR,REF(H,GDCS2-1),1);
DRAWLINE(CURRBARSCOUNT=GDCS1,H,ISLASTBAR,REF(H,GDCS1-1),1);
AA1:=REF(L,LOWN)=LLV(L,2*LOWN+1);
QY1:=BACKSET(AA1,LOWN+1);
CC1:=FILTER(QY1,LOWN) AND L=LLV(L,LOWN+1);
DD1:=BARSLAST(CC1);
DDTS:=IF(CC1,CURRBARSCOUNT,0);
YDB:=IF(DD1,REF(L,DD1),L);
DDTS1:=IF(DD1,REF(DDTS,DD1),DDTS);
DDCS1:=CONST(DDTS1);
ZDB:=REF(YDB,DD1+1);
DDTS2:=REF(DDTS1,DD1+1);
DDCS2:=CONST(DDTS2);
低点支撑:DRAWLINE(CURRBARSCOUNT=DDCS2,L,CURRBARSCOUNT=DDCS1,L,1),COLOR1880FF,LINETHICK3 ;
ZGSTAR:=(高点压力+低点支撑)/2;
ZGEND:=CONST((高点压力+低点支撑)/2);
STARDAY:=IF(DDCS2<GDCS2,DDCS2,GDCS2);
中轨:DRAWLINE(CURRBARSCOUNT=STARDAY,ZGSTAR,ISLASTBAR,ZGEND,1);
DRAWLINE(CURRBARSCOUNT=DDCS1,L,ISLASTBAR,REF(L,DDCS1-1),1);
DRAWLINE(CURRBARSCOUNT=DDCS2,L,ISLASTBAR,REF(L,DDCS2-1),1);
MA2:=EMA(C,2);
DRAWTEXT_FIX(1,0.14,0,0,'所属地区:')COLOR00FFFF;
DRAWTEXT_FIX(1,0.20,0,0,DYBLOCK)COLOR00FFFF;
DRAWTEXT_FIX(1,0.30,0.00,0,'主题投资1:')COLORFFCC66;
DRAWTEXT_FIX(1,0.36,0.00,0,EXTERNSTR(0,2))COLORFFCC66;
DRAWTEXT_FIX(1,0.00,0.05,0,'主营业务1:')COLOR0000FF;
DRAWTEXT_FIX(1,0.06,0.05,0,EXTERNSTR(0,3))COLOR0000FF;
DRAWTEXT_FIX(1,0.20,0.88,0,HYBLOCK)COLOR0000FF;
65566795.png
|