以下是通达信线的角度源码主图贴图(无源码的请下载附件导入)
N的参数是10
HH20:=CONST(HHV(H,N*3));
LL20:=CONST(LLV(L,N*3));
K:=(HH20-LL20)/(N),NODRAW;
XY:DRAWLINE(CURRBARSCOUNT=N,LL20,CURRBARSCOUNT=1,HH20,0),LINETHICK1,COLORFFFFFF;
YX:DRAWLINE(CURRBARSCOUNT=N,HH20,CURRBARSCOUNT=1,LL20,0),LINETHICK1,COLORFFFFFF;
中位线:(XY+YX)/2,LINETHICK1,COLORFFFFFF;
XX:IF(CURRBARSCOUNT<N+1,HH20,DRAWNULL),LINETHICK1,COLORFFFFFF;
YY:IF(CURRBARSCOUNT<N+1,LL20,DRAWNULL),LINETHICK1,COLORFFFFFF;
STICKLINE(CURRBARSCOUNT=1,HH20,LL20,0,0),COLORFFFFFF;
STICKLINE(CURRBARSCOUNT=N,HH20,LL20,0,0),COLORFFFFFF;
参考标准角:ATAN((HH20-LL20)/(N*K))*57.29633,COLORFFFFFF,NODRAW;
MAN:=MA(C,N),COLORAAAAFF;
DRAWTEXT(CURRBARSCOUNT=N-2,LL20*1.03,'主图画面参考标准角=45°'),COLORAAFFFF;
X角K:=CONST(REF(MAN,1)-MAN)*(CURRBARSCOUNT-1)+CONST(MAN);
MAN角斜线:DRAWLINE(CURRBARSCOUNT=N,X角K,CURRBARSCOUNT=1,X角K,0),LINETHICK2,COLOR00FFFF;
MAN角水平线:IF(CURRBARSCOUNT<=N,CONST(REF(MAN角斜线,N-1)),DRAWNULL),LINETHICK2,COLOR00FFFF;
STICKLINE(CURRBARSCOUNT=1,CONST(MAN角水平线),MAN角斜线,0.03,0),COLOR00FFFF;
MAN线:MAN,LINETHICK2,COLORAAAAFF;
MAN角:CONST(ATAN((MAN角斜线-MAN角水平线)/(N*K))*57.29633),NODRAW;
{三角形-飞狐版-by舍得快乐}
N的参数是10
ZQ:=DATACOUNT-BARPOS;
HH20:=REFX(HHV(H,N*3),ZQ);
LL20:=REFX(LLV(L,N*3),ZQ);
K:=(HH20-LL20)/(N),LINETHICK;
XY:LINEVALUE(ZQ+1=N,LL20,ZQ+1=1,HH20,0,0),LINETHICK1,COLORFFFFFF;
YX:LINEVALUE(ZQ+1=N,HH20,ZQ+1=1,LL20,0,0),LINETHICK1,COLORFFFFFF;
中位线:(XY+YX)/2,LINETHICK1,COLORFFFFFF;
XX:IF(ZQ+1<N+1,HH20,0),LINETHICK,COLORFFFFFF;
PARTLINE(ZQ+1<N,HH20),LINETHICK1,COLORFFFFFF;
YY:IF(ZQ+1<N+1,LL20,0),LINETHICK,COLORFFFFFF;
PARTLINE(ZQ+1<N,LL20),LINETHICK1,COLORFFFFFF;
STICKLINE(ZQ+1=1,HH20,LL20,0,0),COLORFFFFFF;
STICKLINE(ZQ+1=N,HH20,LL20,0,0),COLORFFFFFF;
//参考标准角:=ATAN((HH20-LL20)/(N*K))*57.29633,COLORFFFFFF,LINETHICK;
MAN:=MA(C,N),COLORAAAAFF;
DRAWTEXT(ZQ+1=N-2,LL20*1.03,'主图画面参考标准角=45°'),COLORAAFFFF;
X角K:=REFX(REF(MAN,1)-MAN,ZQ)*(ZQ)+REFX(MAN,ZQ);
MAN角斜线:LINEVALUE(ZQ+1=N,X角K,ZQ+1=1,X角K,0,0),LINETHICK2,COLOR00FFFF;
MAN角水平线A:=IF(ZQ+1<=N,REFX(REF(MAN角斜线,N-1),ZQ),0);
MAN角水平线:MAN角水平线A[DATACOUNT],LINETHICK,COLOR00FFFF;
PARTLINE(ZQ+1<N,MAN角水平线),LINETHICK2,COLOR00FFFF;
STICKLINE(ZQ+1=1,REFX(MAN角水平线,ZQ),MAN角斜线,0.8,0),COLOR00FFFF,LINETHICK2;
MAN线:MAN,LINETHICK2,COLORAAAAFF;
MAN角:REFX(ATAN((MAN角斜线-MAN角水平线)/(N*K))*57.29633,ZQ),LINETHICK;
641155381.png
|