股资源-股票学习站-学炒股-股票课程-炒股教程-分析选股指标-入门基础知识

 找回密码
 注册昵称

QQ登录

只需一步,快速开始

搜索
上一主题 下一主题

[通达信] 线的角度(源码、主图、贴图)


    [-----复制链接-----]
楼主
 通达信源码安装路径:1,工具栏点击公式选项。2,弹出公式窗口点击新建。3,把源码复制到指标编辑器保存。4,回到K线图界面安装建立好的公式 || 2024-3-10 19:16:01
线的角度(源码、主图、贴图)介绍

线的角度(源码、主图、贴图)

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;
 


 






gd15813

回复

举报

QQ|

GMT+8, 2024-12-27 18:56

快速回复 返回顶部 返回列表