通达信自用黄金分割主图指标公式

 

N:=16;
N1:=N*10;
CY:=BArslAST(CURRBARSCOUNT=N1);
GD:=CONST(IF(ISLASTBAR=1,HHV(H,CY),0));
DD:=CONST(IF(ISLASTBAR=1,LLV(L,CY),0));
预顶百分比%:(GD-C)/C*100,NODRAW;
H5:=GD-(GD-DD)*0.191;
H4:=GD-(GD-DD)*0.382;
H3:=GD-(GD-DD)*0.5;
H2:=GD-(GD-DD)*0.618;
H1:=GD-(GD-DD)*0.809;
DH5:=STRCAT(STRCAT('80.9% ',CON2STR(H5,3)),'');
DH4:=STRCAT(STRCAT('61.8% ',CON2STR(H4,3)),'');
DH3:=STRCAT(STRCAT('50.0% ',CON2STR(H3,3)),'');
DH2:=STRCAT(STRCAT('38.2% ',CON2STR(H2,3)),'');
DH1:=STRCAT(STRCAT('19.1% ',CON2STR(H1,3)),'');
BASE:=STRCAT(STRCAT('BASE ',CON2STR(DD,3)),' 随浪飞扬');
{ _最新股票指标公式}
%100:=STRCAT(STRCAT('100% ',CON2STR(GD,3)),'');
DRAWBAND(IF(CURRBARSCOUNT<=1,DD,DRAWNULL),
RGB(16,36,46),IF(CURRBARSCOUNT<=N1,DD,DRAWNULL)-(H4-H3)/2,RGB(0,0,0));
{DRAWBAND(IF(CURRBARSCOUNT<=N1,GD,DRAWNULL)+(H4-H3)/2,
RGB(16,36,46),IF(CURRBARSCOUNT<=N1,DD,DRAWNULL)-(H4-H3)/2,RGB(0,0,0));}{背景}
DRAWKLINE(H,O,L,C);
DRAWBAND(IF(CURRBARSCOUNT<=N1,H1,DRAWNULL),RGB(200,0,200),H1,RGB(0,0,0));
DRAWBAND(IF(CURRBARSCOUNT<=N1,H2,DRAWNULL),RGB(200,0,200),H2,RGB(0,0,0));
DRAWBAND(IF(CURRBARSCOUNT<=N1,H3,DRAWNULL),RGB(200,0,200),H3,RGB(0,0,0));
DRAWBAND(IF(CURRBARSCOUNT<=N1,H4,DRAWNULL),RGB(200,0,200),H4,RGB(0,0,0));
DRAWBAND(IF(CURRBARSCOUNT<=N1,H5,DRAWNULL),RGB(200,0,200),H5,RGB(0,0,0));
DRAWBAND(IF(CURRBARSCOUNT<=N1,GD,DRAWNULL),RGB(200,0,200),GD,RGB(0,0,0));
DRAWBAND(IF(CURRBARSCOUNT<=N1,DD,DRAWNULL),RGB(200,0,200),DD,RGB(0,0,0));
DRAWTEXT(CURRBARSCOUNT=N1-1,H5,DH5),COLORAA99AA;
DRAWTEXT(CURRBARSCOUNT=N1-1,H4,DH4),COLORAA99AA;
DRAWTEXT(CURRBARSCOUNT=N1-1,H3,DH3),COLORAA99AA;
DRAWTEXT(CURRBARSCOUNT=N1-1,H2,DH2),COLORAA99AA;
DRAWTEXT(CURRBARSCOUNT=N1-1,H1,DH1),COLORAA99AA;
DRAWTEXT(CURRBARSCOUNT=N1-1,DD,BASE),COLORAA99AA;
DRAWTEXT(CURRBARSCOUNT=N1-1,GD,%100),COLORAA99AA;




来函数检测结果如下
该公式没有未来函数


解密、定制、编写公式指标请联系QQ或微信同号:88652583
置顶指标

相关指标公式

N赋值:16
N1赋值:N*10
CY赋值:上次到最后交易的周期=N1距今天数
GD赋值:如果是否最后一个周期=1,返回CY日内最高价的最高值,否则返回0的最后一日取值设为常数
DD赋值:如果是否最后一个周期=1,返回CY日内最低价的最低值,否则返回0的最后一日取值设为常数
输出预顶百分比%:(GD-收盘价)/收盘价*100,NODRAW
H5赋值:GD-(GD-DD)*0.191
H4赋值:GD-(GD-DD)*0.382
H3赋值:GD-(GD-DD)*0.5
H2赋值:GD-(GD-DD)*0.618
H1赋值:GD-(GD-DD)*0.809
DH5赋值:字符串相加
DH4赋值:字符串相加
DH3赋值:字符串相加
DH2赋值:字符串相加
DH1赋值:字符串相加
BASE赋值:字符串相加
%100赋值:字符串相加
画带状线
K线
画带状线
画带状线
画带状线
画带状线
画带状线
画带状线
画带状线
当满足条件到最后交易的周期=N1-1时,在H5位置书写文字,COLORAA99AA
当满足条件到最后交易的周期=N1-1时,在H4位置书写文字,COLORAA99AA
当满足条件到最后交易的周期=N1-1时,在H3位置书写文字,COLORAA99AA
当满足条件到最后交易的周期=N1-1时,在H2位置书写文字,COLORAA99AA
当满足条件到最后交易的周期=N1-1时,在H1位置书写文字,COLORAA99AA
当满足条件到最后交易的周期=N1-1时,在DD位置书写文字,COLORAA99AA
当满足条件到最后交易的周期=N1-1时,在GD位置书写文字,COLORAA99AA

指标安装下载帮助  |   联系我们  |  乐淘公式网  |  公式网   |  指标公式  |   加入收藏   |  设为主页

@2005-2025 浙ICP备2024071487号-1 乐淘公式网公式网均来源互联网收集整理,如不慎侵犯了你的权益,请联系我们告知,我们将做删除处理
免责声明:乐淘公式网所有指标公式及文章由网络收集,不保障实时性和真实性, 仅供学习研究并不构成投资建议,请勿以此为依据进行股票交易,由此引起的投资亏损与本站无关。
QQ:88652583 微信 88652583
sitemap站点地图