线的角度公式、源码主图指标公式演示图[通达信公式]
相关标签:
原理解析:
来源:程序化99( WWW.CXH99.COM )
源码:
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;
DRAWTEXT_FIX(C>O,0.01,0.9,0,' WWW.CXH99.COM '),COLORRED;
DRAWTEXT_FIX(C>O,1,1,0,'程序化交易模型'),COLORRED;
公式导入教程: 【通达信公式源码导入方法教程】 【同花顺公式源码导入方法教程】 【大智慧新一代公式源码导入方法教程】
有思路,想编写各种指标公式,程序化交易模型,选股公式,预警公式的朋友
可联系技术人员 QQ: 511411198 进行 有偿 编写!(不贵!点击查看价格!)
相关文章
-
没有相关内容