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

 找回密码
 注册昵称

QQ登录

只需一步,快速开始

搜索
上一主题 下一主题

[大智慧] 波段黄金分割公式-(源码)


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

波段黄金分割公式-(源码)

{波段黄金分割公式----源码}

a1:=zig(3,N); {N自行设置:一般为2、3、5、8、13、21等等}

a2:=last(a1>ref(a1,1));
a3:=last(a1<ref(a1,1));

tt1:=peak(1,N,1);
bb1:=trough(2,N,1);

H1:=tt1-(tt1-bb1)*0.236;
H2:=tt1-(tt1-bb1)*0.382;
H3:=tt1-(tt1-bb1)*0.5;
H4:=tt1-(tt1-bb1)*0.618;
H5:=tt1-(tt1-bb1)*0.764;
H6:=tt1-(tt1-bb1)*1.0;
H7:=tt1-(tt1-bb1)*1.27;
H8:=tt1-(tt1-bb1)*1.618;

L1:=bb1+(tt1-bb1)*0.236;
L2:=bb1+(tt1-bb1)*0.382;
L3:=bb1+(tt1-bb1)*0.5;
L4:=bb1+(tt1-bb1)*0.618;
L5:=bb1+(tt1-bb1)*0.764;
L6:=bb1+(tt1-bb1)*1.0;
L7:=bb1+(tt1-bb1)*1.27;
L8:=bb1+(tt1-bb1)*1.618;

stickline(a3>0,tt1,tt1,8,0),linethick2,colorred;
stickline(a2>0,bb1,bb1,8,0),linethick2,colorred;

stickline(a3>0,H1,H1,8,0),linethick0,colorFF99CC;
stickline(a3>0,H2,H2,8,0),linethick0,colorFF99CC;
stickline(a3>0,H3,H3,8,0),linethick0,colorFF99CC;
stickline(a3>0,H4,H4,8,0),linethick0,colorFF99CC;
stickline(a3>0,H5,H5,8,0),linethick0,colorFF99CC;
stickline(a3>0,H6,H6,8,0),linethick0,colorFF99CC;
stickline(a3>0,H7,H7,8,0),linethick0,colorFF99CC;
stickline(a3>0,H8,H8,8,0),linethick0,colorFF99CC;

drawtext(a3=1,H1,'23.6%'),linethick0,colorFF99CC;
drawtext(a3=1,H2,'38.2%'),linethick0,colorFF99CC;
drawtext(a3=1,H3,'50%'),linethick0,colorFF99CC;
drawtext(a3=1,H4,'61.8%'),linethick0,colorFF99CC;
drawtext(a3=1,H5,'76.4%'),linethick0,colorFF99CC;
drawtext(a3=1,H6,'100%'),linethick0,colorFF99CC;
drawtext(a3=1,H7,'127%'),linethick0,colorFF99CC;
drawtext(a3=1,H8,'161.8%'),linethick0,colorFF99CC;

stickline(a2>0,L1,L1,8,0),linethick0,colorFF99CC;
stickline(a2>0,L2,L2,8,0),linethick0,colorFF99CC;
stickline(a2>0,L3,L3,8,0),linethick0,colorFF99CC;
stickline(a2>0,L4,L4,8,0),linethick0,colorFF99CC;
stickline(a2>0,L5,L5,8,0),linethick0,colorFF99CC;
stickline(a2>0,L6,L6,8,0),linethick0,colorFF99CC;
stickline(a2>0,L7,L7,8,0),linethick0,colorFF99CC;
stickline(a2>0,L8,L8,8,0),linethick0,colorFF99CC;

drawtext(a2=1,L1*1.015,'23.6%'),linethick0,colorFF99CC;
drawtext(a2=1,L2*1.015,'38.2%'),linethick0,colorFF99CC;
drawtext(a2=1,L3*1.015,'50%'),linethick0,colorFF99CC;
drawtext(a2=1,L4*1.015,'61.8%'),linethick0,colorFF99CC;
drawtext(a2=1,L5*1.015,'76.4%'),linethick0,colorFF99CC;
drawtext(a2=1,L6*1.015,'100%'),linethick0,colorFF99CC;
drawtext(a2=1,L7*1.015,'127%'),linethick0,colorFF99CC;
drawtext(a2=1,L8*1.015,'161.8%'),linethick0,colorFF99CC;
 


 




 



gd16216

回复

举报

QQ|

GMT+8, 2024-11-16 23:15

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