通达信双向黄金分割指标副图
N:=6000;
高:=REFDATE(HHV(H,N),DATE);
低:=REFDATE(LLV(L,N),DATE);
H1:=高-(高-低)*0.191;
H2:=高-(高-低)*0.382;
H3:=高-(高-低)*0.5;
H4:=高-(高-低)*0.618;
H5:=高-(高-低)*0.809;
H6:=高-(高-低)*0.764;
H7:=高-(高-低)*0.236;
STICKLINE(CURRBARSCOUNT=8,高,高,0,1),COLORGREEN;
STICKLINE(CURRBARSCOUNT=8,H1,H1,0,1),COLORCYAN;
STICKLINE(CURRBARSCOUNT=8,H2,H2,0,1),COLORCCCCCC;
DRAWTEXT(CURRBARSCOUNT=10,高,' 1.000'),COLORGREEN;
DRAWTEXT(CURRBARSCOUNT=10,H1,'0.809'),COLORCYAN;
DRAWTEXT(CURRBARSCOUNT=10,H2,' 0.618'),COLORFFFFFF;
DRAWTEXT(CURRBARSCOUNT=10,H3,' 0.500'),COLORYELLOW;
DRAWTEXT(CURRBARSCOUNT=10,H4,' 0.382'),COLORLIRED;
DRAWTEXT(CURRBARSCOUNT=10,H6,' 0.236'),COLORGREEN;
DRAWTEXT(CURRBARSCOUNT=10,H5,' 0.191'),COLORMAGENTA;
DRAWTEXT(CURRBARSCOUNT=10,H7,' 0.764'),COLORRED;
DRAWTEXT(CURRBARSCOUNT=10,低,' 0.000'),COLORRED;
STICKLINE(CURRBARSCOUNT=8,H3,H3,0,1),COLORYELLOW;
STICKLINE(CURRBARSCOUNT=8,H4,H4,0,1),COLORLIRED;
STICKLINE(CURRBARSCOUNT=8,H6,H6,0,1),COLORGREEN;
STICKLINE(CURRBARSCOUNT=8,H5,H5,0,1),COLORMAGENTA;
STICKLINE(CURRBARSCOUNT=8,低,低,0,1),COLORRED;
STICKLINE(CURRBARSCOUNT=8,H7,H7,0,1),COLORRED;
DRAWTEXT(CURRBARSCOUNT=50,高*0.99,CON2STR(高,2)),COLORGREEN;
DRAWTEXT(CURRBARSCOUNT=50,H1,CON2STR(H1,2)),COLORCYAN;
DRAWTEXT(CURRBARSCOUNT=50,H2,CON2STR(H2,2)),COLORFFFFFF;
DRAWTEXT(CURRBARSCOUNT=50,H3,CON2STR(H3,2)),COLORYELLOW;
DRAWTEXT(CURRBARSCOUNT=50,H6,CON2STR(H6,2)),COLORGREEN;
DRAWTEXT(CURRBARSCOUNT=50,H4,CON2STR(H4,2)),COLORLIRED;
DRAWTEXT(CURRBARSCOUNT=50,H5,CON2STR(H5,2)),COLORMAGENTA;
DRAWTEXT(CURRBARSCOUNT=50,H7,CON2STR(H7,2)),COLORRED;
DRAWTEXT(CURRBARSCOUNT=50,低*1.01,CON2STR(低,2)),COLORRED;
HDAY:=800;LDAY:=800;调点:=3;角度:=100;
CURR:=CURRBARSCOUNT;
TCH:=CONST(FINDHIGH(H,0,HDAY*10,1));
GTT:=CONST(BARSLAST(TCH=H))+1;
SX跌H:=CONST(IF(GTT=1,H,REF(H,GTT-1)));
BCL:=CONST(FINDLOW(L,0,LDAY*10,1));
DTT:=CONST(BARSLAST(BCL=L))+1;
SX涨L:=CONST(IF(DTT=1,L,REF(L,DTT-1)));
涨点:=BARSSINCE(BACKSET(ISLASTBAR,BARSLAST(L=SX涨L)+1));
跌点:=BARSSINCE(BACKSET(ISLASTBAR,BARSLAST(H=SX跌H)+1));
最低:=IF(调点=1,跌点,IF(调点=2,涨点,IF(调点=3,涨点,跌点)));
L斜率:=角度/IF(C<300,1000,10);
最高:=IF(调点=1,跌点,IF(调点=2,涨点,IF(调点=3,跌点,涨点)));
H斜率:=角度/IF(C<300,1000,10);
IM68:=((SX跌H-SX涨L)/6-(SX跌H-SX涨L)/8);
GH跌X:=SX跌H+(SX跌H-SX涨L)/8;
DL涨X:=SX涨L-(SX跌H-SX涨L)/8;
GTHT:=IF(DTT>GTT,DTT,GTT);
{黄金分割}
X000:IF(CURR<=GTHT,SX跌H-(SX跌H-SX涨L)*0.000,DRAWNULL),DOTLINE,COLOR556600;
DRAWTEXT(CURR=GTHT,(X000)*1.001,STRCAT(' 0.000 ',CON2STR(X000,2))),COLORF5CCEB;
X191:IF(CURR<=GTHT,SX跌H-(SX跌H-SX涨L)*0.191,DRAWNULL),DOTLINE,COLOR556600;
DRAWTEXT(CURR=GTHT,(X191)*1.001,STRCAT(' 0.191 ',CON2STR(X191,2))),COLORF5CCEB;
X236:IF(CURR<=GTHT,SX跌H-(SX跌H-SX涨L)*0.236,DRAWNULL),DOTLINE,COLOR556600;
DRAWTEXT(CURR=GTHT,(X236)*1.001,STRCAT(' 0.236 ',CON2STR(X236,2))),COLORF5CCEB;
X382:IF(CURR<=GTHT,SX跌H-(SX跌H-SX涨L)*0.382,DRAWNULL),DOTLINE,COLOR556600;
DRAWTEXT(CURR=GTHT,(X382)*1.001,STRCAT(' 0.382 ',CON2STR(X382,2))),COLORF5CCEB;
X500:IF(CURR<=GTHT,SX跌H-(SX跌H-SX涨L)*0.500,DRAWNULL),DOTLINE,COLOR556600;
DRAWTEXT(CURR=GTHT,(X500)*1.001,STRCAT(' 0.500 ',CON2STR(X500,2))),COLORF5CCEB;
X618:IF(CURR<=GTHT,SX跌H-(SX跌H-SX涨L)*0.618,DRAWNULL),DOTLINE,COLOR556600;
DRAWTEXT(CURR=GTHT,(X618)*1.001,STRCAT(' 0.618 ',CON2STR(X618,2))),COLORF5CCEB;
X764:IF(CURR<=GTHT,SX跌H-(SX跌H-SX涨L)*0.764,DRAWNULL),DOTLINE,COLOR556600;
DRAWTEXT(CURR=GTHT,(X764)*1.001,STRCAT(' 0.764 ',CON2STR(X764,2))),COLORF5CCEB;
X809:IF(CURR<=GTHT,SX跌H-(SX跌H-SX涨L)*0.809,DRAWNULL),DOTLINE,COLOR556600;
DRAWTEXT(CURR=GTHT,(X809)*1.001,STRCAT(' 0.809 ',CON2STR(X809,2))),COLORF5CCEB;
X1:IF(CURR<=GTHT,SX跌H-(SX跌H-SX涨L)*1.000,DRAWNULL),DOTLINE,COLOR556600;
DRAWTEXT(CURR=GTHT,(X1)*1.001,STRCAT(' 1.000. ',CON2STR(X1,2))),COLORF5CCEB;
来函数检测结果如下:
该公式包含未来函数:BACKSET
该公式包含未来函数:DHIGH
该公式包含未来函数:DLOW
解密、定制、编写公式指标请联系QQ或微信同号:88652583
置顶指标
相关指标公式
N赋值:6000
高赋值:日期日N日内最高价的最高值
低赋值:日期日N日内最低价的最低值
H1赋值:高-(高-低)*0.191
H2赋值:高-(高-低)*0.382
H3赋值:高-(高-低)*0.5
H4赋值:高-(高-低)*0.618
H5赋值:高-(高-低)*0.809
H6赋值:高-(高-低)*0.764
H7赋值:高-(高-低)*0.236
当满足条件到最后交易的周期=8时,在高和高位置之间画柱状线,宽度为0,1不为0则画空心柱.,画绿色
当满足条件到最后交易的周期=8时,在H1和H1位置之间画柱状线,宽度为0,1不为0则画空心柱.,画青色
当满足条件到最后交易的周期=8时,在H2和H2位置之间画柱状线,宽度为0,1不为0则画空心柱.,COLORCCCCCC
当满足条件到最后交易的周期=10时,在高位置书写文字,画绿色
当满足条件到最后交易的周期=10时,在H1位置书写文字,画青色
当满足条件到最后交易的周期=10时,在H2位置书写文字,COLORFFFFFF
当满足条件到最后交易的周期=10时,在H3位置书写文字,画黄色
当满足条件到最后交易的周期=10时,在H4位置书写文字,画淡红色
当满足条件到最后交易的周期=10时,在H6位置书写文字,画绿色
当满足条件到最后交易的周期=10时,在H5位置书写文字,画洋红色
当满足条件到最后交易的周期=10时,在H7位置书写文字,画红色
当满足条件到最后交易的周期=10时,在低位置书写文字,画红色
当满足条件到最后交易的周期=8时,在H3和H3位置之间画柱状线,宽度为0,1不为0则画空心柱.,画黄色
当满足条件到最后交易的周期=8时,在H4和H4位置之间画柱状线,宽度为0,1不为0则画空心柱.,画淡红色
当满足条件到最后交易的周期=8时,在H6和H6位置之间画柱状线,宽度为0,1不为0则画空心柱.,画绿色
当满足条件到最后交易的周期=8时,在H5和H5位置之间画柱状线,宽度为0,1不为0则画空心柱.,画洋红色
当满足条件到最后交易的周期=8时,在低和低位置之间画柱状线,宽度为0,1不为0则画空心柱.,画红色
当满足条件到最后交易的周期=8时,在H7和H7位置之间画柱状线,宽度为0,1不为0则画空心柱.,画红色
当满足条件到最后交易的周期=50时,在高*0.99位置书写文字,画绿色
当满足条件到最后交易的周期=50时,在H1位置书写文字,画青色
当满足条件到最后交易的周期=50时,在H2位置书写文字,COLORFFFFFF
当满足条件到最后交易的周期=50时,在H3位置书写文字,画黄色
当满足条件到最后交易的周期=50时,在H6位置书写文字,画绿色
当满足条件到最后交易的周期=50时,在H4位置书写文字,画淡红色
当满足条件到最后交易的周期=50时,在H5位置书写文字,画洋红色
当满足条件到最后交易的周期=50时,在H7位置书写文字,画红色
当满足条件到最后交易的周期=50时,在低*1.01位置书写文字,画红色
HDAY赋值:800
LDAY赋值:800
调点赋值:3
角度赋值:100
CURR赋值:到最后交易的周期
TCH赋值:最高价在0日前的HDAY*10天内第1个最高价的最后一日取值设为常数
GTT赋值:上次TCH=最高价距今天数的最后一日取值设为常数+1
SX跌H赋值:如果GTT=1,返回最高价,否则返回GTT-1日前的最高价的最后一日取值设为常数
BCL赋值:最低价在0日前的LDAY*10天内第1个最低价的最后一日取值设为常数
DTT赋值:上次BCL=最低价距今天数的最后一日取值设为常数+1
SX涨L赋值:如果DTT=1,返回最低价,否则返回DTT-1日前的最低价的最后一日取值设为常数
涨点赋值:首次若是否最后一个周期则将最近上次最低价=SX涨L距今天数+1周期置为1距今天数
跌点赋值:首次若是否最后一个周期则将最近上次最高价=SX跌H距今天数+1周期置为1距今天数
最低赋值:如果调点=1,返回跌点,否则返回如果调点=2,返回涨点,否则返回如果调点=3,返回涨点,否则返回跌点
L斜率赋值:角度/如果收盘价<300,返回1000,否则返回10
最高赋值:如果调点=1,返回跌点,否则返回如果调点=2,返回涨点,否则返回如果调点=3,返回跌点,否则返回涨点
H斜率赋值:角度/如果收盘价<300,返回1000,否则返回10
IM68赋值:((SX跌H-SX涨L)/6-(SX跌H-SX涨L)/8)
GH跌X赋值:SX跌H+(SX跌H-SX涨L)/8
DL涨X赋值:SX涨L-(SX跌H-SX涨L)/8
GTHT赋值:如果DTT>GTT,返回DTT,否则返回GTT
输出X000:如果CURR<=GTHT,返回SX跌H-(SX跌H-SX涨L)*0.000,否则返回无效数,DOTLINE,COLOR556600
当满足条件CURR=GTHT时,在(X000)*1.001位置书写文字,COLORF5CCEB
输出X191:如果CURR<=GTHT,返回SX跌H-(SX跌H-SX涨L)*0.191,否则返回无效数,DOTLINE,COLOR556600
当满足条件CURR=GTHT时,在(X191)*1.001位置书写文字,COLORF5CCEB
输出X236:如果CURR<=GTHT,返回SX跌H-(SX跌H-SX涨L)*0.236,否则返回无效数,DOTLINE,COLOR556600
当满足条件CURR=GTHT时,在(X236)*1.001位置书写文字,COLORF5CCEB
输出X382:如果CURR<=GTHT,返回SX跌H-(SX跌H-SX涨L)*0.382,否则返回无效数,DOTLINE,COLOR556600
当满足条件CURR=GTHT时,在(X382)*1.001位置书写文字,COLORF5CCEB
输出X500:如果CURR<=GTHT,返回SX跌H-(SX跌H-SX涨L)*0.500,否则返回无效数,DOTLINE,COLOR556600
当满足条件CURR=GTHT时,在(X500)*1.001位置书写文字,COLORF5CCEB
输出X618:如果CURR<=GTHT,返回SX跌H-(SX跌H-SX涨L)*0.618,否则返回无效数,DOTLINE,COLOR556600
当满足条件CURR=GTHT时,在(X618)*1.001位置书写文字,COLORF5CCEB
输出X764:如果CURR<=GTHT,返回SX跌H-(SX跌H-SX涨L)*0.764,否则返回无效数,DOTLINE,COLOR556600
当满足条件CURR=GTHT时,在(X764)*1.001位置书写文字,COLORF5CCEB
输出X809:如果CURR<=GTHT,返回SX跌H-(SX跌H-SX涨L)*0.809,否则返回无效数,DOTLINE,COLOR556600
当满足条件CURR=GTHT时,在(X809)*1.001位置书写文字,COLORF5CCEB
输出X1:如果CURR<=GTHT,返回SX跌H-(SX跌H-SX涨L)*1.000,否则返回无效数,DOTLINE,COLOR556600
当满足条件CURR=GTHT时,在(X1)*1.001位置书写文字,COLORF5CCEB