通达信分割尺源码副图

 

分割尺源码

 

GD:=CONST(FINDHIGH(H,0,高点*10,1));

DD:=CONST(FINDLOW(L,0,低点*10,1));

GT:=CONST(BARSLAST(GD=H))+1;

DT:=CONST(BARSLAST(DD=L))+1;

SH:=CONST(IF(GT=1,H,REF(H,GT-1)));

SL:=CONST(IF(DT=1,L,REF(L,DT-1)));

CC:=IF(DT>GT,DT,GT);

CD:=INTPART(CC-(DT+GT)/2);

CG:=IF(高点>CD,CD/2,高点);

{黄金分割}

ZG:=IF(CURRBARSCOUNT<=CD,SH,DRAWNULL);

DRAWBAND(ZG,RGB(0,0,0),ZG,RGB(0,0,0)),DOTLINE,COLORLIRED;

ZD:=IF(CURRBARSCOUNT<=CD,SL,DRAWNULL);

DRAWBAND(ZD,RGB(0,0,0),ZD,RGB(0,0,0)),DOTLINE,COLORLIRED;

X191:=IF(CURRBARSCOUNT<=CD,SH-(SH-SL)*0.191,DRAWNULL);

DRAWBAND(X191,RGB(0,0,0),X191,RGB(0,0,0)),DOTLINE,COLORLIRED;

X382:=IF(CURRBARSCOUNT<=CD,SH-(SH-SL)*0.382,DRAWNULL);

DRAWBAND(X382,RGB(0,0,0),X382,RGB(0,0,0)),DOTLINE,COLORLIRED;

X500:=IF(CURRBARSCOUNT<=CD,SH-(SH-SL)*0.500,DRAWNULL);

DRAWBAND(X500,RGB(0,0,0),X500,RGB(0,0,0)),DOTLINE,COLORRED;

X618:=IF(CURRBARSCOUNT<=CD,SH-(SH-SL)*0.618,DRAWNULL);

DRAWBAND(X618,RGB(0,0,0),X618,RGB(0,0,0)),DOTLINE,COLORLIRED;

X809:=IF(CURRBARSCOUNT<=CD,SH-(SH-SL)*0.809,DRAWNULL);

DRAWBAND(X809,RGB(0,0,0),X809,RGB(0,0,0)),DOTLINE,COLORLIRED;

DRAWTEXT(CURRBARSCOUNT=CG,(ZD)*1.02,STRCAT('起点:  ',CON2STR(ZD,2))),COLORLIGRAY;

DRAWTEXT(CURRBARSCOUNT=CG,(X191)*0.986,STRCAT('80.9%  ',CON2STR(X191,2))),COLORLIGRAY;

DRAWTEXT(CURRBARSCOUNT=CG,(X382)*0.985,STRCAT('61.8%  ',CON2STR(X382,2))),COLORLIGRAY;

DRAWTEXT(CURRBARSCOUNT=CG,(X500)*0.984,STRCAT('50%  ',CON2STR(X500,2))),COLORLIGRAY;

DRAWTEXT(CURRBARSCOUNT=CG,(X618)*0.982,STRCAT('38.2%  ',CON2STR(X618,2))),COLORLIGRAY;

DRAWTEXT(CURRBARSCOUNT=CG,(X809)*0.98,STRCAT('19.1%  ',CON2STR(X809,2))),COLORLIGRAY;

DRAWTEXT(CURRBARSCOUNT=CG,(ZG)*0.98,STRCAT('100%  ',CON2STR(ZG,2))),COLORLIGRAY;

 

{斐波那契周期}

DRAWTEXT(CURRBARSCOUNT=GT-2 ,L*0.98,'3'),COLOR00FF00;

DRAWTEXT(CURRBARSCOUNT=GT-4 ,L*0.98,'5'),COLOR00FF00;

DRAWTEXT(CURRBARSCOUNT=GT-7 ,L*0.98,'8'),COLOR00FF00;

DRAWTEXT(CURRBARSCOUNT=GT-12 ,L*0.98,'13'),COLOR00FF00;

DRAWTEXT(CURRBARSCOUNT=GT-20 ,L*0.98,'21'),COLOR00FF00;

DRAWTEXT(CURRBARSCOUNT=GT-33 ,L*0.98,'34 '),COLOR00FF00;

DRAWTEXT(CURRBARSCOUNT=GT-54 ,L*0.98,'55'),COLOR00FF00;

DRAWTEXT(CURRBARSCOUNT=GT-88 ,L*0.98,'89'),COLOR00FF00;

DRAWTEXT(CURRBARSCOUNT=GT-143 ,L*0.98,'144'),COLOR00FF00;

DRAWTEXT(CURRBARSCOUNT=GT-232 ,L*0.98,'233'),COLOR00FF00;

DRAWTEXT(CURRBARSCOUNT=GT-376 ,L*0.98,'377'),COLOR00FF00;

 

DRAWTEXT(CURRBARSCOUNT=DT-2,H,'3'),DRAWABOVE,COLORRED;

DRAWTEXT(CURRBARSCOUNT=DT-4,H,'5'),DRAWABOVE,COLORRED;

DRAWTEXT(CURRBARSCOUNT=DT-7,H,'8'),DRAWABOVE,COLORRED;

DRAWTEXT(CURRBARSCOUNT=DT-12,H,'13'),DRAWABOVE,COLORRED;

DRAWTEXT(CURRBARSCOUNT=DT-20,H,'21'),DRAWABOVE,COLORRED;

DRAWTEXT(CURRBARSCOUNT=DT-33,H,'34'),DRAWABOVE,COLORRED;

DRAWTEXT(CURRBARSCOUNT=DT-54,H,'55'),DRAWABOVE,COLORRED;

DRAWTEXT(CURRBARSCOUNT=DT-88,H,'89'),DRAWABOVE,COLORRED;

DRAWTEXT(CURRBARSCOUNT=DT-143,H,'144'),DRAWABOVE,COLORRED;

DRAWTEXT(CURRBARSCOUNT=DT-232,H,'233'),DRAWABOVE,COLORRED;

DRAWTEXT(CURRBARSCOUNT=DT-376,H,'377'),DRAWABOVE,COLORRED;

{幅度尺}

STICKLINE(CURRBARSCOUNT=IF(DT<GT,DT,GT),SH,SL,0,-1),COLORRED;

STICKLINE(CURRBARSCOUNT=IF(DT>GT,DT,GT),SH,SL,0,-1),COLORGREEN;

DRAWTEXT(CURRBARSCOUNT=GT,SH-SH*0.1,STRCAT('一10%   ',CON2STR(SH-SH*0.1,2))),COLORBLUE;

DRAWTEXT(CURRBARSCOUNT=GT,SH-SH*0.15,STRCAT('一15%   ',CON2STR(SH-SH*0.15,2))),COLORCYAN;

DRAWTEXT(CURRBARSCOUNT=GT,SH-SH*0.2,STRCAT('一20%   ',CON2STR(SH-SH*0.2,2))),COLORGREEN;

DRAWTEXT(CURRBARSCOUNT=GT,SH-SH*0.3,STRCAT('一30%   ',CON2STR(SH-SH*0.3,2))),COLORWHITE;

DRAWTEXT(CURRBARSCOUNT=GT,SH-SH*0.4,STRCAT('一40%   ',CON2STR(SH-SH*0.4,2))),COLORYELLOW;

DRAWTEXT(CURRBARSCOUNT=GT,SH-SH*0.5,STRCAT('一50%   ',CON2STR(SH-SH*0.5,2))),COLORRED;

DRAWTEXT(CURRBARSCOUNT=GT,SH-SH*0.6,STRCAT('一60%   ',CON2STR(SH-SH*0.6,2))),COLORLIMAGENTA;

DRAWTEXT(CURRBARSCOUNT=GT,SH-SH*0.7,STRCAT('一70%   ',CON2STR(SH-SH*0.7,2))),COLORMAGENTA;

DRAWTEXT(CURRBARSCOUNT=GT,SH-SH*0.8,STRCAT('一80%   ',CON2STR(SH-SH*0.8,2))),COLORWHITE;

DRAWTEXT(CURRBARSCOUNT=GT,SH-SH*0.9,STRCAT('一90%   ',CON2STR(SH-SH*0.9,2))),COLORGREEN;

{分割尺

DRAWTEXT(CURRBARSCOUNT=DT,SL*1.1,STRCAT('一10%  ',CON2STR(SL*1.1,2))),COLORYELLOW;

DRAWTEXT(CURRBARSCOUNT=DT,SL*1.15,STRCAT('一15%  ',CON2STR(SL*1.15,2))),COLORWHITE;

DRAWTEXT(CURRBARSCOUNT=DT,SL*1.2,STRCAT('一20%  ',CON2STR(SL*1.2,2))),COLORGREEN;

DRAWTEXT(CURRBARSCOUNT=DT,SL*1.25,STRCAT('一25%  ',CON2STR(SL*1.25,2))),COLORLIMAGENTA;

DRAWTEXT(CURRBARSCOUNT=DT,SL*1.3,STRCAT('一30%  ',CON2STR(SL*1.3,2))),COLORRED;

DRAWTEXT(CURRBARSCOUNT=DT,SL*1.4,STRCAT('一40%  ',CON2STR(SL*1.4,2))),COLORYELLOW;

DRAWTEXT(CURRBARSCOUNT=DT,SL*1.5,STRCAT('一50%  ',CON2STR(SL*1.5,2))),COLORYELLOW;

DRAWTEXT(CURRBARSCOUNT=DT,SL*1.6,STRCAT('一60%  ',CON2STR(SL*1.6,2))),COLORYELLOW;

DRAWTEXT(CURRBARSCOUNT=DT,SL*1.7,STRCAT('一70%  ',CON2STR(SL*1.7,2))),COLORYELLOW;

DRAWTEXT(CURRBARSCOUNT=DT,SL*1.8,STRCAT('一80%  ',CON2STR(SL*1.8,2))),COLORYELLOW;

DRAWTEXT(CURRBARSCOUNT=DT,SL*1.9,STRCAT('一90%  ',CON2STR(SL*1.9,2))),COLORYELLOW;

DRAWTEXT(CURRBARSCOUNT=DT,SL*2,STRCAT('一100%  ',CON2STR(SL*2,2))),COLORYELLOW;

DRAWTEXT(CURRBARSCOUNT=DT,SL*2.25,STRCAT('一125%  ',CON2STR(SL*2.25,2))),COLORYELLOW;

DRAWTEXT(CURRBARSCOUNT=DT,SL*2.5,STRCAT('一150%  ',CON2STR(SL*2.5,2))),COLORYELLOW;

DRAWTEXT(CURRBARSCOUNT=DT,SL*2.75,STRCAT('一175%  ',CON2STR(SL*2.75,2))),COLORYELLOW;

DRAWTEXT(CURRBARSCOUNT=DT,SL*3,STRCAT('一200%  ',CON2STR(SL*3,2))),COLORYELLOW;

DRAWTEXT(CURRBARSCOUNT=DT,SL*3.5,STRCAT('一250%  ',CON2STR(SL*3.5,2))),COLORYELLOW;

DRAWTEXT(CURRBARSCOUNT=DT,SL*3.75,STRCAT('一275%  ',CON2STR(SL*375,2))),COLORYELLOW;

DRAWTEXT(CURRBARSCOUNT=DT,SL*4,STRCAT('一300%  ',CON2STR(SL*4,2))),COLORYELLOW;

DRAWTEXT(CURRBARSCOUNT=DT,SL*5,STRCAT('一400%  ',CON2STR(SL*5,2))),COLORYELLOW;

 




来函数检测结果如下
该公式包含未来函数:DHIGH
该公式包含未来函数:DLOW

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

相关指标公式

GD赋值:最高价在0日前的高点*10天内第1个最高价的最后一日取值设为常数
DD赋值:最低价在0日前的低点*10天内第1个最低价的最后一日取值设为常数
GT赋值:上次GD=最高价距今天数的最后一日取值设为常数+1
DT赋值:上次DD=最低价距今天数的最后一日取值设为常数+1
SH赋值:如果GT=1,返回最高价,否则返回GT-1日前的最高价的最后一日取值设为常数
SL赋值:如果DT=1,返回最低价,否则返回DT-1日前的最低价的最后一日取值设为常数
CC赋值:如果DT>GT,返回DT,否则返回GT
CD赋值:CC-(DT+GT)/2的整数部分
CG赋值:如果高点>CD,返回CD/2,否则返回高点
ZG赋值:如果到最后交易的周期<=CD,返回SH,否则返回无效数
画带状线,DOTLINE,画淡红色
ZD赋值:如果到最后交易的周期<=CD,返回SL,否则返回无效数
画带状线,DOTLINE,画淡红色
X191赋值:如果到最后交易的周期<=CD,返回SH-(SH-SL)*0.191,否则返回无效数
画带状线,DOTLINE,画淡红色
X382赋值:如果到最后交易的周期<=CD,返回SH-(SH-SL)*0.382,否则返回无效数
画带状线,DOTLINE,画淡红色
X500赋值:如果到最后交易的周期<=CD,返回SH-(SH-SL)*0.500,否则返回无效数
画带状线,DOTLINE,画红色
X618赋值:如果到最后交易的周期<=CD,返回SH-(SH-SL)*0.618,否则返回无效数
画带状线,DOTLINE,画淡红色
X809赋值:如果到最后交易的周期<=CD,返回SH-(SH-SL)*0.809,否则返回无效数
画带状线,DOTLINE,画淡红色
当满足条件到最后交易的周期=CG时,在(ZD)*1.02位置书写文字,画淡灰色
当满足条件到最后交易的周期=CG时,在(X191)*0.986位置书写文字,画淡灰色
当满足条件到最后交易的周期=CG时,在(X382)*0.985位置书写文字,画淡灰色
当满足条件到最后交易的周期=CG时,在(X500)*0.984位置书写文字,画淡灰色
当满足条件到最后交易的周期=CG时,在(X618)*0.982位置书写文字,画淡灰色
当满足条件到最后交易的周期=CG时,在(X809)*0.98位置书写文字,画淡灰色
当满足条件到最后交易的周期=CG时,在(ZG)*0.98位置书写文字,画淡灰色
当满足条件到最后交易的周期=GT-2时,在最低价*0.98位置书写文字,COLOR00FF00
当满足条件到最后交易的周期=GT-4时,在最低价*0.98位置书写文字,COLOR00FF00
当满足条件到最后交易的周期=GT-7时,在最低价*0.98位置书写文字,COLOR00FF00
当满足条件到最后交易的周期=GT-12时,在最低价*0.98位置书写文字,COLOR00FF00
当满足条件到最后交易的周期=GT-20时,在最低价*0.98位置书写文字,COLOR00FF00
当满足条件到最后交易的周期=GT-33时,在最低价*0.98位置书写文字,COLOR00FF00
当满足条件到最后交易的周期=GT-54时,在最低价*0.98位置书写文字,COLOR00FF00
当满足条件到最后交易的周期=GT-88时,在最低价*0.98位置书写文字,COLOR00FF00
当满足条件到最后交易的周期=GT-143时,在最低价*0.98位置书写文字,COLOR00FF00
当满足条件到最后交易的周期=GT-232时,在最低价*0.98位置书写文字,COLOR00FF00
当满足条件到最后交易的周期=GT-376时,在最低价*0.98位置书写文字,COLOR00FF00
当满足条件到最后交易的周期=DT-2时,在最高价位置书写文字,显示在位置之上,画红色
当满足条件到最后交易的周期=DT-4时,在最高价位置书写文字,显示在位置之上,画红色
当满足条件到最后交易的周期=DT-7时,在最高价位置书写文字,显示在位置之上,画红色
当满足条件到最后交易的周期=DT-12时,在最高价位置书写文字,显示在位置之上,画红色
当满足条件到最后交易的周期=DT-20时,在最高价位置书写文字,显示在位置之上,画红色
当满足条件到最后交易的周期=DT-33时,在最高价位置书写文字,显示在位置之上,画红色
当满足条件到最后交易的周期=DT-54时,在最高价位置书写文字,显示在位置之上,画红色
当满足条件到最后交易的周期=DT-88时,在最高价位置书写文字,显示在位置之上,画红色
当满足条件到最后交易的周期=DT-143时,在最高价位置书写文字,显示在位置之上,画红色
当满足条件到最后交易的周期=DT-232时,在最高价位置书写文字,显示在位置之上,画红色
当满足条件到最后交易的周期=DT-376时,在最高价位置书写文字,显示在位置之上,画红色
当满足条件到最后交易的周期=如果DT当满足条件到最后交易的周期=如果DT>GT,返回DT,否则返回GT时,在SH和SL位置之间画柱状线,宽度为0,-1不为0则画空心柱.,画绿色
当满足条件到最后交易的周期=GT时,在SH-SH*0.1位置书写文字,画蓝色
当满足条件到最后交易的周期=GT时,在SH-SH*0.15位置书写文字,画青色
当满足条件到最后交易的周期=GT时,在SH-SH*0.2位置书写文字,画绿色
当满足条件到最后交易的周期=GT时,在SH-SH*0.3位置书写文字,画白色
当满足条件到最后交易的周期=GT时,在SH-SH*0.4位置书写文字,画黄色
当满足条件到最后交易的周期=GT时,在SH-SH*0.5位置书写文字,画红色
当满足条件到最后交易的周期=GT时,在SH-SH*0.6位置书写文字,画淡洋红色
当满足条件到最后交易的周期=GT时,在SH-SH*0.7位置书写文字,画洋红色
当满足条件到最后交易的周期=GT时,在SH-SH*0.8位置书写文字,画白色
当满足条件到最后交易的周期=GT时,在SH-SH*0.9位置书写文字,画绿色

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

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